A Python library for pricing and calibrating financial options.
Welcome to optpricing, a comprehensive Python toolkit for pricing and calibrating financial derivatives. This library was originally designed for me to learn about the more nuanced methods of quantitative finance and has since grown into a robust framework for analysis.
optpricing is structured around four core pillars:
- Atoms: Fundamental data types (
Option
,Stock
,Rate
) that ensure consistency and clarity of inputs across the library. - Models: A broad library ranging from classical Black-Scholes-Merton to advanced stochastic volatility (Heston, SABR) and jump/Lévy processes.
- Techniques: Multiple pricing engines—closed-form formulas, FFT, numerical integration, PDE solvers, lattice methods, and Monte Carlo (
numba
-accelerated with variance reduction methods baked in). - Workflows: High-level orchestrators that automate end-to-end tasks like daily calibration and out-of-sample backtesting, all accessible via a CLI or an interactive dashboard.
Get started in minutes using the command-line interface.
# 1. Install the library with all features, including the dashboard
pip install "optpricing"
# 2. Download historical data for a ticker (used by some models)
optpricing data download --ticker SPY
# 3. Launch the interactive dashboard to visualize the results
optpricing dashboard
For a detailed tutorial, full API reference, and more examples, please see the official documentation.
-
Getting Started:
Installation Guide ·
Walkthrough -
Documentation:
API Reference -
Interactive Dashboard:
Launch the UI -
About Me:
LinkedIn
See CONTRIBUTING and LICENSE.