Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CommodityFuturesIndex Class Reference

#include <qle/indexes/commodityindex.hpp>

+ Inheritance diagram for CommodityFuturesIndex:
+ Collaboration diagram for CommodityFuturesIndex:

Public Member Functions

 CommodityFuturesIndex (const std::string &underlyingName, const Date &expiryDate, const Calendar &fixingCalendar, const Handle< QuantExt::PriceTermStructure > &priceCurve=Handle< QuantExt::PriceTermStructure >())
 
 CommodityFuturesIndex (const std::string &underlyingName, const Date &expiryDate, const Calendar &fixingCalendar, bool keepDays, const Handle< QuantExt::PriceTermStructure > &priceCurve=Handle< QuantExt::PriceTermStructure >())
 
QuantLib::ext::shared_ptr< CommodityIndexclone (const QuantLib::Date &expiryDate=QuantLib::Date(), const boost::optional< QuantLib::Handle< PriceTermStructure > > &ts=boost::none) const override
 Implement the base clone. More...
 
- Public Member Functions inherited from CommodityIndex
 CommodityIndex (const std::string &underlyingName, const QuantLib::Date &expiryDate, const Calendar &fixingCalendar, const Handle< QuantExt::PriceTermStructure > &priceCurve=Handle< QuantExt::PriceTermStructure >())
 
 CommodityIndex (const std::string &underlyingName, const QuantLib::Date &expiryDate, const Calendar &fixingCalendar, bool keepDays, const Handle< QuantExt::PriceTermStructure > &priceCurve=Handle< QuantExt::PriceTermStructure >())
 
std::string name () const override
 
Calendar fixingCalendar () const override
 
bool isValidFixingDate (const Date &fixingDate) const override
 
Real fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const override
 
void update () override
 
std::string underlyingName () const
 
const Handle< QuantExt::PriceTermStructure > & priceCurve () const
 
bool isFuturesIndex () const
 
const QuantLib::Date & expiryDate () const
 
bool keepDays () const
 
virtual Real forecastFixing (const Date &fixingDate) const
 
virtual Real forecastFixing (const Time &fixingTime) const override
 returns the fixing at the given time More...
 
virtual Real pastFixing (const Date &fixingDate) const override
 returns a past fixing at the given date More...
 
- Public Member Functions inherited from EqFxIndexBase
virtual ~EqFxIndexBase ()
 
virtual Real forecastFixing (const Time &fixingTime) const =0
 returns the fixing at the given time More...
 
virtual Real pastFixing (const Date &fixingDate) const =0
 returns a past fixing at the given date More...
 

Additional Inherited Members

- Protected Member Functions inherited from CommodityIndex
void init ()
 
- Protected Attributes inherited from CommodityIndex
std::string underlyingName_
 
Date expiryDate_
 
Calendar fixingCalendar_
 
Handle< QuantExt::PriceTermStructurecurve_
 
std::string name_
 
bool isFuturesIndex_
 
bool keepDays_
 

Detailed Description

Definition at line 123 of file commodityindex.hpp.

Constructor & Destructor Documentation

◆ CommodityFuturesIndex() [1/2]

CommodityFuturesIndex ( const std::string &  underlyingName,
const Date &  expiryDate,
const Calendar &  fixingCalendar,
const Handle< QuantExt::PriceTermStructure > &  priceCurve = Handle<QuantExt::PriceTermStructure>() 
)

Definition at line 125 of file commodityindex.hpp.

129 QL_REQUIRE(expiryDate_ != Date(), "non-empty expiry date expected CommodityFuturesIndex");
130 }
const QuantLib::Date & expiryDate() const
Calendar fixingCalendar() const override
CommodityIndex(const std::string &underlyingName, const QuantLib::Date &expiryDate, const Calendar &fixingCalendar, const Handle< QuantExt::PriceTermStructure > &priceCurve=Handle< QuantExt::PriceTermStructure >())
const Handle< QuantExt::PriceTermStructure > & priceCurve() const
std::string underlyingName() const

◆ CommodityFuturesIndex() [2/2]

CommodityFuturesIndex ( const std::string &  underlyingName,
const Date &  expiryDate,
const Calendar &  fixingCalendar,
bool  keepDays,
const Handle< QuantExt::PriceTermStructure > &  priceCurve = Handle<QuantExt::PriceTermStructure>() 
)

Definition at line 132 of file commodityindex.hpp.

136 QL_REQUIRE(expiryDate_ != Date(), "non-empty expiry date expected CommodityFuturesIndex");
137 }

Member Function Documentation

◆ clone()

QuantLib::ext::shared_ptr< CommodityIndex > clone ( const QuantLib::Date &  expiryDate = QuantLib::Date(),
const boost::optional< QuantLib::Handle< PriceTermStructure > > &  ts = boost::none 
) const
overridevirtual

Implement the base clone.

Implements CommodityIndex.

Reimplemented in OffPeakPowerIndex.

Definition at line 129 of file commodityindex.cpp.

130 {
131 const auto& pts = ts ? *ts : priceCurve();
132 const auto& ed = expiry == Date() ? expiryDate() : expiry;
133 return QuantLib::ext::make_shared<CommodityFuturesIndex>(underlyingName(), ed, fixingCalendar(), keepDays(), pts);
134}