ZeroFloatLeg#
- class rateslib.legs.ZeroFloatLeg(*args, float_spread=NoInput.blank, fixings=NoInput.blank, fixing_method=NoInput.blank, method_param=NoInput.blank, spread_compound_method=NoInput.blank, **kwargs)#
Bases:
BaseLeg
,FloatLegMixin
Create a zero coupon floating leg composed of
FloatPeriod
s.- Parameters:
args (dict) – Required positional args to
BaseLeg
.float_spread (float, optional) – The spread applied to determine cashflows. Can be set to None and designated later, perhaps after a mid-market spread for all periods has been calculated.
spread_compound_method (str, optional) – The method to use for adding a floating spread to compounded rates. Available options are {“none_simple”, “isda_compounding”, “isda_flat_compounding”}.
fixings (float, list, or Series optional) – If a float scalar, will be applied as the determined fixing for the first period. If a list of n fixings will be used as the fixings for the first n periods. If any sublist of length m is given, is used as the first m RFR fixings for that
FloatPeriod
. If a datetime indexedSeries
will use the fixings that are available in that object, and derive the rest from thecurve
.fixing_method (str, optional) – The method by which floating rates are determined, set by default. See notes.
method_param (int, optional) – A parameter that is used for the various
fixing_method
s. See notes.kwargs (dict) – Required keyword arguments to
BaseLeg
.
Notes
The NPV of a ZeroFloatLeg is:
\[P = -N v(m_n) \left ( \prod_{i=1}^n (1 + d_i r_i(r_j, z)) - 1 \right )\]The analytic delta of a ZeroFloatLeg is:
\[A = N v(m_n) \sum_{k=1}^n d_k \frac{\partial r_k}{\partial z} \prod_{i=1, i \ne k}^n (1 + d_i r_i(r_j, z))\]Warning
When floating rates are determined from historical fixings the forecast
Curve
calendar
will be used to determine fixing dates. If this calendar does not align with the legcalendar
then spurious results or errors may be generated. Including the curve calendar in the leg is acceptable, i.e. a leg calendar of “nyc,ldn,tgt” and a curve calendar of “ldn” is valid, whereas only “nyc,tgt” may give errors.Examples
In [1]: zfl = ZeroFloatLeg( ...: effective=dt(2022, 1, 1), ...: termination="3Y", ...: frequency="S", ...: fixing_method="ibor", ...: method_param=0, ...: float_spread=100.0 ...: ) ...: In [2]: zfl.cashflows(curve) Out[2]: Type Period Ccy Acc Start Acc End Payment Convention DCF Notional DF Rate Spread Cashflow NPV FX Rate NPV Ccy Collateral 0 ZeroFloatLeg None USD 2022-01-01 2025-01-01 2025-01-03 ACT360 3.04 1000000.00 0.94 3.12 100.00 -94969.16 -89369.37 1.00 -89369.37 None
Attributes Summary
Methods Summary
analytic_delta
([curve, disc_curve, fx, base])Return the analytic delta of the ZeroFloatLeg from all periods.
cashflows
([curve, disc_curve, fx, base])Return the properties of the ZeroFloatLeg used in calculating cashflows.
fixings_table
(curve)Not yet implemented for ZeroFloatLeg
npv
(curve[, disc_curve, fx, base, local])Return the NPV of the ZeroFloatLeg via summing all periods.
rate
(curve)Calculating a period type floating rate for the zero coupon leg.
Attributes Documentation
- dcf#
Methods Documentation
- analytic_delta(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#
Return the analytic delta of the ZeroFloatLeg from all periods.
For arguments see
BasePeriod.analytic_delta()
.
- cashflows(curve=NoInput.blank, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#
Return the properties of the ZeroFloatLeg used in calculating cashflows.
For arguments see
BasePeriod.npv()
.
- fixings_table(curve)#
Not yet implemented for ZeroFloatLeg
- npv(curve, disc_curve=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, local=False)#
Return the NPV of the ZeroFloatLeg via summing all periods.
For arguments see
BasePeriod.npv()
.