フィルターのクリア

Option pricing code: a problem on dimension

1 回表示 (過去 30 日間)
Zeynep Toprak
Zeynep Toprak 2020 年 5 月 13 日
編集済み: Zeynep Toprak 2020 年 5 月 13 日
I would like to generate a code to calculate option pricing by using stock prices which follows geometric brownian motion process.
My code is as follows:
%define given values
t = 1;
n = 100;
s0=100;
mu = 0.1;
sigma = 0.05;
dt = t/n;
%calculate stock price which follows geometric brownian motion process
s=s0*exp((mu-1/2*sigma^2)*dt+sigma*randn(n,1)*sqrt(dt));
x = 125; %exercise price
r = 0.0446; %interest rate
T = 0.0575; %maturity time
%calculate call option value by BSM model.
d1 = (log(s./x) - [r+ ((sigma^2)/2)]* T)/(sigma * sqrt(T));
d2 = d1 - (sigma* sqrt(T));
Nd1 = normcdf(d1);
Nd2 = normcdf (d2);
%call value
C = s .* Nd1 - x * exp(-r * T) .* Nd2 ;
disp(C)
I get many call values, but I need to find only one call value. And All call values are equal to zero. Why? How can I correct this?
One more question is that I am not sure whether I determine maturity time (T) by myself or not. How should I do?
Thanks a lot. But please help me to get just one call value.

回答 (0 件)

カテゴリ

Help Center および File ExchangePrice and Analyze Financial Instruments についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by