23#ifndef quantext_commodity_cash_flow_hpp
24#define quantext_commodity_cash_flow_hpp
26#include <ql/cashflow.hpp>
27#include <ql/patterns/visitor.hpp>
28#include <ql/patterns/lazyobject.hpp>
29#include <ql/time/calendar.hpp>
30#include <ql/time/date.hpp>
63std::set<QuantLib::Date>
pricingDates(
const QuantLib::Date& start,
const QuantLib::Date& end,
64 const QuantLib::Calendar& pricingCalendar,
bool excludeStart,
bool includeEnd,
65 bool useBusinessDays =
true);
78bool isPricingDate(
const QuantLib::Date& d,
const QuantLib::Calendar& pricingCalendar,
bool useBusinessDays =
true);
83 const ext::shared_ptr<CommodityIndex>&
index,
const ext::shared_ptr<FxIndex>&
fxIndex);
89 ext::shared_ptr<CommodityIndex>
index()
const {
return index_; };
92 virtual const std::vector<std::pair<QuantLib::Date, ext::shared_ptr<CommodityIndex>>>&
indices()
const = 0;
96 virtual QuantLib::Real
fixing()
const = 0;
100 void accept(QuantLib::AcyclicVisitor& v)
override;
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.
QuantLib::Real spread() const
bool useFuturePrice() const
void accept(QuantLib::AcyclicVisitor &v) override
ext::shared_ptr< FxIndex > fxIndex() const
virtual QuantLib::Real periodQuantity() const =0
ext::shared_ptr< FxIndex > fxIndex_
QuantLib::Real gearing() const
virtual QuantLib::Date lastPricingDate() const =0
ext::shared_ptr< CommodityIndex > index_
ext::shared_ptr< CommodityIndex > index() const
QuantLib::Real quantity() const
virtual QuantLib::Real fixing() const =0
commodity index class for holding commodity spot and futures price histories and forwarding.
CommodityQuantityFrequency
Enumeration indicating the frequency associated with a commodity quantity.
bool isPricingDate(const Date &d, const Calendar &pricingCalendar, bool useBusinessDays)
set< Date > pricingDates(const Date &s, const Date &e, const Calendar &pricingCalendar, bool excludeStart, bool includeEnd, bool useBusinessDays)