Perform date calculations for future contracts based on conventions. More...
#include <ored/utilities/conventionsbasedfutureexpiry.hpp>
Public Member Functions | |
ConventionsBasedFutureExpiry (const std::string &commName, QuantLib::Size maxIterations=10) | |
ConventionsBasedFutureExpiry (const CommodityFutureConvention &convention, QuantLib::Size maxIterations=10) | |
QuantLib::Date | nextExpiry (bool includeExpiry=true, const QuantLib::Date &referenceDate=QuantLib::Date(), QuantLib::Natural offset=0, bool forOption=false) override |
QuantLib::Date | priorExpiry (bool includeExpiry=true, const QuantLib::Date &referenceDate=QuantLib::Date(), bool forOption=false) override |
QuantLib::Date | expiryDate (const QuantLib::Date &contractDate, QuantLib::Natural monthOffset=0, bool forOption=false) override |
QuantLib::Date | contractDate (const QuantLib::Date &expiryDate) override |
QuantLib::Date | applyFutureMonthOffset (const QuantLib::Date &contractDate, Natural futureMonthOffset) override |
Public Member Functions inherited from FutureExpiryCalculator | |
virtual | ~FutureExpiryCalculator () |
virtual QuantLib::Date | nextExpiry (bool includeExpiry=true, const QuantLib::Date &referenceDate=QuantLib::Date(), QuantLib::Natural offset=0, bool forOption=false)=0 |
virtual QuantLib::Date | priorExpiry (bool includeExpiry=true, const QuantLib::Date &referenceDate=QuantLib::Date(), bool forOption=false)=0 |
virtual QuantLib::Date | expiryDate (const QuantLib::Date &contractDate, QuantLib::Natural monthOffset=0, bool forOption=false)=0 |
virtual QuantLib::Date | contractDate (const QuantLib::Date &expiryDate)=0 |
virtual QuantLib::Date | applyFutureMonthOffset (const QuantLib::Date &contractDate, Natural futureMonthOffset)=0 |
Inspectors | |
CommodityFutureConvention | convention_ |
QuantLib::Size | maxIterations_ |
const CommodityFutureConvention & | commodityFutureConvention () const |
Return the commodity future convention. More... | |
QuantLib::Size | maxIterations () const |
Return the maximum iterations parameter. More... | |
QuantLib::Date | expiry (QuantLib::Day dayOfMonth, QuantLib::Month contractMonth, QuantLib::Year contractYear, QuantLib::Natural monthOffset, bool forOption) const |
Given a contractMonth , a contractYear and conventions , calculate the contract expiry date. More... | |
QuantLib::Date | nextExpiry (const QuantLib::Date &referenceDate, bool forOption) const |
Do the next expiry work. More... | |
QuantLib::Date | avoidProhibited (const QuantLib::Date &expiry, bool forOption) const |
Account for prohibited expiries. More... | |
Perform date calculations for future contracts based on conventions.
Definition at line 33 of file conventionsbasedfutureexpiry.hpp.
ConventionsBasedFutureExpiry | ( | const std::string & | commName, |
QuantLib::Size | maxIterations = 10 |
||
) |
ConventionsBasedFutureExpiry | ( | const CommodityFutureConvention & | convention, |
QuantLib::Size | maxIterations = 10 |
||
) |
Definition at line 38 of file conventionsbasedfutureexpiry.cpp.
|
overridevirtual |
Implements FutureExpiryCalculator.
Definition at line 65 of file conventionsbasedfutureexpiry.cpp.
|
overridevirtual |
Implements FutureExpiryCalculator.
Definition at line 95 of file conventionsbasedfutureexpiry.cpp.
|
overridevirtual |
Implements FutureExpiryCalculator.
Definition at line 103 of file conventionsbasedfutureexpiry.cpp.
|
overridevirtual |
Implements FutureExpiryCalculator.
Definition at line 135 of file conventionsbasedfutureexpiry.cpp.
const CommodityFutureConvention & commodityFutureConvention | ( | ) | const |
Return the commodity future convention.
Definition at line 308 of file conventionsbasedfutureexpiry.cpp.
Size maxIterations | ( | ) | const |
Return the maximum iterations parameter.
Definition at line 310 of file conventionsbasedfutureexpiry.cpp.
|
private |
Given a contractMonth
, a contractYear
and conventions
, calculate the contract expiry date.
Definition at line 147 of file conventionsbasedfutureexpiry.cpp.
|
private |
Do the next expiry work.
|
private |
Account for prohibited expiries.
Definition at line 312 of file conventionsbasedfutureexpiry.cpp.
|
private |
Definition at line 61 of file conventionsbasedfutureexpiry.hpp.
|
private |
Definition at line 62 of file conventionsbasedfutureexpiry.hpp.