diff --git a/OREData/ored/marketdata/yieldcurve.cpp b/OREData/ored/marketdata/yieldcurve.cpp index c3927f94e3..16a00704dd 100644 --- a/OREData/ored/marketdata/yieldcurve.cpp +++ b/OREData/ored/marketdata/yieldcurve.cpp @@ -1118,7 +1118,7 @@ void YieldCurve::buildDiscountCurve() { marketData = loader_.get(*wildcard, asofDate_); } else { std::ostringstream ss; - ss << MarketDatum::InstrumentType::DISCOUNT << "/" << MarketDatum::QuoteType::RATE << "/" << currency_ << "/*"; + ss << MarketDatum::InstrumentType::DISCOUNT << "/" << MarketDatum::QuoteType::RATE << "/" << currency_ << "/" << curveConfig_->curveID() << "/*"; Wildcard w(ss.str()); marketData = loader_.get(w, asofDate_); } diff --git a/OREData/ored/portfolio/legdata.cpp b/OREData/ored/portfolio/legdata.cpp index 337ced2ed9..704323512d 100644 --- a/OREData/ored/portfolio/legdata.cpp +++ b/OREData/ored/portfolio/legdata.cpp @@ -764,7 +764,7 @@ void LegData::fromXML(XMLNode* node) { dayCounter_ = XMLUtils::getChildValue(node, "DayCounter"); // optional paymentConvention_ = XMLUtils::getChildValue(node, "PaymentConvention"); paymentLag_ = XMLUtils::getChildValue(node, "PaymentLag"); - notionalPaymentLag_ = XMLUtils::getChildValue(node, "NotionalPaymentLag"); + notionalPaymentLag_ = XMLUtils::getChildValue(node, "NotionalPaymentLag", false, paymentLag_); paymentCalendar_ = XMLUtils::getChildValue(node, "PaymentCalendar", false); // if not given, default of getChildValueAsBool is true, which fits our needs here notionals_ = XMLUtils::getChildrenValuesWithAttributes(node, "Notionals", "Notional", "startDate", @@ -813,6 +813,15 @@ void LegData::fromXML(XMLNode* node) { if (auto tmp = XMLUtils::getChildNode(node, "ScheduleData")) schedule_.fromXML(tmp); + // set payment calendar equal to the schedule calendar if the payment calendar not given + // otherwise the payment calendar is not set and payments of notional can happen before the interest payments + if (paymentCalendar_.empty() && !schedule_.rules().empty()) { + auto tmp = schedule_.rules().front().calendar(); + if (!tmp.empty()) { + paymentCalendar_ = tmp; + } + } + paymentDates_ = XMLUtils::getChildrenValues(node, "PaymentDates", "PaymentDate", false); if (!paymentDates_.empty()) { WLOG("Usage of PaymentDates is deprecated, use PaymentSchedule instead.");