题目: Let S0 = 10, r = 0.03, sigma= 0.4, and dt = 1/52. We want to simulate weekly prices of the
stock Si, i = 1: 52 for a 1-year period.
Suppose that you want to determine the price of a European call option maturing in 1-year with strike
price K = 12. Use simulation techniques to estimate this price.
我写的程序跑出来都是0....
程序如下
function c=ucoption(S,K,sigma,r,T,M,N)
for i=1:N
for i=1:M
S=S*exp((r-0.5*sigma^2)*T+sigma*(T^0.5)*randn);
St(1,i)=S;
end
c=exp(-r*T)*max(S-K,0);
C(1,i)=c;
end
没学过编程= =,求骂醒!