1. THE BLACK-SCHOLES OPTION PRICING FORMULA (Black-Scholes (1973))
Theorem. Consider a European call option on a stock whose current price is S. Suppose that the stock price is lognormally distributed with volatility R, that the option’s exercise price is X, that the exercise date of the option is T , and that the continuously compounded interest rate is r . Furthermore assume that the stock will pay no dividends before the option exercise date T . Then the call price is given by:
C = SN (d1) - Xe-rT N(d2)‚
Where d1=(ln(S/X)+(r+σ2/2)/T)/(σ√T), d2=d1-σ√T. And N() means values of the cumulative
standard normal distribution. (We can use Erf[x/1.41421 3562373095048801688724]/2+0.5 to Calculate N() in Mathematica)
Also Put-Call Parity Theorem tell us P=C+ Xe-rT -S.
So it is ready to calculate the option if we know the above parameter.
Here is the mathematical code
snormal[x_]:=Erf[x/1.414213562373095048801688724]/2+0.5;
Clear[d1, d2, bsCall, bsPut]
d1[s_, x_, sigma_, T_, r_]:=(Log[s/x]+(r+sigma^2/2)*T)/
(sigma*Sqrt[T])
d2[s_, x_, sigma_, T_, r_]:=d1[s, x, sigma, T, r]-sigma*Sqrt[T]
bsCall[s_, x_, sigma_, T_, r_]:=
s*snormal[d1[s,x,sigma,T,r]]-x*Exp[-r*T]*snormal[d2[s,x,sigma,T,r]]
bsPut[s_,x_,sigma_,T_,r_]:=bsCall[s,x,sigma,T,r]+x*Exp[-r*T]-s
Later, I will show how to calculate this using Quantlib, the practical issue for this point is 1) How to define
the date interval 2) Inversely calculate the volatility surface 3) How to calibrate the model 4) How to work our C++ program with the Excel
(to be continue)
Saturday, October 6, 2007
Subscribe to:
Comments (Atom)