Produced for course Computational Finance: Pricing and Valuation, Autumn 2019. The project uses Monte Carlo methods to price barrier options, this specific implementation is for Up-And-Out barrier options, but can easily be modified to work for other barrier options as well.
barrier.m is a normal Monte Carlo simulation, while barrierExit.m also uses a conditional exit probability and uniformly distributed random variables to model the price in continuous time, as described by Moon, Kyoung-Sook in EFFICIENT MONTE CARLO ALGORITHM FOR PRICING BARRIER OPTIONS.
The results are compared to an analyical solution and plotted as a function of the number of timesteps and/or simulations. A method to compute the delta of the option has also been implemented.
In MATLAB, simply run:
- runMethods.m , with desired parameters to compute price of option.
- plotMethods.m , to plot estimated price and error of option as a function of timesteps/simulations.
- deltaMC.m , to compute delta of option. Compare to slide 8 in presentation.
Presentation hosted on Dropbox