Examples#
This gallery walks through every public feature of financialkit.options:
the closed-form pricers from Bachelier to Garman-Kohlhagen, put-call
parity and the no-arbitrage bounds, the Greeks and delta hedging,
implied volatility, the smile and the risk-neutral density, and the
binomial and trinomial trees with American early exercise.
See also the narrative tutorials:
Each script in this gallery is self-contained and can be run directly with
python examples/options/<section>/<script>.py.
Sections#
closed_form – Bachelier, Stoll’s put-call parity, Black-Scholes, Merton’s dividends and bounds, Black-76 and Garman-Kohlhagen.
greeks – the Black-Scholes Greeks and discrete delta hedging.
implied_vol – implied volatility, the Breeden-Litzenberger density, the volatility smile and the Brenner-Subrahmanyam approximation.
trees – the Cox-Ross-Rubinstein, Rendleman-Bartter, Boyle trinomial and Leisen-Reimer lattices, and the Barone-Adesi-Whaley American approximation.
Closed-form pricers#
European option prices in closed form, from Bachelier’s normal model to Black-Scholes-Merton and its forward, futures and currency variants, and the model-free relations every price must obey.
Greeks and hedging#
The sensitivities that the Black-Scholes argument hedges away, and what happens when the hedge is rebalanced only a finite number of times.
Implied volatility#
Reading volatilities and distributions back out of option prices: the implied volatility, its at-the-money shortcut, the smile, and the risk-neutral density.
Lattices and American options#
Binomial and trinomial trees, their convergence to Black-Scholes, early exercise of American options, and an analytic approximation to it.
Cox-Ross-Rubinstein: the binomial tree converges to Black-Scholes
Cox-Ross-Rubinstein: the American put and its exercise boundary