FXStraddle#
- class rateslib.instruments.FXStraddle(*args, premium=[NoInput.blank, NoInput.blank], metric='vol', **kwargs)#
Bases:
FXOptionStrat
,FXOption
Create an FX Straddle option strategy.
For additional arguments see
FXOption
.- Parameters:
Notes
When supplying
strike
as a string delta the strike will be determined at price time from the provided volatility and FX forward market.Buying a Straddle equates to buying an
FXCall
and anFXPut
at the same strike.This class is essentially an alias constructor for an
FXOptionStrat
where the number of options and their definitions and nominals have been specifically set.Attributes Summary
Methods Summary
analytic_greeks
([curves, solver, fx, base, ...])Return various pricing metrics of the FX Option.
cashflows_table
([curves, solver, fx, base])delta
([curves, solver, fx, base, local])Calculate delta risk of an Instrument against the calibrating instruments in a
Solver
.gamma
([curves, solver, fx, base, local])Calculate cross-gamma risk of an Instrument against the calibrating instruments of a
Solver
.npv
([curves, solver, fx, base, local, vol])plot_payoff
([range, curves, solver, fx, ...])rate
([curves, solver, fx, base, vol, metric])Return the mid-market rate of an option strategy.
Attributes Documentation
- rate_weight = [1.0, 1.0]#
- rate_weight_vol = [0.5, 0.5]#
- style = 'european'#
Methods Documentation
- analytic_greeks(curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, local=False, vol=NoInput.blank)#
Return various pricing metrics of the FX Option.
- Parameters:
curves (list of Curve) – Curves for discounting cashflows. List follows the structure used by IRDs and should be given as: [None, Curve for domestic ccy, None, Curve for foreign ccy]
solver (Solver, optional) – The numerical
Solver
that constructsCurves
from calibrating instruments.fx (float, FXRates, FXForwards, optional) – The immediate settlement FX rate that will be used to convert values into another currency. A given float is used directly. If giving a
FXRates
orFXForwards
object, converts from local currency intobase
.base (str, optional) – The base currency to convert cashflows into (3-digit code), set by default. Only used if
fx
is anFXRates
orFXForwards
object.
- Return type:
Notes
- cashflows_table(curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#
- delta(curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, local=False, **kwargs)#
Calculate delta risk of an Instrument against the calibrating instruments in a
Solver
.- Parameters:
curves (Curve, str or list of such, optional) –
A single
Curve
or id or a list of such. A list defines the following curves in the order:solver (Solver, optional) – The
Solver
that calibrates Curves from given Instruments.fx (float, FXRates, FXForwards, optional) – The immediate settlement FX rate that will be used to convert values into another currency. A given float is used directly. If giving a
FXRates
orFXForwards
object, converts from local currency intobase
.base (str, optional) – The base currency to convert cashflows into (3-digit code), set by default. Only used if
fx_rate
is anFXRates
orFXForwards
object.local (bool, optional) – If True will ignore
base
- this is equivalent to settingbase
to None. Included only for argument signature consistent with npv.
- Return type:
DataFrame
- gamma(curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, local=False, **kwargs)#
Calculate cross-gamma risk of an Instrument against the calibrating instruments of a
Solver
.- Parameters:
curves (Curve, str or list of such, optional) –
A single
Curve
or id or a list of such. A list defines the following curves in the order:solver (Solver, optional) – The
Solver
that calibrates Curves from given Instruments.fx (float, FXRates, FXForwards, optional) – The immediate settlement FX rate that will be used to convert values into another currency. A given float is used directly. If giving a
FXRates
orFXForwards
object, converts from local currency intobase
.base (str, optional) – The base currency to convert cashflows into (3-digit code), set by default. Only used if
fx_rate
is anFXRates
orFXForwards
object.local (bool, optional) – If True will ignore
base
. This is equivalent to settingbase
to None. Included only for argument signature consistent with npv.
- Return type:
DataFrame
- npv(curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, local=False, vol=NoInput.blank)#
- plot_payoff(range=NoInput.blank, curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, local=False, vol=NoInput.blank)#
- rate(curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, vol=NoInput.blank, metric=NoInput.blank)#
Return the mid-market rate of an option strategy.
Notes
The different types of
metric
return different quotation conventions.‘vol’: sums the mid-market volatilities of each option multiplied by their respective
rate_weight_vol
parameter. For example this is the default pricing convention for aFXRiskReversal
where the price is the vol of the call minus the vol of the put and therate_weight_vol
parameters are [-1.0, 1.0].‘pips_or_%’: sums the mid-market pips or percent price of each option multiplied by their respective
rate_weight
parameter. For example for aFXStraddle
the total premium is the sum of two premiums and therate_weight
parameters are [1.0, 1.0].