Commodity average basis price curve. More...
#include <qle/termstructures/commodityaveragebasispricecurve.hpp>
Public Member Functions | |
Constructors | |
CommodityAverageBasisPriceCurve (const QuantLib::Date &referenceDate, const std::map< QuantLib::Date, QuantLib::Handle< QuantLib::Quote > > &basisData, const QuantLib::ext::shared_ptr< FutureExpiryCalculator > &basisFec, const QuantLib::ext::shared_ptr< CommodityIndex > &index, const QuantLib::ext::shared_ptr< FutureExpiryCalculator > &baseFec, bool addBasis=true, bool priceAsHistFixing=true, const Interpolator &interpolator=Interpolator()) | |
Curve constructed from dates and quotes. More... | |
Observer interface | |
void | update () override |
LazyObject interface | |
void | performCalculations () const override |
TermStructure interface | |
QuantLib::Date | maxDate () const override |
QuantLib::Time | maxTime () const override |
PriceTermStructure interface | |
QuantLib::Time | minTime () const override |
The minimum time for which the curve can return values. More... | |
std::vector< QuantLib::Date > | pillarDates () const override |
The pillar dates for the PriceTermStructure. More... | |
const QuantLib::Currency & | currency () const override |
The currency in which prices are expressed. More... | |
Inspectors | |
const std::vector< QuantLib::Time > & | times () const |
const std::vector< QuantLib::Real > & | prices () const |
Public Member Functions inherited from CommodityBasisPriceTermStructure | |
CommodityBasisPriceTermStructure (const QuantLib::Date &referenceDate, const QuantLib::Calendar &cal, const QuantLib::DayCounter &dc, const QuantLib::ext::shared_ptr< FutureExpiryCalculator > &basisFec, const QuantLib::ext::shared_ptr< CommodityIndex > &baseIndex, const QuantLib::ext::shared_ptr< FutureExpiryCalculator > &baseFec, bool addBasis=true, QuantLib::Size monthOffset=0, bool averagingBaseCashflow=false, bool priceAsHistoricalFixing=true) | |
CommodityBasisPriceTermStructure (const QuantLib::Date &referenceDate, const QuantLib::ext::shared_ptr< FutureExpiryCalculator > &basisFec, const QuantLib::ext::shared_ptr< CommodityIndex > &baseIndex, const QuantLib::ext::shared_ptr< FutureExpiryCalculator > &baseFec, bool addBasis=true, QuantLib::Size monthOffset=0, bool averagingBaseCashflow=false, bool priceAsHistoricalFixing=true) | |
const QuantLib::ext::shared_ptr< FutureExpiryCalculator > & | basisFutureExpiryCalculator () const |
Inspectors. More... | |
const QuantLib::ext::shared_ptr< CommodityIndex > & | baseIndex () const |
const QuantLib::ext::shared_ptr< FutureExpiryCalculator > & | baseFutureExpiryCalculator () const |
bool | addBasis () const |
bool | averagingBaseCashflow () const |
bool | priceAsHistoricalFixing () const |
QuantLib::Size | monthOffset () const |
Public Member Functions inherited from PriceTermStructure | |
PriceTermStructure (const QuantLib::DayCounter &dc=QuantLib::DayCounter()) | |
PriceTermStructure (const QuantLib::Date &referenceDate, const QuantLib::Calendar &cal=QuantLib::Calendar(), const QuantLib::DayCounter &dc=QuantLib::DayCounter()) | |
PriceTermStructure (QuantLib::Natural settlementDays, const QuantLib::Calendar &cal, const QuantLib::DayCounter &dc=QuantLib::DayCounter()) | |
QuantLib::Real | price (QuantLib::Time t, bool extrapolate=false) const |
QuantLib::Real | price (const QuantLib::Date &d, bool extrapolate=false) const |
void | update () override |
PriceTermStructure implementation | |
std::map< QuantLib::Date, QuantLib::Handle< QuantLib::Quote > > | basisData_ |
std::vector< QuantLib::Date > | dates_ |
std::vector< Time > | basisTimes_ |
std::vector< Real > | basisValues_ |
Interpolation | basisInterpolation_ |
QuantLib::Leg | baseLeg_ |
The averaging cashflows will give the base curve prices. More... | |
std::map< QuantLib::Size, QuantLib::Size > | legIndexMap_ |
QuantLib::Real | priceImpl (QuantLib::Time t) const override |
Price calculation. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from PriceTermStructure | |
void | checkRange (QuantLib::Time t, bool extrapolate) const |
Extra time range check for minimum time, then calls TermStructure::checkRange. More... | |
Protected Attributes inherited from CommodityBasisPriceTermStructure | |
QuantLib::ext::shared_ptr< FutureExpiryCalculator > | basisFec_ |
QuantLib::ext::shared_ptr< CommodityIndex > | baseIndex_ |
QuantLib::ext::shared_ptr< FutureExpiryCalculator > | baseFec_ |
bool | addBasis_ |
QuantLib::Size | monthOffset_ |
bool | averagingBaseCashflow_ |
bool | priceAsHistoricalFixing_ |
Commodity average basis price curve.
Class representing an outright commodity price curve created from a base price curve and a collection of basis quotes that are added to or subtracted from the base curve. This class is intended to be used only for commodity future basis price curves. The base curve is averaged over the period defined the basis quote.
Definition at line 47 of file commodityaveragebasispricecurve.hpp.
CommodityAverageBasisPriceCurve | ( | const QuantLib::Date & | referenceDate, |
const std::map< QuantLib::Date, QuantLib::Handle< QuantLib::Quote > > & | basisData, | ||
const QuantLib::ext::shared_ptr< FutureExpiryCalculator > & | basisFec, | ||
const QuantLib::ext::shared_ptr< CommodityIndex > & | index, | ||
const QuantLib::ext::shared_ptr< FutureExpiryCalculator > & | baseFec, | ||
bool | addBasis = true , |
||
bool | priceAsHistFixing = true , |
||
const Interpolator & | interpolator = Interpolator() |
||
) |
Curve constructed from dates and quotes.
Definition at line 119 of file commodityaveragebasispricecurve.hpp.
|
override |
Definition at line 228 of file commodityaveragebasispricecurve.hpp.
|
override |
Definition at line 232 of file commodityaveragebasispricecurve.hpp.
|
override |
Definition at line 263 of file commodityaveragebasispricecurve.hpp.
|
override |
Definition at line 267 of file commodityaveragebasispricecurve.hpp.
|
overridevirtual |
The minimum time for which the curve can return values.
Reimplemented from PriceTermStructure.
Definition at line 271 of file commodityaveragebasispricecurve.hpp.
|
overridevirtual |
The pillar dates for the PriceTermStructure.
Implements PriceTermStructure.
Definition at line 276 of file commodityaveragebasispricecurve.hpp.
|
overridevirtual |
The currency in which prices are expressed.
Implements PriceTermStructure.
Definition at line 82 of file commodityaveragebasispricecurve.hpp.
const std::vector< QuantLib::Time > & times | ( | ) | const |
Definition at line 87 of file commodityaveragebasispricecurve.hpp.
const std::vector< QuantLib::Real > & prices | ( | ) | const |
Definition at line 88 of file commodityaveragebasispricecurve.hpp.
|
overrideprotectedvirtual |
Price calculation.
Implements PriceTermStructure.
Definition at line 281 of file commodityaveragebasispricecurve.hpp.
|
private |
Definition at line 98 of file commodityaveragebasispricecurve.hpp.
|
private |
Definition at line 100 of file commodityaveragebasispricecurve.hpp.
|
mutableprivate |
Interpolator used for interpolating the basis if needed. Basis interpolation uses the same interpolator as the curve itself. A second template parameter could be added for this in future if it needs to be relaxed.
Definition at line 105 of file commodityaveragebasispricecurve.hpp.
|
mutableprivate |
Definition at line 106 of file commodityaveragebasispricecurve.hpp.
|
mutableprivate |
Definition at line 107 of file commodityaveragebasispricecurve.hpp.
|
private |
The averaging cashflows will give the base curve prices.
Definition at line 110 of file commodityaveragebasispricecurve.hpp.
|
private |
Map where the key is the index of a time in the times_ vector and the value is the index of the cashflow in the baseLeg_ to associate with that time.
Definition at line 115 of file commodityaveragebasispricecurve.hpp.