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.

Bachelier’s normal model

Bachelier's normal model

Stoll’s put-call parity

Stoll's put-call parity

The Black-Scholes formula

The Black-Scholes formula

Merton: dividends and no-arbitrage bounds

Merton: dividends and no-arbitrage bounds

Black-76: options on futures

Black-76: options on futures

Garman-Kohlhagen currency options

Garman-Kohlhagen currency options

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.

The Black-Scholes Greeks

The Black-Scholes Greeks

Delta hedging in discrete time

Delta hedging in discrete time

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.

Latané-Rendleman implied volatility

Latané-Rendleman implied volatility

Breeden-Litzenberger risk-neutral density

Breeden-Litzenberger risk-neutral density

The volatility smile

The volatility smile

The Brenner-Subrahmanyam approximation

The Brenner-Subrahmanyam approximation

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 binomial tree converges to Black-Scholes

Cox-Ross-Rubinstein: the American put and its exercise boundary

Cox-Ross-Rubinstein: the American put and its exercise boundary

The Rendleman-Bartter tree

The Rendleman-Bartter tree

Boyle’s trinomial tree

Boyle's trinomial tree

The Barone-Adesi-Whaley approximation

The Barone-Adesi-Whaley approximation

The Leisen-Reimer tree

The Leisen-Reimer tree

Gallery generated by Sphinx-Gallery