FXPut#
- class rateslib.instruments.FXPut(*args, **kwargs)#
Bases:
FXOption
Create an FX Put option.
For parameters see
FXOption
.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])Calculate the rate of the FXOption
Attributes Documentation
- 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 (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.
- Return type:
- 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='pips_or_%')#
Calculate the rate of the FXOption
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 (FXForwards) – The object to project the relevant forward and spot FX rates.
base (str, optional) – Not used by analytic_greeks.
vol (float, or FXDeltaVolSmile) – The volatility used in calculation.
metric (str in {"pips_or_%", "vol", "premium"}, optional) – The pricing metric type to return. See notes.
- Return type:
Notes
The available choices for the pricing
metric
that can be used are:“pips_or_%”: if the
premium_ccy
is the foreign (RHS) currency then pips will be returned, else if the premium is the domestic (LHS) currency then % of notional will be returned.“vol”: the volatility used to price the option at that strike / delta is returned.
“premium”: the monetary amount in
premium_ccy
payable at the payment date is returned.