Skip to content

Commit c358db5

Browse files
pcaspersjenkins
authored andcommitted
QPR-12328 fix close out to val date map for period 0D
1 parent 379861a commit c358db5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

OREData/ored/utilities/dategrid.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ void DateGrid::truncate(Size len) {
205205
}
206206

207207
void DateGrid::addCloseOutDates(const QuantLib::Period& p) {
208+
closeOutToValuation_.clear();
208209
if (p == QuantLib::Period(0, QuantLib::Days)) {
209210
for (Size i = 0; i < dates_.size(); ++i) {
210211
if (i == 0) {
@@ -217,6 +218,8 @@ void DateGrid::addCloseOutDates(const QuantLib::Period& p) {
217218
isCloseOutDate_[i] = true;
218219
isValuationDate_[i] = true;
219220
}
221+
if (isCloseOutDate_[i] && i > 0)
222+
closeOutToValuation_[dates_[i]] = dates_[i - 1];
220223
}
221224
} else {
222225
std::set<QuantLib::Date> tmpDates;

0 commit comments

Comments
 (0)