FinancePy

FinancePy API Reference

Fx Vol Surface

financepy.market.volatility.fx_vol_surface

Classes

FXVolSurface

FXVolSurface(anchor_dt: financepy.utils.date.Date, spot_fx_rate: float, currency_pair: str, notional_currency: str, domestic_curve: financepy.market.curves.discount_curve.DiscountCurve, foreign_curve: financepy.market.curves.discount_curve.DiscountCurve, tenors: List[financepy.utils.tenor.Tenor], atm_vols: List | numpy.ndarray, ms_25_delta_vols: List | numpy.ndarray, rr_25_delta_vols: List | numpy.ndarray, atm_method: financepy.utils.global_types.FXATMMethodTypes = <FXATMMethodTypes.FWD_DELTA_NEUTRAL: 3>, delta_method: financepy.utils.global_types.FXDeltaMethodTypes = <FXDeltaMethodTypes.SPOT_DELTA: 1>, vol_func_type: financepy.utils.global_types.VolFuncTypes = <VolFuncTypes.CLARK: 0>) -> None
Class to perform a calibration of a chosen parametrised surface to the prices of FX options at different strikes and expiry tenors. The calibration inputs are the ATM and 25 Delta volatilities given in terms of the market strangle amd risk reversals. There is a choice of volatility function ranging from polynomial in delta to a limited version of SABR.

Methods

volatility

volatility(self, k: float, expiry_dt: financepy.utils.date.Date) -> float
Interpolate the Black-Scholes volatility from the volatility surface given the option strike and expiry date. Linear interpolation is done in variance x time.

build_vol_surface

build_vol_surface(self) -> None

No description available.

solver_for_smile_strike

solver_for_smile_strike(self, opt_type_value: int, delta_target: float, tenor_index: int, initial_value: float) -> float
Solve for the strike that sets the delta of the option equal to the target value of delta allowing the volatility to be a function of the strike.

check_calibration

check_calibration(self, verbose: bool, tol: float = 1e-05) -> None

No description available.

implied_dbns

implied_dbns(self, low_fx: float, high_fx: float, num_intervals: int) -> List[financepy.utils.distribution.FinDistribution]
Calculate the pdf for each tenor horizon. Returns a list of FinDistribution objects, one for each tenor horizon.

plot_vol_curves

plot_vol_curves(self) -> None

No description available.

Functions

solve_to_horizon_fast

solve_to_horizon_fast(s: float, t: float, rd: float, rf: float, k_atm: float, atm_vol: float, ms_25d_vol: float, rr_25d_vol: float, delta_method_value: int, vol_type_value: int, xopt: Sequence[float]) -> Tuple[numpy.ndarray, float, float, float, float]

No description available.

Generated automatically from the FinancePy source code. Do not edit this file manually.