Victor Miller · GitHub · LinkedIn
An implementation of the Cox-Ross-Rubinstein binomial tree for European and American options.
All checks use
| Check | Tree | Reference |
|---|---|---|
| European call | 10.4502 | Black-Scholes: 10.4506 |
| Call minus put | 4.8771 |
|
| Call hedge ratio | 0.6368 |
|
| American put | 6.0902 | European put: 5.5731 |
The tree price converges to Black-Scholes as
The stock moves up by
is chosen so the stock earns the risk-free rate on average. The option is priced backwards from its payoff, discounting at
- European options:
european_option_binomial_modelprices a call or a put with the CRR tree and returns the price plus the hedge ratio$\Delta = (C_u - C_d) / (S_0 (u - d))$ . - American options:
american_option_binomial_modeladds the early-exercise check at each node: keep the option or exercise it, whichever is worth more. - Put-call parity: a call and a put at the same strike and maturity must satisfy
$C - P = S_0 - Ke^{-rT}$ ; the tree reproduces it exactly. - Black-Scholes reference:
black_scholes_option_pricergives the closed-form price and hedge ratio used as benchmark. - Convergence: the figure above plots the tree error against the
$1/n$ reference slope.
pip install -r requirements.txt
Open binomial_model.ipynb and run all cells.
binomial_model/
├── binomial_model.ipynb # model, validation, figures
├── README.md
├── requirements.txt
├── LICENSE.txt
├── .gitignore
└── figures/
└── convergence.png
