Some data and logic shared among commodity cashflows. More...
#include <ql/cashflow.hpp>
#include <ql/patterns/visitor.hpp>
#include <ql/patterns/lazyobject.hpp>
#include <ql/time/calendar.hpp>
#include <ql/time/date.hpp>
#include <qle/indexes/commodityindex.hpp>
#include <qle/indexes/fxindex.hpp>
#include <set>
Classes | |
class | CommodityCashFlow |
Enumerations | |
enum class | CommodityQuantityFrequency { PerCalculationPeriod , PerCalendarDay , PerPricingDay , PerHour , PerHourAndCalendarDay } |
Enumeration indicating the frequency associated with a commodity quantity. | |
Functions | |
std::set< QuantLib::Date > | pricingDates (const QuantLib::Date &start, const QuantLib::Date &end, const QuantLib::Calendar &pricingCalendar, bool excludeStart, bool includeEnd, bool useBusinessDays=true) |
Get the set of valid pricing dates in a period. More... | |
bool | isPricingDate (const QuantLib::Date &d, const QuantLib::Calendar &pricingCalendar, bool useBusinessDays=true) |
Check if a date is a pricing date. More... | |
Some data and logic shared among commodity cashflows.
std::set<QuantLib::Date> QuantExt::pricingDates | ( | const QuantLib::Date & | start, |
const QuantLib::Date & | end, | ||
const QuantLib::Calendar & | pricingCalendar, | ||
bool | excludeStart, | ||
bool | includeEnd, | ||
bool | useBusinessDays = true |
||
) |
Get the set of valid pricing dates in a period.
start | The start date of the period. |
end | The end date of the period. |
pricingCalendar | The pricing calendar used to determine valid dates |
excludeStart | Set to true if the start date should be excluded from the set of pricing dates and to false if the start date should be included. |
includeEnd | set to true if the end date should be included in the set of pricing dates and to false if the end date should be excluded. |
useBusinessDays | Set to true if pricingCalendar business dates are to be considered valid pricing dates and false if pricingCalendar holidays are to be considered valid pricing dates. The latter case is unusual but is useful for some electricity futures e.g. ICE PW2 contract which averages over weekends and non-NERC business days. |
bool QuantExt::isPricingDate | ( | const QuantLib::Date & | d, |
const QuantLib::Calendar & | pricingCalendar, | ||
bool | useBusinessDays = true |
||
) |
Check if a date is a pricing date.
d | The date that we wish to check. |
pricingCalendar | The pricing calendar used to determine valid dates |
useBusinessDays | Set to true if pricingCalendar business dates are to be considered valid pricing dates and false if pricingCalendar holidays are to be considered valid pricing dates. The latter case is unusual but is useful for some electricity futures e.g. ICE PW2 contract which averages over weekends and non-NERC business days. |
true
if d
is a pricing date and false
otherwise.