Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
commodity.cpp
Go to the documentation of this file.
2
3namespace QuantExt {
4
5//! Make a commodity indexed cashflow
6QuantLib::ext::shared_ptr<CashFlow>
7makeCommodityCashflowForBasisFuture(const QuantLib::Date& start, const QuantLib::Date& end,
8 const QuantLib::ext::shared_ptr<CommodityIndex>& baseIndex,
9 const QuantLib::ext::shared_ptr<FutureExpiryCalculator>& baseFec, bool baseIsAveraging,
10 const QuantLib::Date& paymentDate) {
11 if (baseIsAveraging == true) {
12 return QuantLib::ext::make_shared<CommodityIndexedAverageCashFlow>(
13 1.0, start, end, paymentDate, baseIndex, QuantLib::Calendar(), 0.0, 1.0, true, 0, 0, baseFec);
14 } else {
15 return QuantLib::ext::make_shared<CommodityIndexedCashFlow>(
16 1.0, start, end, baseIndex, 0, QuantLib::NullCalendar(), QuantLib::Unadjusted, 0,
17 QuantLib::NullCalendar(), 0.0, 1.0, CommodityIndexedCashFlow::PaymentTiming::InArrears, true, true, true, 0,
18 baseFec, paymentDate);
19 }
20}
21
22} // namespace QuantExt
some commodity related utilities.
QuantLib::ext::shared_ptr< CashFlow > makeCommodityCashflowForBasisFuture(const QuantLib::Date &start, const QuantLib::Date &end, const QuantLib::ext::shared_ptr< CommodityIndex > &baseIndex, const QuantLib::ext::shared_ptr< FutureExpiryCalculator > &baseFec, bool baseIsAveraging, const QuantLib::Date &paymentDate)
Make a commodity indexed cashflow.
Definition: commodity.cpp:7