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

#include <qle/indexes/commodityindex.hpp>

+ Inheritance diagram for CommoditySpotIndex:
+ Collaboration diagram for CommoditySpotIndex:

Public Member Functions

 CommoditySpotIndex (const std::string &underlyingName, const Calendar &fixingCalendar, 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. The expiryDate is ignored for a CommoditySpotIndex. 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 109 of file commodityindex.hpp.

Constructor & Destructor Documentation

◆ CommoditySpotIndex()

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

spot quote is interpreted as of today

Definition at line 112 of file commodityindex.hpp.

115 QL_REQUIRE(expiryDate_ == Date(), "empty expiry date expected in CommoditySpotIndex");
116 }
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

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. The expiryDate is ignored for a CommoditySpotIndex.

Implements CommodityIndex.

Definition at line 123 of file commodityindex.cpp.

124 {
125 const auto& pts = ts ? *ts : priceCurve();
126 return QuantLib::ext::make_shared<CommoditySpotIndex>(underlyingName(), fixingCalendar(), pts);
127}