FXOptionPeriod#

class rateslib.periods.FXOptionPeriod(pair, expiry, delivery, payment, strike=NoInput.blank, notional=NoInput.blank, option_fixing=NoInput.blank, delta_type=NoInput.blank, metric=NoInput.blank)#

Bases: object

Abstract base class for constructing volatility components of FXOptions.

Pricing model uses Black 76 log-normal volatility calculations.

Parameters:
  • pair (str) – The currency pair for the FX rate which the option is settled. 3-digit code, e.g. “eurusd”.

  • expiry (datetime) – The expiry of the option: when the fixing and moneyness is determined.

  • delivery (datetime) – The delivery date of the underlying FX pair. E.g. typically this would be spot as measured from the expiry date.

  • payment (datetime) – The payment date of the premium associated with the option.

  • strike (float, Dual, Dual2) – The strike value of the option.

  • notional (float) – The amount in ccy1 (left side of pair) on which the option is based.

  • option_fixing (float, optional) – If an option has already expired this argument is used to fix the price determined at expiry.

  • delta_type (str in {"forward", "spot", "forward_pa", "spot_pa"}) – When deriving strike from a delta percentage the method used to associate the sensitivity to either a spot rate or a forward rate, possibly also premium adjusted.

  • metric (str in {"pips", "percent"}, optional) – The pricing metric for the rate of the options.

Attributes Summary

kind

phi

style

Methods Summary

analytic_greeks(disc_curve, disc_curve_ccy2)

Return the different greeks for the Option.

implied_vol(disc_curve, disc_curve_ccy2[, ...])

Calculate the implied volatility of the FX option.

npv(disc_curve, disc_curve_ccy2[, fx, base, ...])

Return the NPV of the FXOption.

rate(disc_curve, disc_curve_ccy2[, fx, ...])

Return the pricing metric of the FXOption.

Attributes Documentation

kind = None#
phi = 0.0#
style = 'european'#

Methods Documentation

analytic_greeks(disc_curve, disc_curve_ccy2, fx=NoInput.blank, base=NoInput.blank, local=False, vol=NoInput.blank, premium=NoInput.blank)#

Return the different greeks for the Option.

Parameters:
  • disc_curve (Curve) – The discount Curve for the LHS currency.

  • disc_curve_ccy2 (Curve) – The discount Curve for the RHS currency.

  • fx (FXForwards) – The object to project the relevant forward and spot FX rates.

  • base (str, optional) – Not used by analytic_greeks.

  • local (bool,) – Not used by analytic_greeks.

  • vol (float or FXDeltaVolSmile) – The volatility used in calculation.

  • premium (float, optional) – The premium value of the option paid at the appropriate payment date. If not given calculates and assumes a mid-market premium.

Return type:

dict

Notes

Delta \(\Delta\)

This is the percentage value of the domestic notional in either the forward or spot FX rate. The choice of which is defined by the option’s delta_type.

Delta is also expressed in nominal domestic currency amount.

Gamma \(\Gamma\)

This defines by how much delta will change for a 1.0 increase in either the forward or spot FX rate. Which rate is determined by the option’s delta_type.

Gamma is also expressed in nominal domestic currency amount for a +1% change in FX rates.

Vanna \(\Delta_{\nu}\)

This defines by how much delta will change for a 1.0 increase (i.e. 100 log-vols) in volatility. The additional

Vega \(\nu\)

This defines by how much the PnL of the option will change for a 1.0 increase in volatility for a nominal of 1 unit of domestic currency.

Vega is also expressed in foreign currency for a 0.01 (i.e. 1 log-vol) move higher in vol.

Vomma (Volga) \(\nu_{\nu}\)

This defines by how much vega will change for a 1.0 increase in volatility.

These values can be used to estimate PnL for a change in the forward or spot FX rate and the volatility according to,

\[\delta P \approx v_{deli} N^{dom} \left ( \Delta \delta f + \frac{1}{2} \Gamma \delta f^2 + \Delta_{\nu} \delta f \delta \sigma \right ) + N^{dom} \left ( \nu \delta \sigma + \frac{1}{2} \nu_{\nu} \delta \sigma^2 \right )\]

where \(v_{deli}\) is the date of FX settlement for forward or spot rate.

Kappa \(\kappa\)

This defines by how much the PnL of the option will change for a 1.0 increase in strike for a nominal of 1 unit of domestic currency.

Kega \(\left . \frac{dK}{d\sigma} \right|_{\Delta}\)

This defines the rate of change of strike with respect to volatility for a constant delta.

Raises:

ValueError – if the strike is not set on the Option.:

implied_vol(disc_curve, disc_curve_ccy2, fx=NoInput.blank, base=NoInput.blank, local=False, premium=NoInput.blank, metric=NoInput.blank)#

Calculate the implied volatility of the FX option.

Parameters:
  • disc_curve (Curve) – The discount Curve for the LHS currency. (Not used).

  • disc_curve_ccy2 (Curve) – The discount Curve for the RHS currency.

  • fx (float, FXRates, FXForwards, optional) – The object to project the currency pair FX rate at delivery.

  • base (str, optional) – The base currency in which to express the NPV.

  • local (bool,) – Whether to display NPV in a currency local to the object.

  • premium (float) – The premium value of the option paid at the appropriate payment date. Expressed either in ‘pips’ or ‘percent’ of notional. Must align with metric.

  • metric (str in {"pips", "percent"}, optional) – The manner in which the premium is expressed.

Return type:

float

npv(disc_curve, disc_curve_ccy2, fx=NoInput.blank, base=NoInput.blank, local=False, vol=NoInput.blank)#

Return the NPV of the FXOption.

Parameters:
  • disc_curve (Curve) – The discount Curve for the LHS currency. (Not used).

  • disc_curve_ccy2 (Curve) – The discount Curve for the RHS currency.

  • fx (float, FXRates, FXForwards, optional) – The object to project the currency pair FX rate at delivery.

  • base (str, optional) – The base currency in which to express the NPV.

  • local (bool,) – Whether to display NPV in a currency local to the object.

  • vol (float, Dual, Dual2) – The percentage log-normal volatility to price the option.

Return type:

float, Dual, Dual2 or dict of such.

rate(disc_curve, disc_curve_ccy2, fx=NoInput.blank, base=NoInput.blank, local=False, vol=NoInput.blank, metric=NoInput.blank)#

Return the pricing metric of the FXOption.

Parameters:
  • disc_curve (Curve) – The discount Curve for the LHS currency. (Not used).

  • disc_curve_ccy2 (Curve) – The discount Curve for the RHS currency.

  • fx (float, FXRates, FXForwards, optional) – The object to project the currency pair FX rate at delivery.

  • base (str, optional) – The base currency in which to express the NPV.

  • local (bool,) – Whether to display NPV in a currency local to the object.

  • vol (float, Dual, Dual2) – The percentage log-normal volatility to price the option.

  • metric (str in {"pips", "percent"}) – The metric to return. If “pips” assumes the premium is in foreign (rhs) currency. If “percent”, the premium is assumed to be domestic (lhs).

Return type:

float, Dual, Dual2 or dict of such.