Logo
Reference manual - version qle_version
CompositeIndex Class Reference
Inheritance diagram for CompositeIndex:

Public Member Functions

 CompositeIndex (const std::string &name, const std::vector< QuantLib::ext::shared_ptr< QuantLib::Index > > &indices, const std::vector< Real > &weights, const std::vector< QuantLib::ext::shared_ptr< FxIndex > > &fxConversion={})
std::string name () const override
 Index interface.
Calendar fixingCalendar () const override
bool isValidFixingDate (const Date &fixingDate) const override
Real fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const override
bool allowsNativeFixings () override
void update () override
 Observer interface.
const std::vector< QuantLib::ext::shared_ptr< QuantLib::Index > > & indices () const
 Inspectors.
const std::vector< Real > & weights () const
const std::vector< QuantLib::ext::shared_ptr< FxIndex > > & fxConversion () const
Real dividendsBetweenDates (const Date &startDate, const Date &endDate=Date::maxDate()) const
std::vector< std::pair< QuantLib::Date, std::string > > dividendFixingDates (const Date &startDate, const Date &endDate=Date::maxDate())

Constructor & Destructor Documentation

◆ CompositeIndex()

CompositeIndex ( const std::string & name,
const std::vector< QuantLib::ext::shared_ptr< QuantLib::Index > > & indices,
const std::vector< Real > & weights,
const std::vector< QuantLib::ext::shared_ptr< FxIndex > > & fxConversion = {} )

fxConversion can be an empty vector or its length should match indices. For components that do not require a conversion, a nullptr should be given, otherwise a FxIndex with domestic ccy equal to the target currency of the index

Member Function Documentation

◆ dividendsBetweenDates()

Real dividendsBetweenDates ( const Date & startDate,
const Date & endDate = Date::maxDate() ) const

Collect dividends from equity underlying indices, apply weighting, fx conversion (if any) and return the sum. Notice that the endDate is capped at today, as in EquityIndex::dividendsBetweenDates. This only applies to underlying equity indices, for other index types zero dividends are returned