Base class for classes that perform date calculations for future contracts. More...
#include <qle/time/futureexpirycalculator.hpp>
Public Member Functions | |
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 |
Base class for classes that perform date calculations for future contracts.
Definition at line 32 of file futureexpirycalculator.hpp.
|
virtual |
Definition at line 34 of file futureexpirycalculator.hpp.
|
pure virtual |
Given a reference date, referenceDate
, return the expiry date of the next futures contract relative to the reference date.
The includeExpiry
parameter controls what happens when the referenceDate
is equal to the next contract's expiry date. If includeExpiry
is true
, the contract's expiry date is returned. If includeExpiry
is false
, the next succeeding contract's expiry is returned.
If forOption
is true
, the next expiry for the option contract, as opposed to the future contract, is returned.
|
pure virtual |
Given a reference date, referenceDate
, return the expiry date of the first futures contract prior to the reference date.
The includeExpiry
parameter controls what happens when the referenceDate
is equal to the prior contract's expiry date. If includeExpiry
is true
, the contract's expiry date is returned. If includeExpiry
is false
, the next preceding contract's expiry is returned.
If forOption
is true
, the prior expiry for the option contract, as opposed to the future contract, is returned.
|
pure virtual |
Given a date, contractDate
, return the future expiry date associated with that date.
If the future contract has a frequency that is less than monthly, the next available future contract expiry date will be returned. If forOption
is true
, the next available future option expiry is returned. For future contracts that have a frequency that is less than monthly, the monthOffset
parameter is ignored.
If the future contract has a frequency that is monthly or greater, the contract's month and year is taken to be the contractDate
month and year, and the expiry date of the future contract that is monthOffset
number of months from that month's future contract is returned. If monthOffset
is zero, the expiry date of the future contract associated with that month and year is returned. If forOption
is true
, the expiry date for the option contract, as opposed to the future contract, is returned.
|
pure virtual |
Given a futures (not option) expiry date, return a corresponding contract date
|
pure virtual |
apply a month offset to a given contract date and return the new contract date if the contract frequency is daily or weekly, the input contract date is not modified