Periods#

Conventional 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.FixedPeriod, rateslib.periods.FloatPeriod, rateslib.periods.IndexFixedPeriod, rateslib.periods.Cashflow, rateslib.periods.IndexCashflow

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 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.

Volatility Periods#

Volatility periods provide the basic calculations for european options priced with Black-76 pricing formula.

Inheritance diagram of rateslib.periods.FXCallPeriod, rateslib.periods.FXPutPeriod

rateslib.periods.FXCallPeriod(*args, **kwargs)

Create an FXCallPeriod.

rateslib.periods.FXPutPeriod(*args, **kwargs)

Create an FXPutPeriod.

Common methods

Every volatility Period type is endowed with the following methods:

rateslib.periods.FXOptionPeriod.npv(...[, ...])

Return the NPV of the FXOption.

rateslib.periods.FXOptionPeriod.analytic_greeks(...)

Return the different greeks for the FX Option.

rateslib.periods.FXOptionPeriod.rate(...[, ...])

Return the pricing metric of the FXOption.

rateslib.periods.FXOptionPeriod.implied_vol(...)

Calculate the implied volatility of the FX option.