FinancePy

FinancePy API Reference

Fx Vol Surface Plus

financepy.market.volatility.fx_vol_surface_plus

Classes

FXVolSurfacePlus

FXVolSurfacePlus(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: numpy.ndarray | List, ms_25_delta_vols: numpy.ndarray | List, rr_25_delta_vols: numpy.ndarray | List, ms_10_delta_vols: numpy.ndarray | List, rr_10_delta_vols: numpy.ndarray | List, alpha: float, 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>, fin_solver_type: financepy.utils.global_types.SolverTypes = <SolverTypes.NELDER_MEAD: 1>, tol: float = 1e-08) -> 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 and 10 Delta volatilities in terms of the market strangle amd risk reversals. There is a choice of volatility function from cubic in delta to full SABR. Check out VolFuncTypes. Parameter alpha [0,1] is used to interpolate between fitting only 25d when alpha=0 to fitting only 10d when alpha=1.0. Alpha=0.5 assigns equal weights A vol function with more parameters will give a better fit. Of course. But it might also overfit. Visualising the volatility curve is useful. Also, there is no guarantee that the implied pdf will be positive.

Methods

vol_from_strike_dt

vol_from_strike_dt(self, kk: float, expiry_dt: financepy.utils.date.Date) -> float
Interpolates the Black-Scholes volatility from the volatility surface given call option strike and expiry date. Linear interpolation is done in variance space. The smile strikes at bracketed dates are determined by determining the strike that reproduces the provided delta value. This uses the calibration delta convention, but it can be overriden by a provided delta convention. The resulting volatilities are then determined for each bracketing expiry time and linear interpolation is done in variance space and then converted back to a lognormal volatility.

delta_to_strike

delta_to_strike(self, call_delta: float, expiry_dt: financepy.utils.date.Date, delta_method: Any | None) -> float
Interpolates the strike at a delta and expiry date. Linear time to expiry interpolation is used in strike.

vol_from_delta_date

vol_from_delta_date(self, call_delta: float, expiry_dt: financepy.utils.date.Date, delta_method: financepy.utils.global_types.FXDeltaMethodTypes | None = None) -> Tuple[float, float]
Interpolates the Black-Scholes volatility from the volatility surface given a call option delta and expiry date. Linear interpolation is done in variance space. The smile strikes at bracketed dates are determined by determining the strike that reproduces the provided delta value. This uses the calibration delta convention, but it can be overriden by a provided delta convention. The resulting volatilities are then determined for each bracketing expiry time and linear interpolation is done in variance space and then converted back to a lognormal volatility.

check_calibration

check_calibration(self, verbose: bool, tol: float = 1e-06) -> None
Compare calibrated vol surface with market and output a report which sets out the quality of fit to the ATM and 10 and 25 delta market strangles and risk reversals.

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
Generates a plot of each of the vol discount implied by the market and fitted.
Generated automatically from the FinancePy source code. Do not edit this file manually.