| [call,put]=PowerOption(S,k,r,T,sigma,d,a)
|
function [call,put]=PowerOption(S,k,r,T,sigma,d,a)
%S: price of stock; d: dividend rate;
%T: time to maturity; a: gearing factor;
[call,put]=blsp(S^a,k,r,T,a*sigma,(1-a)*r+a*d-a*(a-1)*sigma^2/2);
function [call,put]=blsp(S,k,r,T,sigma,d)
d1 = log(S/k) + (r - d + sigma^2/2) * T;
d1 = d1 /(sigma*sqrt(T));
d2 = d1 - (sigma*sqrt(T));
d1(isnan(d1)) = 0;
d2(isnan(d2)) = 0;
call = S* exp(-d*T) * normcdf( d1) - ...
k* exp(-r*T) * normcdf( d2);
put = k* exp(-r*T) * normcdf(-d2) - ...
S* exp(-d*T) * normcdf(-d1);
|
|