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:
object
Abstract base class with common parameters for all
Leg
subclasses.- Parameters:
schedule (Schedule) – The
Schedule
object 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
amortization
is specified an exchanged notional equivalent to the amortization amount is added to the list of periods as interim exchanges iffinal_exchange
is 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
FixedLeg
Create a fixed leg composed of
FixedPeriod
s.FloatLeg
Create a floating leg composed of
FloatPeriod
s.IndexFixedLeg
Create a fixed leg composed of
IndexFixedPeriod
s.ZeroFixedLeg
Create a zero coupon leg composed of a
FixedPeriod
.ZeroFloatLeg
Create a zero coupon leg composed of a
FloatPeriod
s.ZeroIndexLeg
Create a zero coupon leg composed of
IndexFixedPeriod
.CustomLeg
Create 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()
.