BaseLeg#
- class rateslib.legs.BaseLeg(schedule, *, notional=NoInput.blank, currency=NoInput.blank, amortization=NoInput.blank, convention=NoInput.blank, payment_lag_exchange=NoInput.blank, initial_exchange=False, final_exchange=False)#
Bases:
objectAbstract base class with common parameters for all
Legsubclasses.- Parameters:
schedule (Schedule) – The
Scheduleobject which structures contiguous Periods.notional (float, optional) – The leg notional, which is applied to each period.
currency (str, optional) – The currency of the leg (3-digit code).
amortization (float, optional) – The amount by which to adjust the notional each successive period. Should have sign equal to that of notional if the notional is to reduce towards zero.
convention (str, optional) – The day count convention applied to calculations of period accrual dates. See
dcf().payment_lag_exchange (int) – The number of business days by which to delay notional exchanges, aligned with the accrual schedule.
initial_exchange (bool) – Whether to also include an initial notional exchange.
final_exchange (bool) – Whether to also include a final notional exchange and interim amortization notional exchanges.
Notes
The (optional) initial cashflow notional is set as the negative of the notional. The payment date is set equal to the accrual start date adjusted by the
payment_lag_exchange.The final cashflow notional is set as the notional. The payment date is set equal to the final accrual date adjusted by
payment_lag_exchange.If
amortizationis specified an exchanged notional equivalent to the amortization amount is added to the list of periods as interim exchanges iffinal_exchangeis True. Payment dates adhere to thepayment_lag_exchange.Examples
See Leg Examples
- currency#
- Type:
str
- convention#
- Type:
str
- periods#
- Type:
list
- initial_exchange#
- Type:
bool
- final_exchange#
- Type:
bool
- payment_lag_exchange#
- Type:
int
See also
FixedLegCreate a fixed leg composed of
FixedPeriods.FloatLegCreate a floating leg composed of
FloatPeriods.IndexFixedLegCreate a fixed leg composed of
IndexFixedPeriods.ZeroFixedLegCreate a zero coupon leg composed of a
FixedPeriod.ZeroFloatLegCreate a zero coupon leg composed of a
FloatPeriods.ZeroIndexLegCreate a zero coupon leg composed of
IndexFixedPeriod.CustomLegCreate a leg composed of user specified periods.
Attributes Summary
Methods Summary
analytic_delta(*args, **kwargs)Return the analytic delta of the Leg via summing all periods.
cashflows(*args, **kwargs)Return the properties of the Leg used in calculating cashflows.
npv(*args, **kwargs)Return the NPV of the Leg via summing all periods.
Attributes Documentation
- amortization#
- notional#
Methods Documentation
- analytic_delta(*args, **kwargs)#
Return the analytic delta of the Leg via summing all periods.
For arguments see
BasePeriod.analytic_delta().
- cashflows(*args, **kwargs)#
Return the properties of the Leg used in calculating cashflows.
For arguments see
BasePeriod.cashflows().
- npv(*args, **kwargs)#
Return the NPV of the Leg via summing all periods.
For arguments see
BasePeriod.npv().