This options pricing framework is made for experimentation and learning.
A comprehensive Python framework for pricing financial options using various models and simulation techniques.
- Black-Scholes
- Binomial
- Monte Carlo simulation
- Least Squares Monte Carlo for American options
- Analytical and simulated Asian options
- Geometric Brownian Motion
- Generic Drift-Diffusion Process
- Heston Stochastic Volatility
- Ornstein-Uhlenbeck Process
- European options
- American options
- Asian options
- GARCH
- Implied volatility calculation
- Historical data analysis
- Distribution fitting
git clone https://github.com/yourusername/option_pricing_framework.git
cd option_pricing_framework
pip install -r requirements.txt
Here's a basic example of pricing a European call option using the Black-Scholes model:
from models.european.black_scholes import BlackScholesModel
params = {
'initial_stock_price': 100,
'strike_price': 100,
'time_to_maturity': 1,
'risk_free_rate': 0.05,
'volatility': 0.2,
'option_type': 'call'
}
bs_model = BlackScholesModel()
price = bs_model.price(params)
print(f"Option price: {price}")models/: Contains various option pricing modelssimulations/: Implements different simulation techniquesdistributions/: Defines probability distributions used in simulationsutils/: Utility functions for data analysis and calculationsexperiments/: Jupyter notebooks demonstrating various pricing scenariostests/: Unit tests for the framework components
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
This framework was inspired by and built upon various financial engineering concepts and techniques. Special thanks to all the researchers and practitioners in the field of quantitative finance.