Version 1.0
Author: Olivier Trudeau
A Python-based web app built with Streamlit to help visualize option pricing, PnL, Greeks, and heatmaps for better understanding of option behavior based on the Black-Scholes model.
- Dynamic Option Pricing: Calculate call/put prices based on Black-Scholes model inputs.
- PnL Calculation: Track the performance of an option based on the purchase price.
- Greeks Calculation: Real-time calculation of Delta, Gamma, Vega, Theta, and Rho.
- Heatmap Visualization: Visualize how option prices change with volatility and stock price.
- Historical Data: Fetch historical stock prices to see how option prices evolved over time.
- Python 3.8+
- Streamlit
- Pandas
- Matplotlib
- Seaborn
- Altair
- Clone the repository:
git clone https://github.com/otrudeau/BlackScholesTool.git
- Navigate to the project directory:
cd BlackScholesTool
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On macOS/Linux venv\Scripts\activate # On Windows
- Install the required dependencies:
pip install -r requirements.txt
- Ensure you are in the virtual environment:
source venv/bin/activate # On macOS/Linux venv\Scripts\activate # On Windows
- Run the Streamlit app:
streamlit run app.py
Single Point in Time: Adjust the Stock Price, Strike Price, Volatility, Risk-Free Rate, and Time to Expiry sliders to recalculate the option price, PnL, and Greeks dynamically. View the Heatmap to see how the price varies with different stock prices and volatilities.
Visualizing Over Time: Enter a stock ticker and adjust parameters to fetch historical stock data. Hover over the chart to see real-time Greeks updates and track how the option price evolves.
- Multi-leg Option Strategies: Implement predefined strategies like Iron Condor, Straddle, etc.
- Advanced Backtesting: Run backtests for various option strategies using historical data.
- Interactive Tutorials: Add step-by-step explanations for new traders to understand option pricing.
This project is licensed under the MIT License. See the LICENSE file for details.
Olivier Trudeau - LinkedIn | GitHub
Contributions are welcome! Feel free to open a pull request or issue if you have any suggestions or improvements.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request