Skip to content

About

European and American option pricing in Python using Black-Scholes and Longstaff-Schwartz Monte Carlo.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Options Valuation

American Option Pricer

An educational Python implementation of option-pricing models, covering closed-form European option valuation and simulation-based American option valuation.

What this project covers

European options — Black–Scholes

  • Closed-form call and put pricing
  • Delta, Gamma, and Vega
  • Implied volatility solved with Newton–Raphson iteration
  • Expiry and numerical edge-case handling

American options — Longstaff–Schwartz Monte Carlo

  • 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
Loading

Benchmark

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.

Repository contents

Run locally

python -m venv .venv

Activate the environment, then install the dependencies and launch Jupyter:

python -m pip install -r requirements.txt
jupyter lab "Options Valuation.ipynb"

Model assumptions and limitations

  • 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

About

European and American option pricing in Python using Black-Scholes and Longstaff-Schwartz Monte Carlo.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages