# Barrier option : Monte carlo simulation

I am trying to price a Down-and-Out Call using Monte Carlo simulation. The problem is that I get the right price for the vanilla option (same price as the analytic formula of Black and Scholes) but I do not get the right price for the down-and-out Call.

S0 = 105   % Price of underlying
sig = 0.28;      % vol
mu = 0.0025;   % drift
B = 101       % Barrier
K = 100       % Strike


In particular, the right price is 4.14 while I get around 5 with Monte carlo simulation. Can you help me ?

nbrsim = 10000;
S = zeros(nbrsim,nbre_step+1);

for j = 1:nbrsim
S(j,1)=S0;
for i = 1:nbrstep
t(i+1)=t(i)+dt;
Z = normrnd(0,1);
S(j,i+1)=S(j,i) + mu*S(j,i)*dt + S(j,i) * sig * sqrt(dt) * Z;
end
ST(j)=S(j,nbrstep+1);
end

K=100
B = 101

for j = 1:nbrsim
if min(S(j,:)) <= B
l(j) = 0;
else
l(j) = 1;
end
vectpayoffs(j) = l(j)*max(ST(j) - K,0);
end

r= 0.0025
DF = exp(- r * T);
Downout = DF * 1/nbrsim * sum(vectpayoffs)


I don't understand why I don't get the right price. Is there a mistake here?

Thank you !

• Give out your implementation. Are you sure your stochastic process stops upon reaching the barrier?? Jan 7 '16 at 0:20
• What method do you use to detect that the barrier has been crossed? Jan 7 '16 at 1:52

first question, are you talking about continuous or discrete barrier? they difference is very important. when you price cont barrier with MC you actually cannot observe stock continuously you observe it discretely. the latter cause mispricing. so you have to make adjustment to your price. or you can price your barrier with simulation brownian bridge: you simulate terminal stock price then calculate probability that random variable (process) crosses barrier given initial and terminal stock prices, time and vol. there is some nice research paper on this topic, but i dont remember its name and authors. just google pricing barriers with brownian bridge, or the problem continuous vs dicrete

• Hello, which type of adjustment are you talking about ? Are you saying that I cannot get the right price with the monte carlo simulations that I specified above ? Thank you !
– Poco
Jan 8 '16 at 21:19
• look at the paper "A continuity correction for discrete barrier options". adjustment is: multiply your barrier B by exp(+/-0.5826*sigma*SQRT(T/num_steps)) Jan 9 '16 at 8:27
• Thank you mxzzzzz, with the adjustment my monte carlo simulation is fine !
– Poco
Jan 12 '16 at 10:21

why do you have

vectpayoffs(j) = l(j)*(ST(j) - K);

if it is a knockout call, it should be l(j)*max(ST(j, maturityDate) -K, 0).

I assumed that j indicates which simulation it is, and you have columnwise the dates.

However you have stated before that for ordinary vanilla calls you get the correct solution which is odd. If adding the max does not help, why not post all of your matlab code. We can have a quick look at how all your variables and stuff are really defined.

Code i went over your code. and with the modification of max(ST -K,0) it seems to me that your code produces the correct results (although you coded it up quite inefficient in matlab with your double for loop).

The output of the code below is Downout = 4.9797 and call_vanilla = 14.2127. You can compare that against a barrier option pricer on the web. for example

The webpricer gave me 4.94 which might be explainable by daycount conventions, rounding etc.

http://www.fintools.com/resources/online-calculators/exotics-calculators/exoticscalc-barrier/

S0 = 105   % Price of underlying
sig = 0.28;      % vol

K=100
B = 101 %
%B = 0.001 %set very low B to pretend to be vanilla.
r= 0.0025
mu = r % you are simulating the risk neutral process. not the real world
T = 1

nbrsim = 10000;
nbre_step = 256
S = zeros(nbrsim,nbre_step+1);

dt = 1 / nbre_step
for j = 1:nbrsim
S(j,1)=S0;
for i = 1:nbre_step
%not needed t(i+1)=t(i)+dt;
Z = normrnd(0,1);
S(j,i+1)=S(j,i) + mu*S(j,i)*dt + S(j,i) * sig * sqrt(dt) * Z;
end
ST(j)=S(j,nbre_step+1);
end

for j = 1:nbrsim
if min(S(j,:)) <= B
l(j) = 0;
else
l(j) = 1;
end
vectpayoffs(j) = l(j)*max(ST(j) - K,0);
end

DF = exp(- r * T);
Downout = DF * 1/nbrsim * sum(vectpayoffs)

%sanity check against black scholes
call_vanilla = blsprice(105, 100, r, T, sig)

• Thank you for your answer, I posted my matlab code, do you see a mistake ?
– Poco
Jan 8 '16 at 13:59
• Hello mbison, thank you for your reply. However, when I use the webpricer I get 4.14 not 4.94 with Boundary price = B = 101 and Exercise Price = K = 100. I do not understand why ?
– Poco
Jan 8 '16 at 20:19
• you are correct regarding the 4.14. mea culpa. i made a typo in the web pricer. I entered 0.0025% for the rate. If you enter 0.25% I see a price of 4.14 as well. Maybe the web pricer does not do continous barrier. I am not sure. I can look into it a bit more and get back to you. In the mean time why dont you take a book like hull (or some other book) and look up an example where they price a continous barrier. Plug in the same parameters in your matlab and see if you can match those numbers. Jan 8 '16 at 20:30
• No problem, do you have any suggestion about this mispricing since the code seems to be correct (although its inefficiency). Thank you!
– Poco
Jan 8 '16 at 20:38
• But even if the price was not 4.14, I think there is a problem in this monte carlo simulation since I cannot get the right Delta of this barrier option (which is close to 1 while I get 0.3) ?
– Poco
Jan 8 '16 at 20:46