Logo
Reference manual - version qle_version
Classes | Enumerations | Functions
commoditycashflow.hpp File Reference

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...
 

Detailed Description

Some data and logic shared among commodity cashflows.

Function Documentation

◆ pricingDates()

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.

Parameters
startThe start date of the period.
endThe end date of the period.
pricingCalendarThe pricing calendar used to determine valid dates
excludeStartSet 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.
includeEndset 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.
useBusinessDaysSet 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.
Returns
The set of valid pricing dates in the period.

◆ isPricingDate()

bool QuantExt::isPricingDate ( const QuantLib::Date &  d,
const QuantLib::Calendar &  pricingCalendar,
bool  useBusinessDays = true 
)

Check if a date is a pricing date.

Parameters
dThe date that we wish to check.
pricingCalendarThe pricing calendar used to determine valid dates
useBusinessDaysSet 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.
Returns
Returns true if d is a pricing date and false otherwise.