Try it live: Option Pricing Series Interactive App
Author: Mark Bogorad
The Option Pricing Series is a dynamic Streamlit application designed to visualize option payoffs and explore trading strategies. It integrates Black-Scholes pricing models, visual heatmaps, and optimal hedging calculations with a real-time input storage mechanism powered by KDB+.
The app provides traders and financial engineers with tools to analyze how varying spot prices and volatilities affect option payoffs, helping users make informed decisions.
- Heatmaps: Visualize how option profits vary with spot prices and volatilities.
- Trade Strategies: Explore predefined strategies like covered calls, protective puts, and strangles.
- Greeks Calculation: Compute Delta, Gamma, Vega, Rho, and Theta for hedging decisions.
- KDB+ Integration: Store and retrieve user inputs for enhanced data tracking.
- Interactive UI: Real-time adjustments to parameters via Streamlit sliders and inputs.
Option pricing and risk management are critical in financial engineering. Traditional static calculations are enhanced here with:
- Real-time interactivity for exploring multiple scenarios.
- Integration with KDB+ for efficient data storage and retrieval.
- A focus on visual and intuitive analysis, ideal for both novice and professional users.
- Black-Scholes Model: Computes call and put prices, profits, and option Greeks.
- Heatmap Visualization: Plots profit for various spot prices and volatilities.
- Optimal Hedges: Calculates hedge ratios for risk management.
- Streamlit: Builds the user interface.
- KDB+: Stores user inputs.
- Pandas, NumPy, SciPy: Enables data manipulation and statistical calculations.
- Matplotlib, Seaborn: For visualizations.
-
Clone the repository:
git clone https://github.com/markbogorad/option-pricing-series.git cd option-pricing-series -
Install dependencies:
pip install -r requirements.txt
-
Run the Streamlit application:
streamlit run main.py
-
(Optional) Start the KDB+ server for input storage:
q -p 5001
- Set Parameters: Input current asset price, strike price, volatility, etc., in the sidebar.
- Visualize Payoffs: Navigate between tabs to explore heatmaps, strategies, and hedges.
- Analyze Results: View and download stored inputs or utilize KDB+ for advanced data tracking.
Heatmaps display profits for call and put options based on:
- Spot Price (X-axis)
- Volatility (Y-axis)
Greeks such as Delta and Vega are calculated to provide actionable hedging insights:
- Example Delta Hedge:
"To delta hedge, trade 0.34 units of the underlying asset."
This project is licensed under the MIT License. See the LICENSE file for details.