Table of Contents

Class MultiStepRatchet

Namespace
NanoQL.Models
Assembly
NanoQL.dll

A full ratchet: at each rate's reset, the coupon max(g_floor · floor + s_floor, g_fixing · f + s_fixing) times the accrual, the floor then the coupon, from the initial floor.

[WorkingType]
public sealed class MultiStepRatchet : MultiProductMultiStep
Inheritance
MultiStepRatchet
Inherited Members

Remarks

A working type. Fewer accruals or payment times than rates are refused, where QuantLib reads past them.

QuantLib's sign, kept and documented: a payer ratchet receives the coupon (its multiplier is +1), where QuantLib's swap and inverse floater pay theirs.

Constructors

MultiStepRatchet(ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<double>, double, double, double, double, double, bool)

Initializes a new instance of the MultiStepRatchet class.

public MultiStepRatchet(ReadOnlySpan<double> rateTimes, ReadOnlySpan<double> accruals, ReadOnlySpan<double> paymentTimes, double gearingOfFloor, double gearingOfFixing, double spreadOfFloor, double spreadOfFixing, double initialFloor, bool payer = true)

Parameters

rateTimes ReadOnlySpan<double>

The rate times, at least two.

accruals ReadOnlySpan<double>

The accruals, one a rate at least.

paymentTimes ReadOnlySpan<double>

The payment times, increasing, one a rate at least.

gearingOfFloor double

The floor's gearing.

gearingOfFixing double

The fixing's gearing.

spreadOfFloor double

The floor's spread.

spreadOfFixing double

The fixing's spread.

initialFloor double

The initial floor.

payer bool

QuantLib's flag: true receives the coupon.

Exceptions

ArgumentException

The times aren't increasing, or the inputs are shorter than the rates.

Properties

MaxNumberOfCashFlowsPerProductPerStep

Gets 1.

public override int MaxNumberOfCashFlowsPerProductPerStep { get; }

Property Value

int

NumberOfProducts

Gets 1.

public override int NumberOfProducts { get; }

Property Value

int

Methods

Clone()

A deep copy of the product, its state included.

public override MarketModelMultiProduct Clone()

Returns

MarketModelMultiProduct

A new product.

NextTimeStep(CurveState, Span<int>, MarketModelMultiProductCashFlow[][])

Moves the product a step: writes each product's number of cash flows at this step and the cash flows.

public override bool NextTimeStep(CurveState currentState, Span<int> numberCashFlowsThisStep, MarketModelMultiProductCashFlow[][] cashFlowsGenerated)

Parameters

currentState CurveState

The state of the curve at the step's end.

numberCashFlowsThisStep Span<int>

Each product's number of cash flows, written; one entry a product.

cashFlowsGenerated MarketModelMultiProductCashFlow[][]

Each product's cash flows, written from the first; NumberOfProducts rows of at least MaxNumberOfCashFlowsPerProductPerStep.

Returns

bool

Whether the path is finished for the product.

PossibleCashFlowTimes()

The times the product can pay at, which its cash flows' time indices index.

public override ImmutableArray<double> PossibleCashFlowTimes()

Returns

ImmutableArray<double>

The times.

Reset()

Puts the ratchet at a path's start, its floor the initial floor.

public override void Reset()