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

#include <qle/termstructures/commoditybasispricecurvewrapper.hpp>

+ Inheritance diagram for CommodityBasisPriceCurveWrapper:
+ Collaboration diagram for CommodityBasisPriceCurveWrapper:

Public Member Functions

 CommodityBasisPriceCurveWrapper (const QuantLib::Date &referenceDate, const QuantLib::ext::shared_ptr< PriceTermStructure > &priceCurve, 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 priceAsHistFixing=true)
 
 CommodityBasisPriceCurveWrapper (const QuantLib::ext::shared_ptr< CommodityBasisPriceTermStructure > &referenceCurve, const QuantLib::ext::shared_ptr< CommodityIndex > &baseIndex, const QuantLib::ext::shared_ptr< PriceTermStructure > &priceCurve)
 
QuantLib::Date maxDate () const override
 
void update () override
 
QuantLib::Natural settlementDays () const override
 
QuantLib::Time minTime () const override
 The minimum time for which the curve can return values. More...
 
const QuantLib::Currency & currency () const override
 The currency in which prices are expressed. More...
 
std::vector< QuantLib::Date > pillarDates () const override
 The pillar dates for the PriceTermStructure. More...
 
- 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
 

Private Member Functions

void performCalculations () const override
 
QuantLib::Real priceImpl (QuantLib::Time t) const override
 Price calculation. More...
 

Private Attributes

QuantLib::ext::shared_ptr< QuantExt::PriceTermStructurepriceCurve_
 

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< FutureExpiryCalculatorbasisFec_
 
QuantLib::ext::shared_ptr< CommodityIndexbaseIndex_
 
QuantLib::ext::shared_ptr< FutureExpiryCalculatorbaseFec_
 
bool addBasis_
 
QuantLib::Size monthOffset_
 
bool averagingBaseCashflow_
 
bool priceAsHistoricalFixing_
 

Detailed Description

Definition at line 31 of file commoditybasispricecurvewrapper.hpp.

Constructor & Destructor Documentation

◆ CommodityBasisPriceCurveWrapper() [1/2]

CommodityBasisPriceCurveWrapper ( const QuantLib::Date &  referenceDate,
const QuantLib::ext::shared_ptr< PriceTermStructure > &  priceCurve,
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  priceAsHistFixing = true 
)

Definition at line 33 of file commoditybasispricecurvewrapper.hpp.

40 : CommodityBasisPriceTermStructure(referenceDate, basisFec, baseIndex, baseFec, addBasis, monthOffset,
41 averagingBaseCashflow, priceAsHistFixing),
42 priceCurve_(priceCurve) {
43 registerWith(priceCurve_);
44 }
QuantLib::ext::shared_ptr< QuantExt::PriceTermStructure > priceCurve_
const QuantLib::ext::shared_ptr< CommodityIndex > & baseIndex() const
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)

◆ CommodityBasisPriceCurveWrapper() [2/2]

CommodityBasisPriceCurveWrapper ( const QuantLib::ext::shared_ptr< CommodityBasisPriceTermStructure > &  referenceCurve,
const QuantLib::ext::shared_ptr< CommodityIndex > &  baseIndex,
const QuantLib::ext::shared_ptr< PriceTermStructure > &  priceCurve 
)

Definition at line 46 of file commoditybasispricecurvewrapper.hpp.

50 referenceCurve->referenceDate(), referenceCurve->calendar(), referenceCurve->dayCounter(),
51 referenceCurve->basisFutureExpiryCalculator(), baseIndex, referenceCurve->baseFutureExpiryCalculator(),
52 referenceCurve->addBasis(), referenceCurve->monthOffset(), referenceCurve->averagingBaseCashflow(),
53 referenceCurve->priceAsHistoricalFixing()),
54 priceCurve_(priceCurve) {
55 registerWith(priceCurve_);
56 };

Member Function Documentation

◆ maxDate()

QuantLib::Date maxDate ( ) const
override

Definition at line 58 of file commoditybasispricecurvewrapper.hpp.

58{ return priceCurve_->maxDate(); }

◆ update()

void update ( )
override

Definition at line 60 of file commoditybasispricecurvewrapper.hpp.

60 {
61 LazyObject::update();
62 TermStructure::update();
63 }

◆ settlementDays()

QuantLib::Natural settlementDays ( ) const
override

Definition at line 65 of file commoditybasispricecurvewrapper.hpp.

65{ return priceCurve_->settlementDays(); }

◆ minTime()

QuantLib::Time minTime ( ) const
overridevirtual

The minimum time for which the curve can return values.

Reimplemented from PriceTermStructure.

Definition at line 67 of file commoditybasispricecurvewrapper.hpp.

67{ return priceCurve_->minTime(); }

◆ currency()

const QuantLib::Currency & currency ( ) const
overridevirtual

The currency in which prices are expressed.

Implements PriceTermStructure.

Definition at line 68 of file commoditybasispricecurvewrapper.hpp.

68{ return priceCurve_->currency(); }

◆ pillarDates()

std::vector< QuantLib::Date > pillarDates ( ) const
overridevirtual

The pillar dates for the PriceTermStructure.

Implements PriceTermStructure.

Definition at line 69 of file commoditybasispricecurvewrapper.hpp.

69{ return priceCurve_->pillarDates(); }

◆ performCalculations()

void performCalculations ( ) const
overrideprivate

Definition at line 72 of file commoditybasispricecurvewrapper.hpp.

72{}

◆ priceImpl()

QuantLib::Real priceImpl ( QuantLib::Time  ) const
overrideprivatevirtual

Price calculation.

Implements PriceTermStructure.

Definition at line 73 of file commoditybasispricecurvewrapper.hpp.

73{ return priceCurve_->price(t, allowsExtrapolation()); }

Member Data Documentation

◆ priceCurve_

QuantLib::ext::shared_ptr<QuantExt::PriceTermStructure> priceCurve_
private

Definition at line 75 of file commoditybasispricecurvewrapper.hpp.