Compute values of call and put options as well as the Greeks - the sensitivities of the option price to various input arguments using the Generalized Black Scholes model. "Generalized" means that the asset can have a continuous dividend yield.
GenBS(s, X, r, Sigma, t, div_yield = 0)
the spot price of the asset (the stock price for options on stocks)
the exercise or strike price of the option
the continuously compounded rate of interest in decimal (0.10 or 10e-2 for 10%)
(use equiv.rate
to convert to a continuously compounded rate)
the volatility of the asset price in decimal (0.20 or 20e-2 for 20%)
the maturity of the option in years
the continuously compounded dividend yield (0.05 or 5e-2 for 5%)
(use equiv.rate
to convert to a continuously compounded rate)
A list of the following elements
the value of a call option
the value of a put option
a list of the following elements
the delta of a call option - the sensitivity to the spot price of the asset
the delta of a put option - the sensitivity to the spot price of the asset
the theta of a call option - the time decay of the option value with passage of time. Note that time is measured in years. To find a daily theta divided by 365.
the theta of a put option
the gamma of a call or put option - the second derivative with respect to the spot price or the sensitivity of delta to the spot price
the vega of a call or put option - the sensitivity to the volatility
the rho of a call option - the sensitivity to the interest rate
the rho of a put option - the sensitivity to the interest rate
a list of the following elements
the d1 of the Generalized Black Scholes formula
the d2 of the Generalized Black Scholes formula
is pnorm
(d1)
is pnorm
(d2)
is pnorm
(-d1)
is pnorm
(-d2)
the (risk neutral) probability that the call will be exercised = Nd2
the (risk neutral) probability that the put will be exercised = Nminusd2
The Generalized Black Scholes formula for call options is
\(e^{-r t} (s \; e^{g t} \; Nd1 - X \; Nd2)\)
where
\(g = r - div\_yield\)
\(Nd1 = N(d1)\) and \(Nd2 = N(d2)\)
\(d1 = \frac{log(s / X) + (g + Sigma^2/ 2) t}{Sigma \sqrt{t}}\)
\(d2 = d1 - Sigma \sqrt{t}\)
N denotes the normal CDF (pnorm
)
For put options, the formula is
\(e^{-r t} (-s \; e^{g t} \; Nminusd1 + X \; Nminusd2)\)
where
\(Nminusd1 = N(-d1)\) and \(Nminusd2 = N(-d2)\)