Portfolio#

class rateslib.instruments.Portfolio(instruments)#

Bases: Sensitivities

Create a collection of Instruments to group metrics

Parameters:

instruments (list) – This should be a list of Instruments.

Notes

When using a Portfolio each Instrument must either have pricing parameters pre-defined using the appropriate pricing mechanisms or share common pricing parameters defined at price time.

Examples

See examples for Spread for similar functionality.

Methods Summary

cashflows(*args, **kwargs)

cashflows_table([curves, solver, fx, base])

delta(*args, **kwargs)

Calculate the delta of the Instrument.

gamma(*args, **kwargs)

Calculate the gamma of the Instrument.

npv([curves, solver, fx, base, local])

Return the NPV of the Portfolio by summing instrument NPVs.

Methods Documentation

cashflows(*args, **kwargs)#
cashflows_table(curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, base=NoInput.blank)#
delta(*args, **kwargs)#

Calculate the delta of the Instrument.

For arguments see Sensitivities.delta().

gamma(*args, **kwargs)#

Calculate the gamma of the Instrument.

For arguments see Sensitivities.gamma().

npv(curves=NoInput.blank, solver=NoInput.blank, fx=NoInput.blank, base=NoInput.blank, local=False, **kwargs)#

Return the NPV of the Portfolio by summing instrument NPVs.

For arguments see BaseDerivative.npv().