Simulation Date Grid. More...
#include <ored/utilities/dategrid.hpp>
Public Member Functions | |
DateGrid () | |
Build a date grid with a single date equal to Settings::instance().evaluationDate() More... | |
DateGrid (const std::string &grid, const QuantLib::Calendar &gridCalendar=QuantLib::TARGET(), const QuantLib::DayCounter &dayCounter=QuantLib::ActualActual(QuantLib::ActualActual::ISDA)) | |
DateGrid (const std::vector< QuantLib::Period > &tenors, const QuantLib::Calendar &gridCalendar=QuantLib::TARGET(), const QuantLib::DayCounter &dayCounter=QuantLib::ActualActual(QuantLib::ActualActual::ISDA)) | |
Build a date grid from the given vector of tenors. More... | |
DateGrid (const std::vector< QuantLib::Date > &dates, const QuantLib::Calendar &gridCalendar=QuantLib::TARGET(), const QuantLib::DayCounter &dayCounter=QuantLib::ActualActual(QuantLib::ActualActual::ISDA)) | |
Build a date grid from an explicit set of dates, sorted in ascending order. More... | |
QuantLib::Size | size () const |
The size of the date grid. More... | |
void | truncate (const QuantLib::Date &d, bool overrun=true) |
Truncate the grid up to the given date. More... | |
void | truncate (QuantLib::Size length) |
Truncate the grid to the given length. More... | |
void | addCloseOutDates (const QuantLib::Period &p=QuantLib::Period(2, QuantLib::Weeks)) |
Inspectors | |
QuantLib::Calendar | calendar_ |
QuantLib::DayCounter | dayCounter_ |
std::vector< QuantLib::Date > | dates_ |
std::map< QuantLib::Date, QuantLib::Date > | valuationCloseOutMap_ |
std::vector< QuantLib::Period > | tenors_ |
std::vector< QuantLib::Time > | times_ |
QuantLib::TimeGrid | timeGrid_ |
std::vector< bool > | isValuationDate_ |
std::vector< bool > | isCloseOutDate_ |
const std::vector< QuantLib::Period > & | tenors () const |
const std::vector< QuantLib::Date > & | dates () const |
const std::vector< bool > & | isValuationDate () const |
const std::vector< bool > & | isCloseOutDate () const |
std::vector< QuantLib::Date > | valuationDates () const |
std::vector< QuantLib::Date > | closeOutDates () const |
const QuantLib::Calendar & | calendar () const |
const QuantLib::DayCounter & | dayCounter () const |
const std::vector< QuantLib::Time > & | times () const |
Returns the times from Settings::instance().evaluationDate to each Date using the day counter. More... | |
const QuantLib::TimeGrid & | timeGrid () const |
Returns the time grid associated with the vector of times (plus t=0) More... | |
QuantLib::TimeGrid | valuationTimeGrid () const |
Returns the time grid associated with the vector of valuation times (plus t=0) More... | |
QuantLib::TimeGrid | closeOutTimeGrid () const |
Returns the time grid associated with the vector of close-out times (plus t=0) More... | |
QuantLib::Date | closeOutDateFromValuationDate (const QuantLib::Date &d) const |
const QuantLib::Date & | operator[] (QuantLib::Size i) const |
Accessor methods. More... | |
void | buildDates (const QuantLib::Calendar &cal, const QuantLib::DayCounter &dc) |
void | log () |
Simulation Date Grid.
Utility for building a simulation date grid.
Definition at line 38 of file dategrid.hpp.
DateGrid | ( | ) |
Build a date grid with a single date equal to Settings::instance().evaluationDate()
Definition at line 32 of file dategrid.cpp.
DateGrid | ( | const std::string & | grid, |
const QuantLib::Calendar & | gridCalendar = QuantLib::TARGET() , |
||
const QuantLib::DayCounter & | dayCounter = QuantLib::ActualActual(QuantLib::ActualActual::ISDA) |
||
) |
Build a date grid from a string which can be of the form 40,1M or 1D,2D,1W,2W,3Y,5Y or a fixed name (ALPHA, BETA) indicating a hard coded grid structure
Definition at line 36 of file dategrid.cpp.
DateGrid | ( | const std::vector< QuantLib::Period > & | tenors, |
const QuantLib::Calendar & | gridCalendar = QuantLib::TARGET() , |
||
const QuantLib::DayCounter & | dayCounter = QuantLib::ActualActual(QuantLib::ActualActual::ISDA) |
||
) |
Build a date grid from the given vector of tenors.
DateGrid | ( | const std::vector< QuantLib::Date > & | dates, |
const QuantLib::Calendar & | gridCalendar = QuantLib::TARGET() , |
||
const QuantLib::DayCounter & | dayCounter = QuantLib::ActualActual(QuantLib::ActualActual::ISDA) |
||
) |
Build a date grid from an explicit set of dates, sorted in ascending order.
QuantLib::Size size | ( | ) | const |
The size of the date grid.
Definition at line 58 of file dategrid.hpp.
void truncate | ( | const QuantLib::Date & | d, |
bool | overrun = true |
||
) |
Truncate the grid up to the given date.
If overrun is true, we make sure the last date in the grid is greater than the portfolio maturity, even though every scenario portfolio NPV will be 0 at this point we may need the market data. If overrun is false, the last date in the grid is the last date where the portfolio is live.
void truncate | ( | QuantLib::Size | length | ) |
Truncate the grid to the given length.
void addCloseOutDates | ( | const QuantLib::Period & | p = QuantLib::Period(2, QuantLib::Weeks) | ) |
Add close out dates. If 0D is given, the valuation dates itself are treated as close out dates. The first date is a valuation date only and the last date is a close out date only then, all other dates are both valuation and close out dates.
Definition at line 207 of file dategrid.cpp.
const std::vector< QuantLib::Period > & tenors | ( | ) | const |
Definition at line 80 of file dategrid.hpp.
const std::vector< QuantLib::Date > & dates | ( | ) | const |
const std::vector< bool > & isValuationDate | ( | ) | const |
Definition at line 82 of file dategrid.hpp.
const std::vector< bool > & isCloseOutDate | ( | ) | const |
Definition at line 83 of file dategrid.hpp.
std::vector< QuantLib::Date > valuationDates | ( | ) | const |
Definition at line 266 of file dategrid.cpp.
std::vector< QuantLib::Date > closeOutDates | ( | ) | const |
Definition at line 275 of file dategrid.cpp.
const QuantLib::Calendar & calendar | ( | ) | const |
Definition at line 86 of file dategrid.hpp.
const QuantLib::DayCounter & dayCounter | ( | ) | const |
const std::vector< QuantLib::Time > & times | ( | ) | const |
Returns the times from Settings::instance().evaluationDate to each Date using the day counter.
Definition at line 90 of file dategrid.hpp.
const QuantLib::TimeGrid & timeGrid | ( | ) | const |
Returns the time grid associated with the vector of times (plus t=0)
Definition at line 93 of file dategrid.hpp.
QuantLib::TimeGrid valuationTimeGrid | ( | ) | const |
Returns the time grid associated with the vector of valuation times (plus t=0)
Definition at line 284 of file dategrid.cpp.
QuantLib::TimeGrid closeOutTimeGrid | ( | ) | const |
Returns the time grid associated with the vector of close-out times (plus t=0)
Definition at line 294 of file dategrid.cpp.
QuantLib::Date closeOutDateFromValuationDate | ( | const QuantLib::Date & | d | ) | const |
Definition at line 304 of file dategrid.cpp.
const QuantLib::Date & operator[] | ( | QuantLib::Size | i | ) | const |
|
private |
Definition at line 139 of file dategrid.cpp.
|
private |
Definition at line 172 of file dategrid.cpp.
|
private |
Definition at line 114 of file dategrid.hpp.
|
private |
Definition at line 115 of file dategrid.hpp.
|
private |
Definition at line 116 of file dategrid.hpp.
|
private |
Definition at line 117 of file dategrid.hpp.
|
private |
Definition at line 118 of file dategrid.hpp.
|
private |
Definition at line 119 of file dategrid.hpp.
|
private |
Definition at line 120 of file dategrid.hpp.
|
private |
Definition at line 121 of file dategrid.hpp.
|
private |
Definition at line 121 of file dategrid.hpp.