An educational Python implementation of option-pricing models, covering closed-form European option valuation and simulation-based American option valuation.
- Closed-form call and put pricing
- Delta, Gamma, and Vega
- Implied volatility solved with Newton–Raphson iteration
- Expiry and numerical edge-case handling
- Geometric Brownian Motion path simulation
- Backward induction through possible exercise dates
- In-the-money path selection
- Least-squares estimation of continuation value with a quadratic basis
- Pathwise comparison of immediate exercise versus continuation
flowchart LR
A[Simulate stock paths] --> B[Set terminal payoffs]
B --> C[Move backward one step]
C --> D[Select in-the-money paths]
D --> E[Regress future cash flows on current prices]
E --> F{Exercise value greater?}
F -- Yes --> G[Exercise now]
F -- No --> H[Keep future cash flow]
G --> I[Continue backward]
H --> I
The American put example uses:
| Parameter | Value |
|---|---|
| Initial stock price | 36 |
| Strike price | 40 |
| Time to maturity | 1 year |
| Risk-free rate | 6% |
| Volatility | 20% |
| Simulations | 10,000 |
| Exercise steps | 20 |
The Longstaff–Schwartz estimate is approximately $4.47. Because the method uses Monte Carlo simulation, the output varies slightly between runs.
Options Valuation.ipynb— executable pricing models and verification examplesAmerican Option Pricer.pptx— presentation explaining the American option pricerOptions Intro_Kevin.pptx— introductory options materialFutures_Pricing.pptx— supporting futures-pricing materialOption Project 3_Kevin.pptx— project presentation
python -m venv .venvActivate the environment, then install the dependencies and launch Jupyter:
python -m pip install -r requirements.txt
jupyter lab "Options Valuation.ipynb"- Constant risk-free rate and volatility
- Geometric Brownian Motion for the underlying price
- No dividends or transaction costs
- Quadratic regression basis for the continuation value
- Intended for learning and portfolio demonstration, not production trading or investment advice
