Description:
%Example: Note requires the financial toolbox function blsprice S=50; K=50; sigma=0.4; r=0.1; T=1; steps=200; a=[]; b=[]; counter=0; for k=5:5:steps counter=counter+1; a(counter)=TreeMy(S,K,sigma,r,T,k); b(counter)=blsprice(S,K,r,T,sigma); end k=5:5:steps; plot(k,a,'b'); hold on plot (k,b,':r'); hold off title('Option price as a function of the number of steps'); ylabel('Option price'); xlabel('Number of steps, n');
Got a question or problem with this link? Just enter your message and click on submit. No registration is required.
|