QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
EquityIndex Class Reference

Base class for equity indexes. More...

#include <ql/indexes/equityindex.hpp>

Inheritance diagram for EquityIndex:

Public Member Functions

 EquityIndex (std::string name, Calendar fixingCalendar, Currency currency, Handle< YieldTermStructure > interest={}, Handle< YieldTermStructure > dividend={}, Handle< Quote > spot={})
 EquityIndex (std::string name, Calendar fixingCalendar, Handle< YieldTermStructure > interest={}, Handle< YieldTermStructure > dividend={}, Handle< Quote > spot={})
Index interface
std::string name () const override
 Returns the name of the index.
Calendar fixingCalendar () const override
 returns the calendar defining valid fixing dates
bool isValidFixingDate (const Date &fixingDate) const override
 returns TRUE if the fixing date is a valid one
Real fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const override
 returns the fixing at the given date
Inspectors
Currency currency () const
 The index currency.
Handle< YieldTermStructureequityInterestRateCurve () const
 the rate curve used to forecast fixings
Handle< YieldTermStructureequityDividendCurve () const
 the dividend curve used to forecast fixings
Handle< Quotespot () const
 index spot value
Fixing calculations
virtual Real forecastFixing (const Date &fixingDate) const
 It can be overridden to implement particular conventions.
Public Member Functions inherited from Index
bool hasHistoricalFixing (const Date &fixingDate) const
 returns whether a historical fixing was stored for the given date
virtual Real pastFixing (const Date &fixingDate) const
 returns a past fixing at the given date
const TimeSeries< Real > & timeSeries () const
 returns the fixing TimeSeries
virtual bool allowsNativeFixings ()
 check if index allows for native fixings.
void update () override
virtual void addFixing (const Date &fixingDate, Real fixing, bool forceOverwrite=false)
void addFixings (const TimeSeries< Real > &t, bool forceOverwrite=false)
 stores historical fixings from a TimeSeries
template<class DateIterator, class ValueIterator>
void addFixings (DateIterator dBegin, DateIterator dEnd, ValueIterator vBegin, bool forceOverwrite=false)
 stores historical fixings at the given dates
void clearFixings ()
 clears all stored historical fixings
Public Member Functions inherited from Observable
 Observable (const Observable &)
Observableoperator= (const Observable &)
 Observable (Observable &&)=delete
Observableoperator= (Observable &&)=delete
void notifyObservers ()
Public Member Functions inherited from Observer
 Observer (const Observer &)
Observeroperator= (const Observer &)
std::pair< iterator, bool > registerWith (const ext::shared_ptr< Observable > &)
void registerWithObservables (const ext::shared_ptr< Observer > &)
Size unregisterWith (const ext::shared_ptr< Observable > &)
void unregisterWithAll ()
virtual void deepUpdate ()

Other methods

virtual ext::shared_ptr< EquityIndexclone (const Handle< YieldTermStructure > &interest, const Handle< YieldTermStructure > &dividend, const Handle< Quote > &spot) const

Additional Inherited Members

Public Types inherited from Observer
typedef set_type::iterator iterator
ext::shared_ptr< Observablenotifier () const

Detailed Description

Base class for equity indexes.

The equity index object allows to retrieve past fixings, as well as project future fixings using either both the risk free interest rate term structure and the dividend term structure, or just the interest rate term structure in which case one can provide a term structure of equity forwards implied from, e.g. option prices.

In case of the first method, the forward is calculated as:

\[I(t, T) = I(t, t) \frac{P_{D}(t, T)}{P_{R}(t, T)}, \]

where \( I(t, t) \) is today's value of the index, \( P_{D}(t, T) \) is a discount factor of the dividend curve at future time \( T \), and \( P_{R}(t, T) \) is a discount factor of the risk free curve at future time \( T \).

In case of the latter method, the forward is calculated as:

\[I(t, T) = I(t, t) \frac{1}{P_{F}(t, T)}, \]

where \( P_{F}(t, T) \) is a discount factor of the equity forward term structure.

To forecast future fixings, the user can either provide a handle to the current index spot. If spot handle is empty, today's fixing will be used, instead.

Constructor & Destructor Documentation

◆ EquityIndex()

EquityIndex ( std::string name,
Calendar fixingCalendar,
Handle< YieldTermStructure > interest = {},
Handle< YieldTermStructure > dividend = {},
Handle< Quote > spot = {} )
Deprecated
Use the constructor taking a currency. Deprecated in version 1.36.

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.

◆ fixingCalendar()

Calendar fixingCalendar ( ) const
overridevirtual

returns the calendar defining valid fixing dates

Implements Index.

◆ isValidFixingDate()

bool isValidFixingDate ( const Date & fixingDate) const
overridevirtual

returns TRUE if the fixing date is a valid one

Implements Index.

◆ fixing()

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

◆ clone()

virtual ext::shared_ptr< EquityIndex > clone ( const Handle< YieldTermStructure > & interest,
const Handle< YieldTermStructure > & dividend,
const Handle< Quote > & spot ) const
virtual

returns a copy of itself linked to different interest, dividend curves or spot quote