NonDeliverableFixedPeriod#

class rateslib.periods.NonDeliverableFixedPeriod(*args, settlement_currency, fx_fixing=NoInput.blank, fx_fixing_date=NoInput.blank, reversed=False, **kwargs)#

Bases: FixedPeriod

Create a FixedPeriod whose non-deliverable cashflow is converted to a settlement_currency.

Parameters:
  • args – Positional arguments to FixedPeriod.

  • settlement_currency – The currency used for settlement of the non-deliverable cashflow.

  • fx_fixing (float, Dual, Dual2, optional) – The FX fixing to determine the settlement amount. The currency should be the left hand side, and settlement_currency as RHS, e.g. BRLUSD, unless reversed, in which case it should be, e.g. USDBRL.

  • fx_fixing_date (datetime) – Date on which the FX fixing for settlement is determined.

  • reversed (bool, optional) – If True reverses the FX rate for settlement fixing, as shown above.

Notes

The cashflow is defined as follows;

\[C = -NdRf\]

where f is the FX rate at settlement to convert currency into settlement_currency.

The npv() is defined as;

\[P = Cv = -NdRfv(m)\]

The analytic_delta() is defined as;

\[A = - \frac{\partial P}{\partial R} = Ndfv(m)\]

Examples

In [1]: fp = NonDeliverableFixedPeriod(
   ...:     start=dt(2022, 2, 1),
   ...:     end=dt(2022, 8, 1),
   ...:     payment=dt(2022, 8, 2),
   ...:     frequency="S",
   ...:     notional=1e6,
   ...:     currency="brl",
   ...:     convention="30e360",
   ...:     fixed_rate=5.0,
   ...:     settlement_currency="usd",
   ...:     fx_fixing=5.0,
   ...:     fx_fixing_date=dt(2022, 7, 30),
   ...:     reversed=True,
   ...: )
   ...: 

In [2]: fp.cashflows(curve=Curve({dt(2022, 1, 1):1.0, dt(2022, 12, 31): 0.98}))
Out[2]: 
{'Type': 'NonDeliverableFixedPeriod',
 'Period': 'Regular',
 'Ccy': 'usd',
 'Acc Start': datetime.datetime(2022, 2, 1, 0, 0),
 'Acc End': datetime.datetime(2022, 8, 1, 0, 0),
 'Payment': datetime.datetime(2022, 8, 2, 0, 0),
 'Convention': '30e360',
 'DCF': 0.5,
 'Notional': 1000000.0,
 'DF': 0.9882476903715324,
 'Collateral': None,
 'Pair': 'usdbrl',
 'Rate': 5.0,
 'Spread': None,
 'Cashflow': -5000.0,
 'Index Val': 5.0,
 'NPV': -4941.238451857662,
 'FX Rate': 1.0,
 'NPV Ccy': -4941.238451857662}

Methods Summary

analytic_delta([curve, disc_curve, fx, base])

Return the analytic delta of the NonDeliverableFixedPeriod.

cashflow(fx)

Determine the cashflow amount, expressed in the settlement_currency.

cashflows([curve, disc_curve, fx, base])

Return the cashflows of the FixedPeriod.

npv([curve, disc_curve, fx, base, local])

Return the NPV of the NonDeliverableFixedPeriod.

Methods Documentation

analytic_delta(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#

Return the analytic delta of the NonDeliverableFixedPeriod. See BasePeriod.analytic_delta()

Value is expressed in units of settlement_currency unless base is directly specified.

cashflow(fx)#

Determine the cashflow amount, expressed in the settlement_currency.

Parameters:

fx (FXForwards, optional) – Required to forecast the FX rate at settlement, if an fx_fixing is not known.

Return type:

float, Dual, Dual2

cashflows(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#

Return the cashflows of the FixedPeriod. See BasePeriod.cashflows()

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

Return the NPV of the NonDeliverableFixedPeriod. See BasePeriod.npv()

Value is expressed in units of settlement_currency unless base is directly specified.