ZeroIndexLeg#
- class rateslib.legs.ZeroIndexLeg(*args, index_base=NoInput.blank, index_fixings=NoInput.blank, index_method=NoInput.blank, index_lag=NoInput.blank, **kwargs)#
Bases:
BaseLeg
,IndexLegMixin
Create a zero coupon index leg composed of a single
IndexFixedPeriod
and aCashflow
.- Parameters:
args (dict) – Required positional args to
BaseLeg
.index_base (float or None, optional) – The base index applied to all periods.
index_fixings (float, or Series, optional) – If a float scalar, will be applied as the index fixing for the first period. If a list of n fixings will be used as the index fixings for the first n periods. If a datetime indexed
Series
will use the fixings that are available in that object, and derive the rest from thecurve
.index_method (str) – Whether the indexing uses a daily measure for settlement or the most recently monthly data taken from the first day of month.
index_lag (int, optional) – The number of months by which the index value is lagged. Used to ensure consistency between curves and forecast values. Defined by default.
kwargs (dict) – Required keyword arguments to
BaseLeg
.
Notes
Warning
Setting
convention
for a ZeroIndexLeg has no effect because the determination of the cashflow within the IndexFixedPeriod will always have a DCF of 1.0.The fixed rate of the IndexFixedPeriod is set to 100% to index up the complete the notional. The offsetting Cashflow deducts the real notional.
The NPV of a ZeroIndexLeg is the sum of the period NPVs.
\[P = - v(m_n) N \left ( I(m_n) - 1 \right )\]The analytic delta is defined as zero due to the lack of rates related attributes.
\[A = 0\]Examples
In [1]: index_curve = IndexCurve({dt(2022, 1, 1): 1.0, dt(2027, 1, 1): 0.95}, index_base=100.0) In [2]: zil = ZeroIndexLeg( ...: effective=dt(2022, 1, 15), ...: termination="3Y", ...: frequency="S", ...: index_method="monthly", ...: index_base=100.25, ...: ) ...: In [3]: zil.cashflows(index_curve, curve) Out[3]: Type Period Ccy Acc Start Acc End Payment Convention DCF Notional DF Collateral Rate Spread Real Cashflow Index Base Index Val Index Ratio Cashflow NPV FX Rate NPV Ccy 0 ZeroIndexLeg None USD 2022-01-15 2025-01-15 2025-01-17 1 1.00 1000000.00 0.94 None 100.00 None -1000000.00 100.25 103.16 1.03 -29017.93 -27285.76 1.00 -27285.76
Methods Summary
analytic_delta
(*args, **kwargs)Return the analytic delta of the ZeroIndexLeg via summing all periods.
cashflow
([curve])Aggregate the cashflows on the IndexFixedPeriod and Cashflow period using an IndexCurve.
cashflows
(*args, **kwargs)Return the properties of the ZeroIndexLeg used in calculating cashflows.
npv
(*args, **kwargs)Return the NPV of the ZeroIndexLeg via summing all periods.
Methods Documentation
- analytic_delta(*args, **kwargs)#
Return the analytic delta of the ZeroIndexLeg via summing all periods.
For arguments see
BasePeriod.analytic_delta()
.
- cashflow(curve=None)#
Aggregate the cashflows on the IndexFixedPeriod and Cashflow period using an IndexCurve.
- cashflows(*args, **kwargs)#
Return the properties of the ZeroIndexLeg used in calculating cashflows.
For arguments see
BasePeriod.cashflows()
.
- npv(*args, **kwargs)#
Return the NPV of the ZeroIndexLeg via summing all periods.
For arguments see
BasePeriod.npv()
.