All Projects → hsjharvey → Option-Pricing

hsjharvey / Option-Pricing

Licence: MIT license
European/American/Asian option pricing module. BSM/Monte Carlo/Binomial

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Option-Pricing

PROJ Option Pricing Matlab
Quant Option Pricing - Exotic/Vanilla: Barrier, Asian, European, American, Parisian, Lookback, Cliquet, Variance Swap, Swing, Forward Starting, Step, Fader
Stars: ✭ 85 (+93.18%)
Mutual labels:  option-pricing, american-options, black-scholes, european-options
Financial Models Numerical Methods
Collection of notebooks about quantitative finance, with interactive python code.
Stars: ✭ 3,534 (+7931.82%)
Mutual labels:  option-pricing, american-options
option-pricing-models
Simple python/streamlit web app for European option pricing using Black-Scholes model, Monte Carlo simulation and Binomial model. Spot prices for the underlying are fetched from Yahoo Finance API.
Stars: ✭ 16 (-63.64%)
Mutual labels:  option-pricing, black-scholes
Algorithmic-Trading
I have been deeply interested in algorithmic trading and systematic trading algorithms. This Repository contains the code of what I have learnt on the way. It starts form some basic simple statistics and will lead up to complex machine learning algorithms.
Stars: ✭ 47 (+6.82%)
Mutual labels:  option-pricing, black-scholes
PyFENG
Python Financial ENGineering (PyFENG package in PyPI.org)
Stars: ✭ 51 (+15.91%)
Mutual labels:  option-pricing, black-scholes
FinancialToolbox.jl
Useful functions for Black–Scholes Model in the Julia Language
Stars: ✭ 31 (-29.55%)
Mutual labels:  black-scholes, european-options
jupyter-notebooks
Market Data & Derivatives Pricing Tutorial based on Jupyter notebooks
Stars: ✭ 24 (-45.45%)
Mutual labels:  option-pricing
ProjectReward
A software to shortlist and find the best options spread available for a given stock and help it visualise using payoff graphs.
Stars: ✭ 57 (+29.55%)
Mutual labels:  black-scholes
rough bergomi
A Python implementation of the rough Bergomi model.
Stars: ✭ 63 (+43.18%)
Mutual labels:  option-pricing
pyOptionPricing
Option pricing based on Black-Scholes processes, Monte-Carlo simulations with Geometric Brownian Motion, historical volatility, implied volatility, Greeks hedging
Stars: ✭ 190 (+331.82%)
Mutual labels:  option-pricing
optionmatrix
Financial Derivatives Calculator with 168+ Models (Options Calculator)
Stars: ✭ 121 (+175%)
Mutual labels:  black-scholes
market-monitor
Interactive app to monitor market using Python
Stars: ✭ 20 (-54.55%)
Mutual labels:  option-pricing
heston
Implementations of the Heston stochastic volatility model
Stars: ✭ 21 (-52.27%)
Mutual labels:  option-pricing
black-scholes
Black Scholes formula and greeks
Stars: ✭ 34 (-22.73%)
Mutual labels:  option-pricing

Option Pricing

The repository is a re-factorization (and some extensions) of the code for an FNCE40009 Advanced Derivative Securities assignment.

This repository is mainly designed for those who want to study option pricing. It is built purely on standard NumPy and SciPy packages.

I've tried my best to utilize the speed offered by NumPy array operations rather than using multiple for-loops, without sacrificing the ability to refer the code back to the equations in the textbook.

Debug/Improvements/AddOns will be implemented from time to time.

If you have any questions or want to report a bug, please open an issue. I am open to any corrections/suggestions. If you like it, or if it benefits you in some way, kindly give it a star 😊.


Reference: most of this repository implements algorithms described in the following textbook.

@book{mcdonald2013derivatives,
  title={Derivatives markets (3rd edition)},
  author={McDonald, Robert Lynch},
  year={2013},
  publisher={Pearson Education}
}

Binomial Excel Illustration



Black-Scholes-Merton (BSM)

How to use: example_BSM.py

  • Chapter 12.1: European call call_value(), European put put_value()
  • Chapter 12.2: (class) GarmanKohlhagenForex
  • Chapter 12.5: implied volatility assume BSM model implied_vol()
  • Chapter 21.5: Merton jump diffusion merton_jump_diffusion()
  • Chapter 22: Exotic options (barrier options) cash_or_nothing_barrier_options()
  • Appendix 12.B: delta(), gamma(), theta(), vega(), rho(), psi()

Monte Carlo Simulation

How to use: example_monte_carlo.py

  • Chapter 18 & 19.3: stock_price_simulation()
  • Chapter 19.8: stock_price_simulation_with_poisson_jump()

The final predicted price is the average of all simulated prices at time T (column T).

Stock price S h 2h 3h ... T-h T
simulation 1 S1,T
simulation 2 S2,T
simulation 3 S3,T
... ...
  • vasicek() and cox_ingersoll_ross_model(): stochastic interest rate (work-in-progress).
  • heston(): stochastic volatility.

Note: the default case is two tables with constant values. Call these two functions before running stock_price_simulation().

Interest rate r h 2h 3h ... T-h T
simulation 1 r1,T
simulation 2 r2,T
simulation 3 r3,T
... ...
Volatility σ h 2h 3h ... T-h T
simulation 1 σ1,T
simulation 2 σ2,T
simulation 3 σ3,T
... ...
  • Chapter 19.4: european_call() & european_put()
  • Chapter 14.2 & 19.4: asian_avg_price()
  • Chapter 19.6: american_option_longstaff_schwartz(), Longstaff & Schwartz (2001).
  • Chapter 14 & 23: exotic options, e.g. barrier_option()
  • Chapter 23, exercise 23.12: look_back_european()

More References:

  • Merton, R. C. (1976). Option pricing when underlying stock returns are discontinuous. Journal of financial economics, 3(1-2), 125-144.
  • Garman, M. B. and Kohlhagen, S. W. (1983). "Foreign Currency Option Values." Journal of International Money and Finance 2, 231-237.
  • Longstaff, F. A., & Schwartz, E. S. (2001). Valuing American options by simulation: a simple least-squares approach. The review of financial studies, 14(1), 113-147.

For Fun:

Alt

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].