Hi,
I have this code here:
S0=10K=10T=0.2Tt=0.05Vola=0.2r=0.02x=[0:0.001:20];y1=blsprice(S0,K,r,T,Vola)-blsprice(x,K,r,Tt,Vola);y2=blsprice(S0,K,r,T,Vola)-blsprice(x,K,r,T,Vola);plot(x,y1,'k',x,y2)xlabel('Stock Price ($)');ylabel('Gain ($)');axis([8 12 -1 0.5]);set(gca,'xtick',8.5:0.5:12)text(10.05,0.25,'Call short at t=t','color','k');text(8.35,0.25,'Call short at t=0','color','b');line([0 ; 12],[0 ; 0],'color','k')%line([10 ; 10],[-1 ; 1],'color','k')
set(gca,'Box','off')
By selecting everything and pressing F9, it's working perfectly. However, if I press F5, I get this error message:
Undefined function 'delta_hedge_call_short_portfolio_t1_option' for inputarguments of type 'char'.
Do you have any idea what is not working here?
Best Answer