QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | List of all members
InterestRateIndex Class Referenceabstract

base class for interest rate indexes More...

#include <interestrateindex.hpp>

+ Inheritance diagram for InterestRateIndex:
+ Collaboration diagram for InterestRateIndex:

Public Member Functions

 InterestRateIndex (std::string familyName, const Period &tenor, Natural settlementDays, Currency currency, Calendar fixingCalendar, DayCounter dayCounter)
 
Index interface
std::string name () const override
 Returns the name of the index. More...
 
Calendar fixingCalendar () const override
 returns the calendar defining valid fixing dates More...
 
bool isValidFixingDate (const Date &fixingDate) const override
 returns TRUE if the fixing date is a valid one More...
 
Rate fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const override
 returns the fixing at the given date More...
 
Observer interface
void update () override
 
Inspectors
std::string familyName () const
 
Period tenor () const
 
Natural fixingDays () const
 
Date fixingDate (const Date &valueDate) const
 
const Currencycurrency () const
 
const DayCounterdayCounter () const
 
Date calculations

These method can be overridden to implement particular conventions (e.g. EurLibor)

virtual Date valueDate (const Date &fixingDate) const
 
virtual Date maturityDate (const Date &valueDate) const =0
 
- Public Member Functions inherited from Index
 ~Index () override=default
 
virtual std::string name () const =0
 Returns the name of the index. More...
 
virtual Calendar fixingCalendar () const =0
 returns the calendar defining valid fixing dates More...
 
virtual bool isValidFixingDate (const Date &fixingDate) const =0
 returns TRUE if the fixing date is a valid one More...
 
bool hasHistoricalFixing (const Date &fixingDate) const
 returns whether a historical fixing was stored for the given date More...
 
virtual Real fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const =0
 returns the fixing at the given date More...
 
const TimeSeries< Real > & timeSeries () const
 returns the fixing TimeSeries More...
 
virtual bool allowsNativeFixings ()
 check if index allows for native fixings. More...
 
virtual void addFixing (const Date &fixingDate, Real fixing, bool forceOverwrite=false)
 stores the historical fixing at the given date More...
 
void addFixings (const TimeSeries< Real > &t, bool forceOverwrite=false)
 stores historical fixings from a TimeSeries More...
 
template<class DateIterator , class ValueIterator >
void addFixings (DateIterator dBegin, DateIterator dEnd, ValueIterator vBegin, bool forceOverwrite=false)
 stores historical fixings at the given dates More...
 
void clearFixings ()
 clears all stored historical fixings More...
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 

Fixing calculations

std::string familyName_
 
Period tenor_
 
Natural fixingDays_
 
Currency currency_
 
DayCounter dayCounter_
 
std::string name_
 
Calendar fixingCalendar_
 
virtual Rate forecastFixing (const Date &fixingDate) const =0
 It can be overridden to implement particular conventions. More...
 
virtual Rate pastFixing (const Date &fixingDate) const
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 

Detailed Description

base class for interest rate indexes

Definition at line 39 of file interestrateindex.hpp.

Constructor & Destructor Documentation

◆ InterestRateIndex()

InterestRateIndex ( std::string  familyName,
const Period tenor,
Natural  settlementDays,
Currency  currency,
Calendar  fixingCalendar,
DayCounter  dayCounter 
)

Definition at line 29 of file interestrateindex.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ name()

std::string name ( ) const
overridevirtual

Returns the name of the index.

Warning:
This method is used for output and comparison between indexes. It is not meant to be used for writing switch-on-type code.

Implements Index.

Definition at line 98 of file interestrateindex.hpp.

+ Here is the caller graph for this function:

◆ fixingCalendar()

Calendar fixingCalendar ( ) const
overridevirtual

returns the calendar defining valid fixing dates

Implements Index.

Definition at line 102 of file interestrateindex.hpp.

+ Here is the caller graph for this function:

◆ isValidFixingDate()

bool isValidFixingDate ( const Date fixingDate) const
overridevirtual

returns TRUE if the fixing date is a valid one

Implements Index.

Definition at line 106 of file interestrateindex.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fixing()

Rate fixing ( const Date fixingDate,
bool  forecastTodaysFixing = false 
) const
overridevirtual

returns the fixing at the given date

the date passed as arguments must be the actual calendar date of the fixing; no settlement days must be used.

Implements Index.

Definition at line 63 of file interestrateindex.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

void update ( )
overridevirtual

This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.

Implements Observer.

Definition at line 110 of file interestrateindex.hpp.

+ Here is the call graph for this function:

◆ familyName()

std::string familyName ( ) const

Definition at line 61 of file interestrateindex.hpp.

+ Here is the caller graph for this function:

◆ tenor()

Period tenor ( ) const

Definition at line 62 of file interestrateindex.hpp.

+ Here is the caller graph for this function:

◆ fixingDays()

Natural fixingDays ( ) const

Definition at line 63 of file interestrateindex.hpp.

+ Here is the caller graph for this function:

◆ fixingDate()

Date fixingDate ( const Date valueDate) const

Definition at line 114 of file interestrateindex.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ currency()

const Currency & currency ( ) const

Definition at line 65 of file interestrateindex.hpp.

+ Here is the caller graph for this function:

◆ dayCounter()

const DayCounter & dayCounter ( ) const

Definition at line 66 of file interestrateindex.hpp.

+ Here is the caller graph for this function:

◆ valueDate()

Date valueDate ( const Date fixingDate) const
virtual

Reimplemented in EURLibor, and Libor.

Definition at line 120 of file interestrateindex.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maturityDate()

virtual Date maturityDate ( const Date valueDate) const
pure virtual

◆ forecastFixing()

virtual Rate forecastFixing ( const Date fixingDate) const
pure virtual

It can be overridden to implement particular conventions.

Implemented in ProxyIbor, SwapSpreadIndex, BMAIndex, IborIndex, and SwapIndex.

+ Here is the caller graph for this function:

◆ pastFixing()

Rate pastFixing ( const Date fixingDate) const
virtual

Reimplemented in SwapSpreadIndex.

Definition at line 126 of file interestrateindex.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ familyName_

std::string familyName_
protected

Definition at line 85 of file interestrateindex.hpp.

◆ tenor_

Period tenor_
protected

Definition at line 86 of file interestrateindex.hpp.

◆ fixingDays_

Natural fixingDays_
protected

Definition at line 87 of file interestrateindex.hpp.

◆ currency_

Currency currency_
protected

Definition at line 88 of file interestrateindex.hpp.

◆ dayCounter_

DayCounter dayCounter_
protected

Definition at line 89 of file interestrateindex.hpp.

◆ name_

std::string name_
protected

Definition at line 90 of file interestrateindex.hpp.

◆ fixingCalendar_

Calendar fixingCalendar_
private

Definition at line 92 of file interestrateindex.hpp.