No BSD License  

Highlights from
Matlab-GUI equity derivative calculator

image thumbnail

Matlab-GUI equity derivative calculator

by

 

24 May 2007 (Updated )

equity derivative calculator using matlab GUI

ExchangeValue=ExchangeOption(S1,S2,d1,d2,q1,q2,T,sigma1,sigma2,rho)
function ExchangeValue=ExchangeOption(S1,S2,d1,d2,q1,q2,T,sigma1,sigma2,rho)

%S: price of stock; d: dividend rate;q: number of shares to exchange;
%T: time to maturity; sigma: volatility of stock return;
%rho: correlation of S1 and S2 return;  get S1, exchange S2, (S1-S2)+;

sigma=sqrt(sigma1^2+sigma2^2-2*rho*sigma1*sigma2);
dd1=(log(q1*S1/(q2*S2))+(d2-d1+sigma^2/2)*T)/(sigma*sqrt(T));
dd2=dd1-sigma*sqrt(T);
ExchangeValue=q1*S1*exp(-d1*T)*normcdf(dd1)-q2*S2*exp(-d2*T)*normcdf(dd2);

Contact us