This project is made to calculate the following call options:
- European
- Barrier up-and-down (exotic)
- Lookback (exotic)
by 3 methods:
- Monte Carlo simulations
- Exact solution by the Black-Sholes formula
- Numerical solution of the Black-Sholes partial differential equation.
The code is implemented on python. Exact solution for european call and exotic ones rewritten from Shreve (see below), Monte Carlo simulations for exotics uses joint distribution for Wiener process and it's maximum on
This project is made during the MSc program "Financial mathematics and financial technologies" in Sirius University, Sochi, Russia.
Examples of using this code coulde be found in example.ipynb notebook.
Calculations mainly based on "Shreve, Stochastic Calculus for Finance II - Continuous Time Models, Springer Finance-v.2, Springer-2004".
For price of call option
European call is classical option with payoff:
Where
where
where
Black-Sholes PDE for european call option has the form:
with initial and border conditions:
This equation could be significantly simplified by variable substitution:
This substitution leads to the equation:
with initial and border condiditions:
The equation above is solved by Crank-Nicolson scheme and tridiagonal matrix algorithm is used for solving system of linear equations problem.
Barrier call option is considered as exotic option, which value becomes equal to 0, if the value of underlying asset
where
where
by integrating from
It should be mentioned, that method described above differs from methods where full trajectories are generated. The latter method is much simplier to implement and do not require knowledge of joint distribution of
Equation for barrier call is equal to europeans call one:
but with another initital and border conditions:
This equation also solved by Crank-Nicolson scheme.
Lookback option is exotic option with floating strike, which payoff depends on
Calculation is based on generation of
which is exact probability specified in barrier call section.
Random variable
which leads to:
where
The arguments given above about advantages of this method of simulations for barrier option also hold for lookback option.
After operation of dimension reduction (see Shreve) equation for lookback call also follows the pde above. This operation consist of substititution variable
with initial and border conditions:
After calculations and return to initial variables the value of option price could be computed as: