This repository contains all my personal projects Option Pricing Model using Python.
This notebook is a simple Python's implemention of analytical formulas of vanilla options including European and America call and put options. It also contains formulas of binary put, call and forward contract.
We started with testing their consistencies to determine their correctness including put-call parity and relationship among all paramters in the Black-Scholes model.
Then we validated all formulas using the Monte Carlo method. The following is a plot of using Monte-Carlo method to price European put, call and binary put, call options.
We also implemented Euler-Maruyama method to simulate the dynamic of stock price under Geometric Brownian Motion Stochastic Differential Equation. The following is a plot its simulation.
2. Vanilla Greeks using finite difference, pathwise derivative estimate and likelihood ratio methods.ipynb
This notebook performs sensitivity analysis on options' value by applying finite difference and Monte Carlo methods. We also implemented numerical methods such as pathwise derivative estimate and likelihood ratio methods to approximate option's greeks.
For example, to calculate delta of an European call option, pathwise derivative estimate asserts that
Therefore, to calculate the delta, one can apply Monte-Carlo method to calculate the final expectation.On the other hand, the likelihood ratio method asserts that
Therefore, one can use the Monte-Carlo method again to calculate the final expectation.This notebook uses various binomial trees simulation including CRR and discretize GBM to price options. The following plots contain convergence of CRR and GBM simulations for European and Binary call and put options. Green line is the analytical pricing obtained by Black-Scholes.
The parameters are spot = 100
, strike = 100
, volatility = 0.1
, risk-free interest rate = 0.05
, dividend = 0
and time to maturity = 2
.
For BS price at both American call and put options, the green line corresponds to the respective European call and put option. Since dividend is zero, both American and European call should worth the same, which is illustrated in the American call plot below.