Fx Vanilla Option
financepy.products.fx.fx_vanilla_option
Classes
FXVanillaOption
FXVanillaOption(expiry_dt: financepy.utils.date.Date, strike_fx_rate: float | numpy.ndarray, currency_pair: str, opt_type: financepy.utils.global_types.OptionTypes | list, notional: float, prem_currency: str, spot_days: int = 0)
This is a class for an FX Option trade. It permits the user to
calculate the price of an FX Option trade which can be expressed in a
number of ways depending on the investor or hedger's currency. It aslo
allows the calculation of the option's delta in a number of forms as
well as the various Greek risk sensitivies.
Methods
value
value(self, value_dt, spot_fx_rate, domestic_curve, foreign_curve, model)
This function calculates the value of the option using a specified
model with the resulting value being in domestic i.e. ccy2 terms.
Recall that Domestic = CCY2 and Foreign = CCY1 and FX rate is in
price in domestic of one unit of foreign currency.
delta_bump
delta_bump(self, value_dt, spot_fx_rate, ccy1_discount_curve, ccy2_discount_curve, model)
Calculation of the FX option delta by bumping the spot FX rate by
1 cent of its value. This gives the FX spot delta. For speed we prefer
to use the analytical calculation of the derivative given below.
delta
delta(self, value_dt, spot_fx_rate, domestic_curve, foreign_curve, model)
Calculation of the FX Option delta. There are several definitions
of delta and so we are required to return a dictionary of values. The
definitions can be found on Page 44 of Foreign Exchange Option Pricing
by Iain Clark, published by Wiley Finance.
fast_delta
fast_delta(self, t, s, rd, rf, vol)
Calculation of the FX Option delta. Used in the determination of
the volatility surface. Avoids discount curve interpolation so it
should be slightly faster than the full calculation of delta.
gamma
gamma(self, value_dt, spot_fx_rate, domestic_curve, foreign_curve, model)
This function calculates the FX Option Gamma using spot delta.
vega
vega(self, value_dt, spot_fx_rate, domestic_curve, foreign_curve, model)
This function calculates the FX Option Vega using the spot delta.
theta
theta(self, value_dt, spot_fx_rate, domestic_curve, foreign_curve, model)
This function calculates the time decay of the FX option.
implied_volatility
implied_volatility(self, value_dt, stock_price, discount_curve, dividend_curve, price)
This function determines the implied volatility of an FX option
given a price and the other option details. It uses a one-dimensional
Newton root search algorith to determine the implied volatility.
value_mc
value_mc(self, value_dt, spot_fx_rate, domestic_curve, foreign_curve, model, num_paths=10000, seed=4242)
Calculate the value of an FX Option using Monte Carlo methods.
This function can be used to validate the risk measures calculated
above or used as the starting code for a model exotic FX product that
cannot be priced analytically. This function uses Numpy vectorisation
for speed of execution.
Functions
f
f(volatility, *args)
This is the objective function used in the determination of the FX
Option implied volatility which is computed in the class below.
fvega
fvega(volatility, *args)
This is the derivative of the objective function with respect to the
option volatility. It is used to speed up the determination of the FX
Option implied volatility which is computed in the class below.
Generated automatically from the FinancePy source code.
Do not edit this file manually.