Periods#

The rateslib.periods module creates Period objects that define ways to describe single cashflows, generated under various calculation methodologies. It is probably quite rare that Periods will be instantiated directly, rather they form the components of Legs, but none-the-less, this page describes their construction.

The following Periods are provided, click on the links for a full description of each Period type:

Inheritance diagram of rateslib.periods.BasePeriod, rateslib.periods.Cashflow, rateslib.periods.FXCallPeriod, rateslib.periods.FXOptionPeriod, rateslib.periods.FXPutPeriod, rateslib.periods.FixedPeriod, rateslib.periods.FloatPeriod, rateslib.periods.IndexCashflow, rateslib.periods.IndexFixedPeriod, rateslib.periods.IndexMixin

rateslib.periods.BasePeriod(start, end, ...)

Abstract base class with common parameters for all Period subclasses.

rateslib.periods.FixedPeriod(*args[, fixed_rate])

Create a period defined with a fixed rate.

rateslib.periods.FloatPeriod(*args[, ...])

Create a period defined with a floating rate index.

rateslib.periods.Cashflow(notional, payment)

Create a single cashflow amount on a payment date (effectively a CustomPeriod).

rateslib.periods.IndexFixedPeriod(*args[, ...])

Create a period defined with a real rate adjusted by an index.

rateslib.periods.IndexCashflow(*args, index_base)

Create a cashflow defined with a real rate adjusted by an index.

Common methods

Every Period type is endowed with the following the methods:

rateslib.periods.BasePeriod.npv([curve, ...])

Return the NPV of the period object.

rateslib.periods.BasePeriod.analytic_delta([...])

Return the analytic delta of the period object.

rateslib.periods.BasePeriod.cashflows([...])

Return the properties of the period used in calculating cashflows.

Special methods

FloatPeriod types have specific methods to support their specific functionality, such as:

rateslib.periods.FloatPeriod.rate(curve)

Calculating the floating rate for the period.

rateslib.periods.FloatPeriod.fixings_table(curve)

Return a DataFrame of fixing exposures.

IndexFixedPeriod and IndexCashflow types have specific methods to support their specific functionality, such as:

rateslib.periods.IndexMixin.index_ratio([curve])

Calculate the index ratio for the end date of the IndexPeriod.