/* ** Version 01 ** Date : 20/07/2001 ** -------------------------------------------------------------------------- ** Copyright K.Cuthbertson and D. Nitzsche ** "Financial Engineering:Derivatives and Risk Manangement" - J. Wiley 2001 ** ** Leeson straddle is computed and plotted Figure B10.1 p. 284 ** */ new ; cls ; format /m1/rd 10,4 ; output on ; screen on ; /* output file = c:\docs\arun\out.out reset ; */ @ Check path for output file @ /* ** " ----------------------------------------------- " ; ** " Input variables " ; ** " ------------------- " ; ** " k = strike price " ; ** " s = stock price " ; ** " sigma = standard deviation(proportion) " ; ** " tau = time to maturity(years, T-t) " ; ** " r = contin. compounded rate(p.a.) " ; ** " dt = time increment " ; ** " ----------------------------------------------- " ; */ /* ----------------------------------------------------------- USER INPUT ---------------------------------------------------------- */ k = 19000 ; @ strike on Nikkei @ s0 = 19000 ; @ initial value of Nikkei @ s1 = 17000 ; @ final value of Nikkei @ sigma = 15/100 ; tau = 60/365 ; @ time to maturity (years) @ r = 5.35/100 ; /* ---------------------- END OF USER INPUT ------------------- */ {c0} = bscall(k,s0,sigma,tau,r) ; {p0} = bsput (k,s0,sigma,tau,r) ; {c1} = bscall(k,s1,sigma,tau,r) ; {p1} = bsput (k,s1,sigma,tau,r) ; s = seqa( s0-6000./2, 100, 60 ) ; @ -- set up a series for s -- @ {c} = bscall(k,s,sigma,tau,r) ; {p} = bsput (k,s,sigma,tau,r) ; leeson = - ( p + c ) + ( p0+c0 ) ; /* " Print out of data for c~p~s~leeson = " c~p~s~leeson ; */ " -------------------------------------------------------------------------------- " ; " Input variables " ; " ------------------------------------------------------------------------------- " ; " k = strike price " k ; " s0~s1 = stock prices(index units) " s0~s1 ; " sigma = standard deviation(proportion) " sigma ; " tau = time to maturity(years, T-t) " tau; " r = contin. compounded rate(propn. p.a.) " r ; " ------------------------------------------------------------------------------------------ " ; ?; " Initial receipts from short straddle (index units) " p0+c0 ; " Final value of short straddle (index units) " -(p1+c1) ; " Loss in value of straddle(index units): Nikkei 19000 to 17000 " (p0+c0)-(p1+c1) ; " ------------------------------------------------------------------------------------------- " ; /* --------------------------------------------------------------------- Graph the Leeson Straddle --------------------------------------------------------------------- */ library gauss pgraph ; graphset ; x_axis = s ; y_axis = leeson~zeros(60,1) ; title("Leeson Short Straddle: Nikkei Index ") ; xy(x_axis, y_axis) ; @ ----------- 3-D Graph for leeson v/s Underlying and Volatility -------- @ k = 19000 ; S = 17000 ; sigma = 0.15 ; tau = 90/365 ; r = 0.0535 ; sigma = seqa(0.15,0.005,40) ; s = seqa( s0-6000./2, 100, 60 ) ; x = zeros(60,40); i=1; do until i>40; x[.,i]= - bscall(k,s,sigma[i],tau,r) - bsput(k,s,sigma[i],tau,r) + 2.*( p0+c0 ); i=i+1; endo; title("Leeson Short Straddle: Nikkei Index ") ; xlabel("Volatility"); ylabel("Nikkei-225 Index x 10^-4"); zlabel("Value of Lesson's straddle"); _pdate=""; _pframe=0; surface(sigma',s,x); @ ------------------------------- END OF MAIN PROGRAM --------------------------------------- @ /* ------------------------------------------------------------------------------------------ Procedures to follow ------------------------------------------------------------------------------------------ */ @ ---------------------------- Black-Scholes Call and Put (without dividends) --------------- @ proc bscall(k,s,sigma,tau,r); local d1,d2,c ; d1=( ln(s./k) + ( r + sigma^2/2).*tau ) ./ ( sigma.*sqrt(tau) ) ; d2=d1 - sigma.*sqrt(tau); c=s.*cdfn(d1)-k.*exp(-r.*tau).*cdfn(d2); retp(c); endp; proc bsput(k,s,sigma,tau,r); local d1,d2,p ; d1=( ln(s./k) + ( r + sigma^2/2).*tau ) ./ ( sigma.*sqrt(tau) ) ; d2=d1 - sigma.*sqrt(tau); p= k.*exp(-r.*tau).*cdfn(-d2) - s.*cdfn(-d1); retp(p); endp; end ;