@@ -619,7 +619,10 @@ CapFloorVolCurve::capSurface(const Date& asof, CapFloorVolatilityCurveConfig& co
619619 vector<Period> configTenors = parseVectorOfValues<Period>(config.tenors (), &parsePeriod);
620620
621621 std::ostringstream ss;
622- ss << MarketDatum::InstrumentType::CAPFLOOR << " /" << config.quoteType () << " /" << currency << " /*" ;
622+ ss << MarketDatum::InstrumentType::CAPFLOOR << " /" << config.quoteType () << " /" << currency << " /" ;
623+ if (config.quoteIncludesIndexName ())
624+ ss << config.index () << " /" ;
625+ ss << " *" ;
623626 Wildcard w (ss.str ());
624627 for (const auto & md : loader.get (w, asof)) {
625628 QL_REQUIRE (md->asofDate () == asof, " MarketDatum asofDate '" << md->asofDate () << " ' <> asof '" << asof << " '" );
@@ -650,8 +653,12 @@ CapFloorVolCurve::capSurface(const Date& asof, CapFloorVolatilityCurveConfig& co
650653 }
651654 auto key = make_pair (cfq->term (), cfq->strike ());
652655 auto r = volQuotes.insert (make_pair (key, cfq->quote ()->value ()));
653- QL_REQUIRE (r.second , " Duplicate cap floor quote in config " << config.curveID () << " , with underlying tenor " << tenor <<
654- " and currency " << currency << " , for tenor " << key.first << " and strike " << key.second );
656+ if (config.quoteIncludesIndexName ())
657+ QL_REQUIRE (r.second , " Duplicate cap floor quote in config " << config.curveID () << " , with underlying tenor " << tenor <<
658+ " ,currency " << currency << " and index " << config.index () << " , for tenor " << key.first << " and strike " << key.second );
659+ else
660+ QL_REQUIRE (r.second , " Duplicate cap floor quote in config " << config.curveID () << " , with underlying tenor " << tenor <<
661+ " and currency " << currency << " , for tenor " << key.first << " and strike " << key.second );
655662 }
656663 }
657664 }
0 commit comments