Mathematics, Science, statistics, economics, finance, econometrics, Business Mathematics, statistical analysis, R language, Computer Science, Stock Analysis, APPLE Stock Analysis, Amazon stock Analysis, GARCH model, Arch model,q-q plot,ols, regression, Time Series, t-test, cofactor, variance, standard deviation,Matlab,Nifty 50 Analysis,BMW stock analysis,

Email Subscribers

Enter your email address:

Delivered by FeedBurner

Monday, 28 October 2019

Greek in option

How to use Greek  in option  

Greek  in option

Greek  in option  

> library("optionstrat", lib.loc="~/R/win-library/3.6")
> vertical("call", s = 100, x1 = 90, x2 = 110, t = (45/365), r =  0.025, sigma = 0.20, vol = 0.25)
                    V1
Spot            100.00
Short.Strike     90.00
Long.Strike     110.00
Max.Profit       10.13
Max.Loss         -9.87
Breakeven       100.13
Prob.BE           0.50
Prob.Max.Profit   0.17
Prob.Max.Loss     0.17
Initial.DC       10.13
>
> tdiff("2018-01-01", "2018-06-30", "days")
[1] 180
> r.cont(0.12, 2)
[1] 0.1165378
> puttheta(100, 100, 0.20, (45/365), 0.02, 0.02)
[1] -0.02979083
> putrho(100, 100, 0.20, (45/365), 0.02, 0.02)
[1] -0.06321441
> putpremium(100, 100, 0.20, (45/365), 0.02, 0.02)
[1] 2.794086
> putpremium(10, 10, 0.20, (5/365), 0.02, 0.02)
[1] 0.09335761
> putpremium(10, 10, 0.20, (1/365), 0.02, 0.02)
[1] 0.04176071
> putgreek("vega", 100, 100, 0.20, (45/365), 0.02, 0.02)
[1] 0.1396469
> puteval(100, 100, 0.20, (45/365), 0.02, 0.02)
   Premium      Delta      Gamma      Vega
1 2.794086 -0.4847982 0.05663458 0.1396469
        Theta         Rho
1 -0.02979083 -0.06321441
> putdelta(100, 0.20, (45/365), 0.02, 0.02)
[1] 0
> prob.btwn(spot = 100, lower = 90, upper = 110, mean = 0, dsd = 0.01, dte = 45)
[1] 0.8639629
> prob.btwn(spot = 100, mean = 0, dsd = 0.01, dte = 45, p = 0.75, quantile = TRUE)
  probability percent.change     price
1        0.75    -0.07716778  92.28322
2        0.75     0.07716778 107.71678
> prob.below(spot = 100, upper = 110, mean = 0, dsd = 0.01, dte = 45)
[1] 0.9319814
> prob.below(spot = 100, mean = 0, dsd = 0.01, dte = 45, p = 0.75, quantile = TRUE)
  probability percent.change    price
1        0.75     0.04524615 104.5246
> prob.above(spot = 100, lower = 110, mean = 0, dsd = 0.01, dte = 45)
[1] 0.06801856
> prob.above(spot = 100, mean = 0, dsd = 0.01, dte = 45, p = 0.75, quantile = TRUE)
  probability percent.change    price
1        0.75    -0.04524615 95.47539
> plotvertical("call", 100, 90, 110, (45/365), 0.02, 0.20)
> plotbullput(s= 100, x1 = 95, x2 = 105, t = (45/365), r = 0.02,sigma = 0.20, sigma2 = 0.20, d = 0, ll = 0.75, ul = 1.25)
>
> plotbullcall(s= 100, x1 = 95, x2 = 105, t = (45/365), r = 0.02,sigma = 0.20, sigma2 = 0.20, d = 0, ll = 0.75, ul = 1.25)
> plotbearput(s= 100, x1 = 95, x2 = 105, t = (45/365), r = 0.02,sigma = 0.20, sigma2 = 0.20, d = 0, ll = 0.75, ul = 1.25)
> plotbearcall(s= 100, x1 = 95, x2 = 105, t = (45/365), r = 0.02,sigma = 0.20, sigma2 = 0.20, d = 0, ll = 0.75, ul = 1.25)
> optionvega(100, 100, 0.20, (45/365), 0.02, 0.02)
[1] 0.1396469
> optiongamma(100, 100, 0.20, (45/365), 0.02, 0.02)
[1] 0.05663458
> opteval(100, 100, 0.20, (45/365), 0.02, 0.02)
  Option  Premium      Delta      Gamma      Vega
1   Call 2.794086  0.5127391 0.05663458 0.1396469
2    Put 2.794086 -0.4847982 0.05663458 0.1396469
        Theta         Rho
1 -0.02979083  0.05976964
2 -0.02979083 -0.06321441
> lambda(type = "put", s = 100, x = 100, sigma = 0.15, t = 45/365, r = 0.02)
[1] -23.80998
> lambda(type = "call", s = 100, x = 100, sigma = 0.15, t = 45/365, r = 0.02)
[1] 23.79544
> iv.calc(type = "call", price = 2.93, s = 100, x = 100, t = (45/365), r = 0.02, d = 0)
[1] 0.201
>
> dv(s = 100, x1 = 90, x2 = 95, x3 = 105, x4 = 110, t = 0.08, r = 0.02, sigma = 0.2, vol = 0.3)
                    V1
Spot            100.00
Long.Put         90.00
Short.Put        95.00
Short.Call      105.00
Long.Call       110.00
Lower.BE         94.01
Higher.BE       105.99
Prob.BE           0.45
Prob.Max.Profit   0.38
Prob.Max.Loss     0.32
> calltheta(100, 100, 0.20, (45/365), 0.02, 0.02)
[1] -0.02979083
> callrho(100, 100, 0.20, (45/365), 0.02, 0.02)
[1] 0.05976964
> callpremium(100, 100, 0.20, (45/365), 0.02, 0.02)
[1] 2.794086
> callgreek("delta", 100, 100, 0.20, (45/365), 0.02, 0.02)
[1] 0.5127391
> callgreek("gamma", 100, 100, 0.20, (45/365), 0.02, 0.02)
[1] 0.05663458
Conclision
> calleval(100, 100, 0.20, (45/365), 0.02, 0.02)
   Premium     Delta      Gamma      Vega
1 2.794086 0.5127391 0.05663458 0.1396469
        Theta        Rho
1 -0.02979083 0.05976964
> calldelta(100, 100, 0.20, (45/365), 0.02, 0.02)
[1] 0.5127391

No comments:

Post a Comment

Greeks in the option market

How to calculate greeks in the option market  plotbullcall(s= 100, x1 = 95, x2 = 105, t = (45/365), r = 0.02,sigma = 0.20, sigma2 = 0...