Logo
Reference manual - version qle_version
FormulaBasedIndex Class Reference

formula based index class More...

#include <qle/indexes/formulabasedindex.hpp>

Inheritance diagram for FormulaBasedIndex:

Public Member Functions

 FormulaBasedIndex (const std::string &familyName, const std::vector< QuantLib::ext::shared_ptr< InterestRateIndex > > &indices, const CompiledFormula &formula, const Calendar &fixingCalendar)
Date maturityDate (const Date &valueDate) const override
Rate forecastFixing (const Date &fixingDate) const override
Rate pastFixing (const Date &fixingDate) const override
bool allowsNativeFixings () override
const std::vector< QuantLib::ext::shared_ptr< InterestRateIndex > > & indices () const
const CompiledFormulaformula () const

Detailed Description

formula based index class

The variables in the given formula must correspond to index vector, both w.r.t. size and position.

Warning:

  • tenor is set to 0d for this index, since it doesn't have a meaningful interpretation
  • fixingDays are set to the value of the first index, because Null<Size> could be interpreted as the actual (big) number of fixing days by client code
  • currency is set to Currency()
  • dayCounter is set to SimpleDayCounter(), because it's used in InterestRateIndex to set the name, which is overwritten here though
  • fixingCalendar should be explicitly given, since it is used to derive the fixing date in formula based coupons (and to determine valid fixing dates)