In[]:=
d1[S_,k_,r_,δ_,σ_,T_]=(Log[S/k]+(r-δ+
2
σ
/2)T)σ
T
;​​d2[S_,k_,r_,δ_,σ_,T_]=(Log[S/k]+(r-δ-
2
σ
/2)T)σ
T
;​​[z_]=1+Erfz
2
2;​​​​BSCall[S_,k_,r_,δ_,σ_,T_]:=S
-δT

[d1[S,k,r,δ,σ,T]]-k
-rT

[d2[S,k,r,δ,σ,T]];​​​​BSPut[S_,k_,r_,δ_,σ_,T_]:=k
-rT

[-d2[S,k,r,δ,σ,T]]-S
-δT

[-d1[S,k,r,δ,σ,T]];​​​​BSCallDelta[S_,k_,r_,δ_,σ_,T_]=D[BSCall[S,k,r,δ,σ,T],S];​​​​BSPutDelta[S_,k_,r_,δ_,σ_,T_]=D[BSPut[S,k,r,δ,σ,T],S];​​​​BSCallGamma[S_,k_,r_,δ_,σ_,T_]=D[BSCall[S,k,r,δ,σ,T],{S,2}];​​​​BSPutGamma[S_,k_,r_,δ_,σ_,T_]=D[BSPut[S,k,r,δ,σ,T],{S,2}];​​​​BSCallTheta[S_,k_,r_,δ_,σ_,T_]=-D[BSCall[S,k,r,δ,σ,T],T];​​​​BSPutTheta[S_,k_,r_,δ_,σ_,T_]=-D[BSPut[S,k,r,δ,σ,T],T];​​​​BSCallRho[S_,k_,r_,δ_,σ_,T_]=D[BSCall[S,k,r,δ,σ,T],r];​​​​BSPutRho[S_,k_,r_,δ_,σ_,T_]=D[BSPut[S,k,r,δ,σ,T],r];​​​​BSCallVega[S_,k_,r_,δ_,σ_,T_]=D[BSCall[S,k,r,δ,σ,T],σ];​​​​BSPutVega[S_,k_,r_,δ_,σ_,T_]=D[BSPut[S,k,r,δ,σ,T],σ];
In[]:=
Manipulate[​​Plot[BSHedge[S,k,r,δ,σ,t],{k,1500.,3000.},AxesLabel{"strike price","option sensitivity"},ImageSize400,​​ImagePadding{{25,30},{25,25}},AxesOrigin{Automatic,0}],​​{{BSHedge,BSCallDelta,"call sensitivities"},{BSCallDelta"call delta",BSCallGamma"call gamma",BSCallRho"call rho",BSCallVega"call vega",BSCallTheta"call theta"}},{{BSHedge,BSPutDelta,"put sensitivities"},{BSPutDelta"put delta",BSPutGamma"put gamma",BSPutRho"put rho",BSPutVega"put vega",BSPutTheta"put theta"}},​​{{S,3000.,"index price"},1500.,3000.},{{r,.0175,"interest rate"},.0025,.05},{{δ,.02,"dividend yield"},0.0,.05},{{σ,.3,"volatility"},.1,2.5},{{t,.01,"time to maturity"},.01,.1},SaveDefinitionsTrue,AutorunSequencing{4,6,7}]
Out[]=
​
call sensitivities
call delta
call gamma
call rho
call vega
call theta
put sensitivities
put delta
put gamma
put rho
put vega
put theta
index price
interest rate
dividend yield
volatility
time to maturity