Skip to content

Determine implied volatility according to Black-Scholes dynamics.

Notifications You must be signed in to change notification settings

sandershortway/BlackScholesHeston

Repository files navigation

Python scripts for BlackScholes, Heston models

I've created a Python scripts for various use cases for the Black-Scholes model and the more advanced Heston model.

Black-Scholes-Merton model

We want to be able to calculate the price of an European call and an European put option, provided we know the parameters that the model should adhere to. Furthermore, if we enter all but the volatility of the stock and a market price for a European call option, we want to be able to calculate the volatility that would have yielded the correct option price using the formula. This volatility is called the implied volatility. Since there is no direct formula to solve for the implied volatility we have implemented the bisection root-finding algorithm.

Heston model

We want to be able to calculate the price of a European call option using both numerical methods for the integrals and using Monte Carlo methods. Also, to be able to calibrate the model provided you enter marketprices of European call options. This will be done using the Differential Evolution algorithm. Also, it should be able to determine the price of some complex exotic options.

To-do list

The Black-Scholes Model

  • Calculate price of European call option
  • Calculate price of European put option
  • Calculate price of European call option using simulation
  • Calculate price of European put option using simulation
  • Calculate price of Forward contract
  • Calculate implied volatility
  • Surface plot of price for various strikes and maturities
  • Surface plot of implied volatility for various strikes and maturities

The Heston Model

  • Check if Feller condition is satisfied
  • Generate sample paths of S(t)
  • Generate sample paths of v(t)
  • Calculate price of European call option using numerical estimation of integrals
  • Calculate price of European call option using Monte Carlo simulation
  • Calculate price of European put option using put-call parity
  • Calibrating the Heston model to market data
  • Pricing of various exotic options using Monte Carlo simulation

Brownian Motion

  • Generate sample path of Brownian motion
  • Generate sample path of correlated Brownian motion
  • Generate sample path of Brownian motion with drift
  • Generate sample path of Geometric Brownian motion

Historical Volatility

  • Generate stock price graph
  • Determine the correlation between upwards movements and volatility
  • Generate historical volatility graph

Differential Evolution

  • Evaluate minimization objective function for particular set of parameters
  • Generate test data for testing algorithm

Contact

Email: sanderkorteweg@gmail.com

Releases

No releases published

Packages

No packages published

Languages