Commodity basis price curve. More...
#include <qle/termstructures/commoditybasispricecurve.hpp>
Public Member Functions | |
Constructors | |
CommodityBasisPriceCurve (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 > &baseIndex, const QuantLib::ext::shared_ptr< FutureExpiryCalculator > &baseFec, bool addBasis=true, QuantLib::Size monthOffset=0, 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_ |
std::map< QuantLib::Date, QuantLib::ext::shared_ptr< CashFlow > > | baseLeg_ |
The commodity 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 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.
There is an assumption in the curve construction that the frequency of the base future contract is the same as the frequency of the basis future contract. In other words, if the base future contract is monthly then the basis future contract is monthly for example.
Definition at line 53 of file commoditybasispricecurve.hpp.
CommodityBasisPriceCurve | ( | 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 > & | baseIndex, | ||
const QuantLib::ext::shared_ptr< FutureExpiryCalculator > & | baseFec, | ||
bool | addBasis = true , |
||
QuantLib::Size | monthOffset = 0 , |
||
bool | priceAsHistFixing = true , |
||
const Interpolator & | interpolator = Interpolator() |
||
) |
Curve constructed from dates and quotes.
Definition at line 125 of file commoditybasispricecurve.hpp.
|
override |
Definition at line 207 of file commoditybasispricecurve.hpp.
|
override |
Definition at line 209 of file commoditybasispricecurve.hpp.
|
override |
Definition at line 249 of file commoditybasispricecurve.hpp.
|
override |
Definition at line 253 of file commoditybasispricecurve.hpp.
|
overridevirtual |
The minimum time for which the curve can return values.
Reimplemented from PriceTermStructure.
Definition at line 257 of file commoditybasispricecurve.hpp.
|
overridevirtual |
The pillar dates for the PriceTermStructure.
Implements PriceTermStructure.
Definition at line 261 of file commoditybasispricecurve.hpp.
|
overridevirtual |
The currency in which prices are expressed.
Implements PriceTermStructure.
Definition at line 89 of file commoditybasispricecurve.hpp.
const std::vector< QuantLib::Time > & times | ( | ) | const |
Definition at line 94 of file commoditybasispricecurve.hpp.
const std::vector< QuantLib::Real > & prices | ( | ) | const |
Definition at line 95 of file commoditybasispricecurve.hpp.
|
overrideprotectedvirtual |
Price calculation.
Implements PriceTermStructure.
Definition at line 265 of file commoditybasispricecurve.hpp.
|
private |
Definition at line 105 of file commoditybasispricecurve.hpp.
|
private |
Definition at line 106 of file commoditybasispricecurve.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 111 of file commoditybasispricecurve.hpp.
|
mutableprivate |
Definition at line 112 of file commoditybasispricecurve.hpp.
|
mutableprivate |
Definition at line 113 of file commoditybasispricecurve.hpp.
|
private |
The commodity cashflows will give the base curve prices.
Definition at line 116 of file commoditybasispricecurve.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 121 of file commoditybasispricecurve.hpp.