Cash flow dependent on a single commodity spot price or futures settlement price on a given pricing date. More...
#include <qle/cashflows/commodityindexedcashflow.hpp>
Public Types | |
enum class | PaymentTiming { InAdvance , InArrears , RelativeToExpiry } |
Public Member Functions | |
CommodityIndexedCashFlow (QuantLib::Real quantity, const QuantLib::Date &pricingDate, const QuantLib::Date &paymentDate, const ext::shared_ptr< CommodityIndex > &index, QuantLib::Real spread=0.0, QuantLib::Real gearing=1.0, bool useFuturePrice=false, const Date &contractDate=Date(), const ext::shared_ptr< FutureExpiryCalculator > &calc=nullptr, QuantLib::Natural dailyExpiryOffset=QuantLib::Null< QuantLib::Natural >(), const ext::shared_ptr< FxIndex > &fxIndex=nullptr) | |
Constructor taking an explicit pricingDate and paymentDate . More... | |
CommodityIndexedCashFlow (QuantLib::Real quantity, const QuantLib::Date &startDate, const QuantLib::Date &endDate, const ext::shared_ptr< CommodityIndex > &index, QuantLib::Natural paymentLag, const QuantLib::Calendar &paymentCalendar, QuantLib::BusinessDayConvention paymentConvention, QuantLib::Natural pricingLag, const QuantLib::Calendar &pricingLagCalendar, QuantLib::Real spread=0.0, QuantLib::Real gearing=1.0, PaymentTiming paymentTiming=PaymentTiming::InArrears, bool isInArrears=true, bool useFuturePrice=false, bool useFutureExpiryDate=true, QuantLib::Natural futureMonthOffset=0, const ext::shared_ptr< FutureExpiryCalculator > &calc=nullptr, const QuantLib::Date &paymentDateOverride=Date(), const QuantLib::Date &pricingDateOverride=Date(), QuantLib::Natural dailyExpiryOffset=QuantLib::Null< QuantLib::Natural >(), const ext::shared_ptr< FxIndex > &fxIndex=nullptr, const bool spotAveragingFrontCoupon=false, const QuantLib::Calendar &pricingCalendar=QuantLib::Calendar(), bool includeEndDate=true, bool excludeStartDate=true) | |
Inspectors | |
const QuantLib::Date & | pricingDate () const |
bool | useFutureExpiryDate () const |
QuantLib::Natural | futureMonthOffset () const |
QuantLib::Real | periodQuantity () const override |
QuantLib::Natural | dailyExpiryOffset () const |
CommodityCashFlow interface | |
const std::vector< std::pair< QuantLib::Date, ext::shared_ptr< CommodityIndex > > > & | indices () const override |
Return a map of pricing date and corresponding commodity index. More... | |
const ext::shared_ptr< CommodityIndex > & | spotIndex () const |
const std::set< QuantLib::Date > & | spotAveragingPricingDates () const |
bool | isAveragingFrontMonthCashflow (const QuantLib::Date &asof) const |
QuantLib::Date | lastPricingDate () const override |
QuantLib::Real | fixing () const override |
Event interface | |
QuantLib::Date | date () const override |
CashFlow interface | |
QuantLib::Real | amount () const override |
Public Member Functions inherited from CommodityCashFlow | |
CommodityCashFlow (QuantLib::Real quantity, QuantLib::Real spread, QuantLib::Real gearing, bool useFuturePrice, const ext::shared_ptr< CommodityIndex > &index, const ext::shared_ptr< FxIndex > &fxIndex) | |
QuantLib::Real | quantity () const |
QuantLib::Real | spread () const |
QuantLib::Real | gearing () const |
bool | useFuturePrice () const |
ext::shared_ptr< CommodityIndex > | index () const |
ext::shared_ptr< FxIndex > | fxIndex () const |
virtual const std::vector< std::pair< QuantLib::Date, ext::shared_ptr< CommodityIndex > > > & | indices () const =0 |
Return a map of pricing date and corresponding commodity index. More... | |
virtual QuantLib::Date | lastPricingDate () const =0 |
virtual QuantLib::Real | periodQuantity () const =0 |
virtual QuantLib::Real | fixing () const =0 |
void | accept (QuantLib::AcyclicVisitor &v) override |
Visitability | |
QuantLib::Date | pricingDate_ |
QuantLib::Date | paymentDate_ |
bool | useFutureExpiryDate_ |
QuantLib::Natural | futureMonthOffset_ |
QuantLib::Real | periodQuantity_ |
QuantLib::Natural | dailyExpiryOffset_ |
std::vector< std::pair< QuantLib::Date, ext::shared_ptr< CommodityIndex > > > | indices_ |
bool | isAveraging_ |
std::set< QuantLib::Date > | spotAveragingPricingDates_ |
ext::shared_ptr< CommodityIndex > | spotIndex_ |
QuantLib::Real | price_ |
void | accept (QuantLib::AcyclicVisitor &v) override |
void | setPeriodQuantity (QuantLib::Real periodQuantity) |
Allow the full calculation period quantity to be updated. More... | |
void | performCalculations () const override |
void | init (const ext::shared_ptr< FutureExpiryCalculator > &calc, const QuantLib::Date &contractDate=QuantLib::Date(), const PaymentTiming paymentTiming=PaymentTiming::InArrears, const QuantLib::Date &startDate=QuantLib::Date(), const QuantLib::Date &endDate=QuantLib::Date(), const QuantLib::Natural paymentLag=0, const QuantLib::BusinessDayConvention paymentConvention=QuantLib::Unadjusted, const QuantLib::Calendar &paymentCalendar=QuantLib::NullCalendar(), const QuantLib::Calendar &pricingCalendar=QuantLib::Calendar(), bool includeEndDate=true, bool excludeStartDate=true) |
Shared initialisation. More... | |
Additional Inherited Members | |
Protected Attributes inherited from CommodityCashFlow | |
QuantLib::Real | quantity_ |
QuantLib::Real | spread_ |
QuantLib::Real | gearing_ |
bool | useFuturePrice_ |
ext::shared_ptr< CommodityIndex > | index_ |
ext::shared_ptr< FxIndex > | fxIndex_ |
QuantLib::Real | amount_ |
Cash flow dependent on a single commodity spot price or futures settlement price on a given pricing date.
Definition at line 37 of file commodityindexedcashflow.hpp.
|
strong |
Enumerator | |
---|---|
InAdvance | |
InArrears | |
RelativeToExpiry |
Definition at line 40 of file commodityindexedcashflow.hpp.
CommodityIndexedCashFlow | ( | QuantLib::Real | quantity, |
const QuantLib::Date & | pricingDate, | ||
const QuantLib::Date & | paymentDate, | ||
const ext::shared_ptr< CommodityIndex > & | index, | ||
QuantLib::Real | spread = 0.0 , |
||
QuantLib::Real | gearing = 1.0 , |
||
bool | useFuturePrice = false , |
||
const Date & | contractDate = Date() , |
||
const ext::shared_ptr< FutureExpiryCalculator > & | calc = nullptr , |
||
QuantLib::Natural | dailyExpiryOffset = QuantLib::Null< QuantLib::Natural >() , |
||
const ext::shared_ptr< FxIndex > & | fxIndex = nullptr |
||
) |
Constructor taking an explicit pricingDate
and paymentDate
.
CommodityIndexedCashFlow | ( | QuantLib::Real | quantity, |
const QuantLib::Date & | startDate, | ||
const QuantLib::Date & | endDate, | ||
const ext::shared_ptr< CommodityIndex > & | index, | ||
QuantLib::Natural | paymentLag, | ||
const QuantLib::Calendar & | paymentCalendar, | ||
QuantLib::BusinessDayConvention | paymentConvention, | ||
QuantLib::Natural | pricingLag, | ||
const QuantLib::Calendar & | pricingLagCalendar, | ||
QuantLib::Real | spread = 0.0 , |
||
QuantLib::Real | gearing = 1.0 , |
||
PaymentTiming | paymentTiming = PaymentTiming::InArrears , |
||
bool | isInArrears = true , |
||
bool | useFuturePrice = false , |
||
bool | useFutureExpiryDate = true , |
||
QuantLib::Natural | futureMonthOffset = 0 , |
||
const ext::shared_ptr< FutureExpiryCalculator > & | calc = nullptr , |
||
const QuantLib::Date & | paymentDateOverride = Date() , |
||
const QuantLib::Date & | pricingDateOverride = Date() , |
||
QuantLib::Natural | dailyExpiryOffset = QuantLib::Null< QuantLib::Natural >() , |
||
const ext::shared_ptr< FxIndex > & | fxIndex = nullptr , |
||
const bool | spotAveragingFrontCoupon = false , |
||
const QuantLib::Calendar & | pricingCalendar = QuantLib::Calendar() , |
||
bool | includeEndDate = true , |
||
bool | excludeStartDate = true |
||
) |
Constructor taking a period startDate
, endDate
and some conventions. The pricing date and payment date are derived from the start date and end date using the conventions.
const QuantLib::Date & pricingDate | ( | ) | const |
Definition at line 75 of file commodityindexedcashflow.hpp.
bool useFutureExpiryDate | ( | ) | const |
Definition at line 76 of file commodityindexedcashflow.hpp.
QuantLib::Natural futureMonthOffset | ( | ) | const |
Definition at line 77 of file commodityindexedcashflow.hpp.
|
overridevirtual |
Implements CommodityCashFlow.
Definition at line 78 of file commodityindexedcashflow.hpp.
QuantLib::Natural dailyExpiryOffset | ( | ) | const |
Definition at line 79 of file commodityindexedcashflow.hpp.
|
overridevirtual |
Return a map of pricing date and corresponding commodity index.
Implements CommodityCashFlow.
Definition at line 84 of file commodityindexedcashflow.hpp.
const ext::shared_ptr< CommodityIndex > & spotIndex | ( | ) | const |
Definition at line 87 of file commodityindexedcashflow.hpp.
const std::set< QuantLib::Date > & spotAveragingPricingDates | ( | ) | const |
Definition at line 89 of file commodityindexedcashflow.hpp.
bool isAveragingFrontMonthCashflow | ( | const QuantLib::Date & | asof | ) | const |
Definition at line 110 of file commodityindexedcashflow.cpp.
|
overridevirtual |
Implements CommodityCashFlow.
Definition at line 94 of file commodityindexedcashflow.hpp.
|
overridevirtual |
Implements CommodityCashFlow.
Definition at line 105 of file commodityindexedcashflow.cpp.
|
override |
Definition at line 101 of file commodityindexedcashflow.hpp.
|
override |
Definition at line 100 of file commodityindexedcashflow.cpp.
|
override |
Definition at line 115 of file commodityindexedcashflow.cpp.
void setPeriodQuantity | ( | QuantLib::Real | periodQuantity | ) |
Allow the full calculation period quantity to be updated.
Definition at line 122 of file commodityindexedcashflow.cpp.
|
overrideprivate |
Definition at line 80 of file commodityindexedcashflow.cpp.
|
private |
Shared initialisation.
Definition at line 124 of file commodityindexedcashflow.cpp.
|
private |
Definition at line 120 of file commodityindexedcashflow.hpp.
|
private |
Definition at line 121 of file commodityindexedcashflow.hpp.
|
private |
Definition at line 122 of file commodityindexedcashflow.hpp.
|
private |
Definition at line 123 of file commodityindexedcashflow.hpp.
|
private |
Definition at line 124 of file commodityindexedcashflow.hpp.
|
private |
Definition at line 125 of file commodityindexedcashflow.hpp.
|
private |
Definition at line 126 of file commodityindexedcashflow.hpp.
|
private |
Definition at line 129 of file commodityindexedcashflow.hpp.
|
private |
Definition at line 130 of file commodityindexedcashflow.hpp.
|
private |
Definition at line 131 of file commodityindexedcashflow.hpp.
|
mutableprivate |
Definition at line 132 of file commodityindexedcashflow.hpp.