Next: , Previous: , Up: Octave Functions and Scripts   [Contents][Index]


5.76 option_bs

Function File: [value delta gamma vega theta rho omega] = option_bs (CallPutFlag, S, X, T, r, sigma, divrate)

Compute the prices of european call or put options according to Black-Scholes valuation formula:

C(S,T) = N(d_1)*S - N(d_2)*X*exp(-rT)
P(S,T) = N(-d_2)*X*exp(-rT) - N(-d_1)*S
d1 = (log(S/X) + (r + 0.5*sigma^2)*T)/(sigma*sqrt(T))
d2 = d1 - sigma*sqrt(T)

The Greeks are also computed (delta, gamma, vega, theta, rho, omega) by their closed form solution.
Parallel computation for column vectors of S,X,r and sigma is possible.

Variables:

See also: option_willowtree, swaption_black76.