Skip to main content

Module option

Module option 

Source
Expand description

European vanilla option pricing, analytical Greeks, and implied volatility solver. European vanilla option pricing, analytical Greeks, and implied volatility solver.

Implements Black-Scholes-Merton (BSM) for spot/equity with continuous dividend yield, Black-76 for futures/forwards, analytical Greeks, put-call parity verification, and robust root-finding for implied volatility.

Structs§

BlackScholesInputs
Core inputs required for Black-Scholes-Merton pricing.
OptionGreeks
First- and second-order price sensitivities (Greeks).
OptionPricingResult
Complete evaluated outcome of an option pricing computation.

Enums§

OptionError
Errors originating from option pricing or volatility inversion.
OptionStyle
Exercise style of the option.
OptionType
Type of option contract.

Functions§

black_76
Evaluates a European option on a forward or futures contract using Black’s 1976 model.
black_scholes_merton
Evaluates a European vanilla option using the Black-Scholes-Merton formula with dividend yield.
implied_volatility
Inverts the Black-Scholes-Merton formula to find the implied volatility from a market price.
normal_cdf
Standard normal cumulative distribution function $\Phi(x)$, evaluated with Hart’s rational approximation.
normal_pdf
Standard normal probability density function $\phi(x) = \frac{1}{\sqrt{2\pi}} e^{-x^2 / 2}$.
verify_put_call_parity
Verifies European put-call parity and returns the pricing discrepancy.