Options Calibration and Pricing#

VolSurface#

class quantflow.options.surface.VolSurface(ref_date: 'datetime', spot: 'SpotPrice[S]', maturities: 'tuple[VolCrossSection[S], ...]')#
as_array(*, select: OptionSelection = OptionSelection.best, index: int | None = None, initial_vol: float = 0.5, converged: bool = True) OptionArrays#

Organize option prices in a numpy arrays for black volatility calculation

bs(*, select: OptionSelection = OptionSelection.best, index: int | None = None, initial_vol: float = 0.5) list[OptionPrice]#

calculate Black-Scholes implied volatilities for all options in the surface

calc_bs_prices(*, select: OptionSelection = OptionSelection.best, index: int | None = None) ndarray#

calculate Black-Scholes prices for all options in the surface

option_list(*, select: OptionSelection = OptionSelection.best, index: int | None = None, converged: bool = True) list[OptionPrice]#

List of selected option prices in the surface

option_prices(*, select: OptionSelection = OptionSelection.best, index: int | None = None, initial_vol: float = 0.5, converged: bool = True) Iterator[OptionPrice]#

Iterator over selected option prices in the surface

options_df(*, select: OptionSelection = OptionSelection.best, index: int | None = None, initial_vol: float = 0.5, converged: bool = True) DataFrame#

Time frame of Black-Scholes call input data

plot(*, index: int | None = None, select: OptionSelection = OptionSelection.best, **kwargs: Any) Any#

Plot the volatility surface

plot3d(*, select: OptionSelection = OptionSelection.best, **kwargs: Any) Any#

Plot the volatility surface

term_structure(frequency: float = 0) DataFrame#

Return the term structure of the volatility surface