Research Article

Accuracy, Robustness, and Efficiency of the Linear Boundary Condition for the Black-Scholes Equations

Algorithm 1

%  European call option
clear;clc;clf;K=100;L=3*K;T=1.0;sigma=0.35;r=0.05;Nx=L+1;dt=0.01;
Nt=round(T/dt); x=linspace(0,L,Nx); h=x(2)-x(1);payoff=max(x-K,0);
d1=(log(x/K)+(r+sigma2/2)*T)/(sigma*sqrt(T));d2=d1-sigma*sqrt(T);
exact=x.*normcdf(d1)-K*exp(-r*T).*normcdf(d2);grid on; hold on
plot(x,payoff,k-,x,exact,k-,LineWidth,1) axis image,
axis ([0 300 -12.5 220])