Create par QuantLib::Instruments.
94 {
95
96 QL_REQUIRE(typesDisabled != parTypes, "At least one par risk factor type must be enabled "
97 << "for a valid ParSensitivityAnalysis.");
98
99
100
101
102
103
104
105 bool dryRun = simMarket == nullptr;
106 if (dryRun) {
107 Settings::instance().evaluationDate() =
asof;
108 }
109
110 LOG(
"Build par instruments...");
112 auto& parCaps_ = instruments.
parCaps_;
122
123 parHelpers_.clear();
124 parCaps_.clear();
125 parYoYCaps_.clear();
126
127 const QuantLib::ext::shared_ptr<Conventions>& conventions = InstrumentConventions::instance().conventions();
128 QL_REQUIRE(conventions != nullptr, "conventions are empty");
129
130
132
133 LOG(
"ParSensitivityAnalysis: Discount curve par instruments");
135 string ccy = c.first;
136 QL_REQUIRE(simMarket || yieldCurvePillars_.find(ccy) == yieldCurvePillars_.end(),
137 "duplicate entry in yieldCurvePillars '" << ccy << "'");
139 *QuantLib::ext::dynamic_pointer_cast<SensitivityScenarioData::CurveShiftParData>(c.second);
140 LOG(
"ParSensitivityAnalysis: Discount curve ccy=" << ccy);
141 Size n_ten =
data.shiftTenors.size();
142 QL_REQUIRE(
data.parInstruments.size() == n_ten,
143 "number of tenors does not match number of discount curve par instruments, "
144 <<
data.parInstruments.size() <<
" vs. " << n_ten <<
" ccy=" << ccy
145 << ", check sensitivity configuration.");
146 for (Size j = 0; j < n_ten; ++j) {
148 if (!dryRun && !relevantRiskFactors.empty() &&
149 relevantRiskFactors.find(key) == relevantRiskFactors.end())
150 continue;
151 Period term =
data.shiftTenors[j];
152 string instType =
data.parInstruments[j];
153 bool singleCurve =
data.parInstrumentSingleCurve;
154 string indexName = "";
155 string yieldCurveName = "";
156 string equityForecastCurveName = "";
157 std::pair<QuantLib::ext::shared_ptr<Instrument>, Date> ret;
158 bool recognised = true, skipped = false;
159 try {
160 map<string, string> conventionsMap =
data.parInstrumentConventions;
161 QL_REQUIRE(conventionsMap.find(instType) != conventionsMap.end(),
162 "conventions not found for ccy " << ccy << " and instrument type " << instType);
163 QuantLib::ext::shared_ptr<Convention> convention = conventions->get(conventionsMap[instType]);
164 QL_REQUIRE(convention != nullptr, "convention is empty");
165 if (instType == "IRS")
166 ret =
makeSwap(simMarket, ccy, indexName, yieldCurveName, equityForecastCurveName, term,
167 convention, singleCurve, parHelperDependencies_[key],
169 else if (instType == "DEP")
170 ret =
makeDeposit(
asof, simMarket, ccy, indexName, yieldCurveName, equityForecastCurveName,
171 term, convention, marketConfiguration);
172 else if (instType == "FRA")
173 ret =
makeFRA(
asof, simMarket, ccy, indexName, yieldCurveName, equityForecastCurveName, term,
174 convention, marketConfiguration);
175 else if (instType == "OIS")
176 ret =
makeOIS(simMarket, ccy, indexName, yieldCurveName, equityForecastCurveName, term,
177 convention, singleCurve, parHelperDependencies_[key],
179 else if (instType == "XBS") {
180 string otherCurrency =
181 data.otherCurrency.empty() ? simMarketParams->baseCcy() :
data.otherCurrency;
184 marketConfiguration);
185 } else if (instType == "FXF")
186 ret =
makeFxForward(simMarket, simMarketParams->baseCcy(), ccy, term, convention,
187 parHelperDependencies_[key], marketConfiguration);
188 else if (instType == "TBS")
189 ret =
makeTenorBasisSwap(
asof, simMarket, ccy,
"",
"",
"",
"", term, convention, singleCurve,
191 data.discountCurve, marketConfiguration);
192 else
193 recognised = false;
194 } catch (const std::exception& e) {
195 skipped = true;
196 if (continueOnError) {
198 "Skipping par instrument for discount curve " + ccy, e.what())
200 } else {
201 QL_FAIL(e.what());
202 }
203 }
204 if (!recognised)
205 QL_FAIL("Instrument type " << instType << " for par sensitivity conversion not recognised");
206 if (!skipped) {
207 parHelpers_[key] = ret.first;
208 if (!simMarket) {
209 yieldCurvePillars_[ccy].push_back((ret.second -
asof) * Days);
210 }
211 DLOG(
"Par instrument for discount curve, ccy " << ccy <<
" tenor " << j <<
", type " << instType
212 << " built.");
213 }
214 }
215 }
216 }
217
219
220 LOG(
"ParSensitivityAnalysis: Yield curve par instruments");
221
222 QL_REQUIRE(simMarketParams->yieldCurveNames().size() == simMarketParams->yieldCurveCurrencies().size(),
223 "vector size mismatch in sim market parameters yield curve names/currencies");
225 string curveName = y.first;
226 QL_REQUIRE(simMarket || yieldCurvePillars_.find(curveName) == yieldCurvePillars_.end(),
227 "duplicate entry in yieldCurvePillars '" << curveName << "'");
228 string equityForecastCurveName = "";
229 string ccy = "";
230 for (Size j = 0; j < simMarketParams->yieldCurveNames().
size(); ++j) {
231 if (curveName == simMarketParams->yieldCurveNames()[j])
232 ccy = simMarketParams->yieldCurveCurrencies().at(curveName);
233 }
234 LOG(
"ParSensitivityAnalysis: yield curve name " << curveName);
235 QL_REQUIRE(ccy != "", "yield curve currency not found for yield curve " << curveName);
237 *QuantLib::ext::static_pointer_cast<SensitivityScenarioData::CurveShiftParData>(y.second);
238 Size n_ten =
data.shiftTenors.size();
239 QL_REQUIRE(
data.parInstruments.size() == n_ten,
240 "number of tenors does not match number of yield curve par instruments");
241 for (Size j = 0; j < n_ten; ++j) {
243 if (!dryRun && !relevantRiskFactors.empty() &&
244 relevantRiskFactors.find(key) == relevantRiskFactors.end())
245 continue;
246 Period term =
data.shiftTenors[j];
247 string instType =
data.parInstruments[j];
248 bool singleCurve =
data.parInstrumentSingleCurve;
249 std::pair<QuantLib::ext::shared_ptr<Instrument>, Date> ret;
250 bool recognised = true, skipped = false;
251 try {
252 map<string, string> conventionsMap =
data.parInstrumentConventions;
253 QL_REQUIRE(conventionsMap.find(instType) != conventionsMap.end(),
254 "conventions not found for ccy " << ccy << " and instrument type " << instType);
255 QuantLib::ext::shared_ptr<Convention> convention = conventions->get(conventionsMap[instType]);
256
257 if (instType == "IRS")
258 ret =
makeSwap(simMarket, ccy,
"", curveName, equityForecastCurveName, term, convention,
260 data.discountCurve, marketConfiguration);
261 else if (instType == "DEP")
262 ret =
makeDeposit(
asof, simMarket, ccy,
"", curveName, equityForecastCurveName, term,
263 convention, marketConfiguration);
264 else if (instType == "FRA")
265 ret =
makeFRA(
asof, simMarket, ccy,
"", curveName, equityForecastCurveName, term, convention,
266 marketConfiguration);
267 else if (instType == "OIS")
268 ret =
makeOIS(simMarket, ccy,
"", curveName, equityForecastCurveName, term, convention,
270 data.discountCurve, marketConfiguration);
271 else if (instType == "TBS")
273 singleCurve, parHelperDependencies_[key],
275 marketConfiguration);
276 else if (instType == "XBS") {
277 string otherCurrency =
278 data.otherCurrency.empty() ? simMarketParams->baseCcy() :
data.otherCurrency;
281 marketConfiguration);
282 } else
283 recognised = false;
284 } catch (const std::exception& e) {
285 skipped = true;
286 if (continueOnError) {
288 "Skipping par instrument for " + curveName, e.what())
290 } else {
291 QL_FAIL(e.what());
292 }
293 }
294 if (!recognised)
295 QL_FAIL("Instrument type " << instType << " for par sensitivity conversion unexpected");
296 if (!skipped) {
297 parHelpers_[key] = ret.first;
298 if (!simMarket) {
299 yieldCurvePillars_[curveName].push_back((ret.second -
asof) * Days);
300 }
301 DLOG(
"Par instrument for yield curve, ccy " << ccy <<
" tenor " << j <<
", type " << instType
302 << " built.");
303 }
304 }
305 }
306 }
307
309
310 LOG(
"ParSensitivityAnalysis: Index curve par instruments");
311
313 string indexName = index.first;
314 QL_REQUIRE(simMarket || yieldCurvePillars_.find(indexName) == yieldCurvePillars_.end(),
315 "duplicate entry in yieldCurvePillars '" << indexName << "'");
317 *QuantLib::ext::static_pointer_cast<SensitivityScenarioData::CurveShiftParData>(index.second);
318 Size n_ten =
data.shiftTenors.size();
319 QL_REQUIRE(
data.parInstruments.size() == n_ten,
320 indexName << " number of tenors " << n_ten << "does not match number of index curve par instruments"
321 <<
data.parInstruments.size());
322 vector<string> tokens;
323 boost::split(tokens, indexName, boost::is_any_of("-"));
324 QL_REQUIRE(tokens.size() >= 2, "index name " << indexName << " unexpected");
325 string ccy = tokens[0];
326 QL_REQUIRE(ccy.length() == 3, "currency token not recognised");
327 for (Size j = 0; j < n_ten; ++j) {
329 if (!dryRun && !relevantRiskFactors.empty() &&
330 relevantRiskFactors.find(key) == relevantRiskFactors.end())
331 continue;
332 Period term =
data.shiftTenors[j];
333 string instType =
data.parInstruments[j];
334 bool singleCurve =
data.parInstrumentSingleCurve;
335 string yieldCurveName = "";
336 string equityForecastCurveName = "";
337 std::pair<QuantLib::ext::shared_ptr<Instrument>, Date> ret;
338 bool recognised = true, skipped = false;
339 try {
340 map<string, string> conventionsMap =
data.parInstrumentConventions;
341 QL_REQUIRE(conventionsMap.find(instType) != conventionsMap.end(),
342 "conventions not found for ccy " << ccy << " and instrument type " << instType);
343 QuantLib::ext::shared_ptr<Convention> convention = conventions->get(conventionsMap[instType]);
344
345 if (instType == "IRS")
346 ret =
makeSwap(simMarket, ccy, indexName, yieldCurveName, equityForecastCurveName, term,
347 convention, singleCurve, parHelperDependencies_[key],
349 else if (instType == "DEP")
350 ret =
makeDeposit(
asof, simMarket, ccy, indexName, yieldCurveName, equityForecastCurveName,
351 term, convention, marketConfiguration);
352 else if (instType == "FRA")
353 ret =
makeFRA(
asof, simMarket, ccy, indexName, yieldCurveName, equityForecastCurveName, term,
354 convention, marketConfiguration);
355 else if (instType == "OIS")
356 ret =
makeOIS(simMarket, ccy, indexName, yieldCurveName, equityForecastCurveName, term,
357 convention, singleCurve, parHelperDependencies_[key],
359 else if (instType == "TBS")
360 ret =
makeTenorBasisSwap(
asof, simMarket, ccy,
"",
"",
"",
"", term, convention, singleCurve,
362 data.discountCurve, marketConfiguration);
363 else
364 recognised = false;
365 } catch (const std::exception& e) {
366 skipped = true;
367 if (continueOnError) {
369 "Skipping par instrument for index curve " + indexName,
370 e.what())
372 } else {
373 QL_FAIL(e.what());
374 }
375 }
376 if (!recognised)
377 QL_FAIL("Instrument type " << instType << " for par sensitivity conversion not recognised");
378 if (!skipped) {
379 parHelpers_[key] = ret.first;
380 if (!simMarket) {
381 yieldCurvePillars_[indexName].push_back((ret.second -
asof) * Days);
382 }
383 DLOG(
"Par instrument for index " << indexName <<
" ccy " << ccy <<
" tenor " << j <<
" built.");
384 }
385 }
386 }
387 }
388
390
391
392 LOG(
"ParSensitivityAnalysis: Cap/Floor par instruments");
393
395 string key = c.first;
396 auto datap = QuantLib::ext::dynamic_pointer_cast<SensitivityScenarioData::CapFloorVolShiftParData>(c.second);
397 string expDiscountCurve = datap ? datap->discountCurve : "";
399 string indexName =
data.indexName;
401 Handle<YieldTermStructure> yts;
402 Handle<OptionletVolatilityStructure> ovs;
403 Size n_strikes =
data.shiftStrikes.size();
404 Size n_expiries =
data.shiftExpiries.size();
405
406
407 bool isAtm =
data.shiftStrikes.size() == 1 &&
data.shiftStrikes[0] == 0.0 &&
data.isRelative;
408
409 for (Size j = 0; j < n_strikes; ++j) {
410 Real strike =
data.shiftStrikes[j];
411 for (Size k = 0; k < n_expiries; ++k) {
413 if (!dryRun && !relevantRiskFactors.empty() &&
414 relevantRiskFactors.find(rfkey) == relevantRiskFactors.end())
415 continue;
416 try {
417 if (simMarket != nullptr) {
418 yts = expDiscountCurve.empty() ? simMarket->discountCurve(ccy, marketConfiguration)
419 : simMarket->iborIndex(expDiscountCurve, marketConfiguration)
420 ->forwardingTermStructure();
421 ovs = simMarket->capFloorVol(key, marketConfiguration);
422 }
423 Period term =
data.shiftExpiries[k];
424 auto tmp =
makeCapFloor(simMarket, ccy, indexName, term, strike, isAtm,
425 parHelperDependencies_[rfkey], expDiscountCurve, marketConfiguration);
426 parCaps_[rfkey] = tmp;
427 parCapsYts_[rfkey] = yts;
428 parCapsVts_[rfkey] = ovs;
429 if (j == 0)
430 capFloorPillars_[key].push_back(term);
431 DLOG(
"Par cap/floor for key " << rfkey <<
" strike " << j <<
" tenor " << k <<
" built.");
432 } catch (const std::exception& e) {
433 if (continueOnError) {
435 "Skipping par cap/floor for key " + key, e.what())
437 } else {
438 QL_FAIL(e.what());
439 }
440 }
441 }
442 }
443 }
444 }
445
447
448
449 LOG(
"ParSensitivityAnalysis: CDS par instruments");
451 string name = c.first;
452 string ccy = sensitivityData.
creditCcys().at(name);
455 "creditCurveShiftData not found for " << name);
457 *QuantLib::ext::static_pointer_cast<SensitivityScenarioData::CurveShiftParData>(c.second);
458 Size n_expiries =
data.shiftTenors.size();
459 for (Size k = 0; k < n_expiries; ++k) {
460 string instType =
data.parInstruments[k];
462 if (!dryRun && !relevantRiskFactors.empty() &&
463 relevantRiskFactors.find(key) == relevantRiskFactors.end())
464 continue;
465 Period term =
data.shiftTenors[k];
466 std::pair<QuantLib::ext::shared_ptr<Instrument>, Date> ret;
467 bool skipped = false;
468 try {
469 map<string, string> conventionsMap =
data.parInstrumentConventions;
470 QL_REQUIRE(conventionsMap.find(instType) != conventionsMap.end(),
471 "conventions not found for name " << name << " and instrument type " << instType);
472 QuantLib::ext::shared_ptr<Convention> convention = conventions->get(conventionsMap[instType]);
473
474 ret =
makeCDS(simMarket, name, ccy, term, convention, parHelperDependencies_[key],
475 data.discountCurve, marketConfiguration);
476 } catch (const std::exception& e) {
477 skipped = true;
478 if (continueOnError) {
480 "Skipping par instrument for cds " + name, e.what())
482 } else {
483 QL_FAIL(e.what());
484 }
485 }
486 if (!skipped) {
487 parHelpers_[key] = ret.first;
488 if (!simMarket) {
489 cdsPillars_[
name].push_back((ret.second -
asof) * Days);
490 }
491 DLOG(
"Par CDS for name " << name <<
" tenor " << k <<
" built.");
492 }
493 }
494 }
495 }
496
498
499 LOG(
"ParSensitivityAnalysis: ZCI curve par instruments");
500
502 string indexName = z.first;
504 *QuantLib::ext::static_pointer_cast<SensitivityScenarioData::CurveShiftParData>(z.second);
505 Size n_ten =
data.shiftTenors.size();
506 for (Size j = 0; j < n_ten; ++j) {
508 if (!dryRun && !relevantRiskFactors.empty() &&
509 relevantRiskFactors.find(key) == relevantRiskFactors.end())
510 continue;
511 Period term =
data.shiftTenors[j];
512 string instType =
data.parInstruments[j];
513 bool singleCurve =
data.parInstrumentSingleCurve;
514 try {
515 map<string, string> conventionsMap =
data.parInstrumentConventions;
516 QL_REQUIRE(conventionsMap.find(instType) != conventionsMap.end(),
517 "conventions not found for zero inflation curve " << indexName << " and instrument type "
518 << instType);
519 QuantLib::ext::shared_ptr<Convention> convention = conventions->get(conventionsMap[instType]);
520
521 auto tmp =
523 parHelperDependencies_[key],
data.discountCurve, marketConfiguration);
524 auto helper = QuantLib::ext::dynamic_pointer_cast<ZeroCouponInflationSwap>(tmp);
525 QuantLib::ext::shared_ptr<IndexedCashFlow> lastCoupon =
526 QuantLib::ext::dynamic_pointer_cast<IndexedCashFlow>(
helper->inflationLeg().back());
527 Date latestRelevantDate = std::max(
helper->maturityDate(), lastCoupon->fixingDate());
528 zeroInflationPillars_[indexName].push_back((latestRelevantDate -
asof) * Days);
529
530 parHelpers_[key] = tmp;
531 DLOG(
"Par instrument for zero inflation index " << indexName <<
" tenor " << j <<
" built.");
532 } catch (const std::exception& e) {
533 if (continueOnError) {
535 "Skipping par instrument for zero inflation index " + indexName,
536 e.what())
538 } else {
539 QL_FAIL(e.what());
540 }
541 }
542 }
543 }
544 }
545
547
548
549 LOG(
"ParSensitivityAnalysis: YOYI curve par instruments");
551 string indexName = y.first;
553 *QuantLib::ext::static_pointer_cast<SensitivityScenarioData::CurveShiftParData>(y.second);
554 Size n_ten =
data.shiftTenors.size();
555 for (Size j = 0; j < n_ten; ++j) {
556 Period term =
data.shiftTenors[j];
557 string instType =
data.parInstruments[j];
558 bool singleCurve =
data.parInstrumentSingleCurve;
559
561 bool recognised = true;
562 try {
563 map<string, string> conventionsMap =
data.parInstrumentConventions;
564 QL_REQUIRE(conventionsMap.find(instType) != conventionsMap.end(),
565 "conventions not found for zero inflation curve " << indexName << " and instrument type "
566 << instType);
567 QuantLib::ext::shared_ptr<Convention> convention = conventions->get(conventionsMap[instType]);
568
569 if (instType == "ZIS") {
570 auto tmp =
572 parHelperDependencies_[key],
data.discountCurve, marketConfiguration);
573 auto helper = dynamic_pointer_cast<YearOnYearInflationSwap>(tmp);
574
575 QuantLib::ext::shared_ptr<YoYInflationCoupon> lastCoupon =
576 QuantLib::ext::dynamic_pointer_cast<YoYInflationCoupon>(
helper->yoyLeg().back());
577 Date latestRelevantDate = std::max(
helper->maturityDate(), lastCoupon->fixingDate());
579 parHelpers_[key] = tmp;
580 } else if (instType == "YYS") {
581 auto tmp =
583 parHelperDependencies_[key],
data.discountCurve, marketConfiguration);
584 auto helper = dynamic_pointer_cast<YearOnYearInflationSwap>(tmp);
585
586 QuantLib::ext::shared_ptr<YoYInflationCoupon> lastCoupon =
587 QuantLib::ext::dynamic_pointer_cast<YoYInflationCoupon>(
helper->yoyLeg().back());
588 Date latestRelevantDate = std::max(
helper->maturityDate(), lastCoupon->fixingDate());
590 parHelpers_[key] = tmp;
591 } else
592 recognised = false;
593 } catch (const std::exception& e) {
594 if (continueOnError) {
596 "Skipping par instrument for yoy index " + indexName, e.what())
598 } else {
599 QL_FAIL(e.what());
600 }
601 }
602 if (!recognised)
603 QL_FAIL("Instrument type " << instType << " for par sensitivity conversion not recognised");
604 DLOG(
"Par instrument for yoy inflation index " << indexName <<
" tenor " << j <<
" built.");
605 }
606 }
607 }
608
610
611
612 LOG(
"ParSensitivityAnalysis: YOYI Cap/Floor par instruments");
614 string indexName = y.first;
616 *QuantLib::ext::static_pointer_cast<SensitivityScenarioData::CapFloorVolShiftParData>(y.second);
617 Size n_strikes =
data.shiftStrikes.size();
618 Size n_expiries =
data.shiftExpiries.size();
619 bool singleCurve =
data.parInstrumentSingleCurve;
620 for (Size j = 0; j < n_strikes; ++j) {
621 Real strike =
data.shiftStrikes[j];
622 pair<string, Size> key(indexName, j);
623 for (Size k = 0; k < n_expiries; ++k) {
625 k * n_strikes + j);
626
627 bool recognised = true;
628 string instType;
629 try {
630 instType =
data.parInstruments[j];
631 map<string, string> conventionsMap =
data.parInstrumentConventions;
632 QL_REQUIRE(conventionsMap.find(instType) != conventionsMap.end(),
633 "conventions not found for zero inflation curve "
634 << indexName << " and instrument type " << instType);
635 QuantLib::ext::shared_ptr<Convention> convention = conventions->get(conventionsMap[instType]);
636 Period term =
data.shiftExpiries[k];
637 if (instType == "ZIS") {
638 makeYoYCapFloor(instruments, simMarket, indexName, term, strike, convention, singleCurve,
639 true,
data.discountCurve, key, marketConfiguration);
640 } else if (instType == "YYS") {
641 makeYoYCapFloor(instruments, simMarket, indexName, term, strike, convention, singleCurve,
642 false,
data.discountCurve, key, marketConfiguration);
643 } else
644 recognised = false;
645 if (j == 0)
646 yoyCapFloorPillars_[indexName].push_back(term);
647 } catch (const std::exception& e) {
648 if (continueOnError) {
650 "Par sensitivity conversion",
651 "Skipping par instrument for yoy cap floor index " + indexName, e.what())
653 } else {
654 QL_FAIL(e.what());
655 }
656 }
657 if (!recognised)
658 QL_FAIL("Instrument type " << instType << " for par sensitivity conversion not recognised");
659 DLOG(
"Par yoy cap/floor for index " << indexName <<
" strike " << j <<
" tenor " << k <<
" built.");
660 }
661 }
662 }
663 }
664
665 LOG(
"Par instrument building done, got " << parHelpers_.size() + parCaps_.size() + parYoYCaps_.size()
666 << " instruments");
667}
std::pair< QuantLib::ext::shared_ptr< QuantLib::Instrument >, Date > makeSwap(const QuantLib::ext::shared_ptr< ore::data::Market > &market, std::string ccy, std::string indexName, std::string yieldCurveName, std::string equityForecastCurveName, QuantLib::Period term, const QuantLib::ext::shared_ptr< ore::data::Convention > &conventions, bool singleCurve, std::set< ore::analytics::RiskFactorKey > &parHelperDependencies, std::set< std::string > &removeTodaysFixingIndices, const std::string &expDiscountCurve="", const std::string &marketConfiguration=ore::data::Market::defaultConfiguration) const
Create Swap for implying par rate sensitivity from zero rate sensitivity.
QuantLib::ext::shared_ptr< QuantLib::CapFloor > makeCapFloor(const QuantLib::ext::shared_ptr< ore::data::Market > &market, std::string ccy, std::string indexName, QuantLib::Period term, double strike, bool generatePillar, std::set< ore::analytics::RiskFactorKey > &parHelperDependencies, const std::string &expDiscountCurve="", const std::string &marketConfiguration=ore::data::Market::defaultConfiguration) const
Create Cap/Floor QuantLib::Instrument for implying flat vol sensitivity from optionlet vol sensitivit...
std::pair< QuantLib::ext::shared_ptr< QuantLib::Instrument >, Date > makeTenorBasisSwap(const QuantLib::Date &asof, const QuantLib::ext::shared_ptr< ore::data::Market > &market, std::string ccy, std::string receiveIndexName, std::string payIndexName, std::string yieldCurveName, std::string equityForecastCurveName, QuantLib::Period term, const QuantLib::ext::shared_ptr< ore::data::Convention > &conventions, const bool singleCurve, std::set< ore::analytics::RiskFactorKey > &parHelperDependencies, std::set< std::string > &removeTodaysFixingIndices, const std::string &expDiscountCurve="", const std::string &marketConfiguration=ore::data::Market::defaultConfiguration) const
Create Basis Swap for implying par rate sensitivity from zero rate sensitivity.
std::pair< QuantLib::ext::shared_ptr< QuantLib::Instrument >, Date > makeCrossCcyBasisSwap(const QuantLib::ext::shared_ptr< ore::data::Market > &market, std::string baseCcy, std::string ccy, QuantLib::Period term, const QuantLib::ext::shared_ptr< ore::data::Convention > &conventions, std::set< ore::analytics::RiskFactorKey > &parHelperDependencies, std::set< std::string > &removeTodaysFixingIndices, const std::string &marketConfiguration=ore::data::Market::defaultConfiguration) const
Create Cross Ccy Basis Swap for implying par rate sensitivity from zero rate sensitivity.
void makeYoYCapFloor(ParSensitivityInstrumentBuilder::Instruments &instruments, const QuantLib::ext::shared_ptr< Market > &market, std::string indexName, QuantLib::Period term, double strike, const QuantLib::ext::shared_ptr< ore::data::Convention > &convention, bool singleCurve, bool fromZero, const std::string &expDiscountCurve, const ore::analytics::RiskFactorKey &key, const std::string &marketConfiguration=ore::data::Market::defaultConfiguration) const
Create YoY Cap/Floor for implying rate rate sensitivity from yoy optionlet vol sensitivity.
std::pair< QuantLib::ext::shared_ptr< QuantLib::Instrument >, Date > makeDeposit(const QuantLib::Date &asof, const QuantLib::ext::shared_ptr< ore::data::Market > &market, std::string ccy, std::string indexName, std::string yieldCurveName, std::string equityForecastCurveName, QuantLib::Period term, const QuantLib::ext::shared_ptr< ore::data::Convention > &conventions, const std::string &marketConfiguration=ore::data::Market::defaultConfiguration) const
Create Deposit for implying par rate sensitivity from zero rate sensitivity.
std::pair< QuantLib::ext::shared_ptr< QuantLib::Instrument >, Date > makeFRA(const QuantLib::Date &asof, const QuantLib::ext::shared_ptr< ore::data::Market > &market, std::string ccy, std::string indexName, std::string yieldCurveName, std::string equityForecastCurveName, QuantLib::Period term, const QuantLib::ext::shared_ptr< ore::data::Convention > &conventions, const std::string &marketConfiguration=ore::data::Market::defaultConfiguration) const
Create FRA for implying par rate sensitivity from zero rate sensitivity.
std::pair< QuantLib::ext::shared_ptr< QuantLib::Instrument >, Date > makeOIS(const QuantLib::ext::shared_ptr< ore::data::Market > &market, std::string ccy, std::string indexName, std::string yieldCurveName, std::string equityForecastCurveName, QuantLib::Period term, const QuantLib::ext::shared_ptr< ore::data::Convention > &conventions, bool singleCurve, std::set< ore::analytics::RiskFactorKey > &parHelperDependencies, std::set< std::string > &removeTodaysFixingIndices, const std::string &expDiscountCurve="", const std::string &marketConfiguration=ore::data::Market::defaultConfiguration) const
Create OIS Swap for implying par rate sensitivity from zero rate sensitivity.
QuantLib::ext::shared_ptr< QuantLib::Instrument > makeYoyInflationSwap(const QuantLib::ext::shared_ptr< ore::data::Market > &market, std::string indexName, QuantLib::Period term, const QuantLib::ext::shared_ptr< ore::data::Convention > &conventions, bool singleCurve, bool fromZero, std::set< ore::analytics::RiskFactorKey > &parHelperDependencies, const std::string &expDiscountCurve="", const std::string &marketConfiguration=ore::data::Market::defaultConfiguration) const
Create YoY Swap for implying par rate sensitivity from yoy rate sensitivity.
std::pair< QuantLib::ext::shared_ptr< QuantLib::Instrument >, Date > makeFxForward(const QuantLib::ext::shared_ptr< ore::data::Market > &market, std::string baseCcy, std::string ccy, QuantLib::Period term, const QuantLib::ext::shared_ptr< ore::data::Convention > &conventions, std::set< ore::analytics::RiskFactorKey > &parHelperDependencies, const std::string &marketConfiguration=ore::data::Market::defaultConfiguration) const
Create FX Forwrad for implying par rate sensitivity from zero rate sensitivity.
std::pair< QuantLib::ext::shared_ptr< QuantLib::Instrument >, Date > makeCDS(const QuantLib::ext::shared_ptr< ore::data::Market > &market, std::string name, std::string ccy, QuantLib::Period term, const QuantLib::ext::shared_ptr< ore::data::Convention > &conventions, std::set< ore::analytics::RiskFactorKey > &parHelperDependencies, const std::string &expDiscountCurve="", const std::string &marketConfiguration=ore::data::Market::defaultConfiguration) const
Create CDS for implying par rate sensitivity from Hazard Rate sensitivity.
QuantLib::ext::shared_ptr< QuantLib::Instrument > makeZeroInflationSwap(const QuantLib::ext::shared_ptr< ore::data::Market > &market, std::string indexName, QuantLib::Period term, const QuantLib::ext::shared_ptr< ore::data::Convention > &conventions, bool singleCurve, std::set< ore::analytics::RiskFactorKey > &parHelperDependencies, const std::string &expDiscountCurve="", const std::string &marketConfiguration=ore::data::Market::defaultConfiguration) const
Create Zero Swap for implying par rate sensitivity from zero rate sensitivity.
Data types stored in the scenario class.
@ YoYInflationCapFloorVolatility
const map< string, QuantLib::ext::shared_ptr< CapFloorVolShiftData > > & yoyInflationCapFloorVolShiftData() const
const map< string, QuantLib::ext::shared_ptr< CurveShiftData > > & indexCurveShiftData() const
const map< string, QuantLib::ext::shared_ptr< CapFloorVolShiftData > > & capFloorVolShiftData() const
const map< string, string > & creditCcys() const
const map< string, QuantLib::ext::shared_ptr< CurveShiftData > > & discountCurveShiftData() const
const map< string, QuantLib::ext::shared_ptr< CurveShiftData > > & zeroInflationCurveShiftData() const
const map< string, QuantLib::ext::shared_ptr< CurveShiftData > > & creditCurveShiftData() const
const map< string, QuantLib::ext::shared_ptr< CurveShiftData > > & yoyInflationCurveShiftData() const
const map< string, QuantLib::ext::shared_ptr< CurveShiftData > > & yieldCurveShiftData() const
QuantLib::ext::shared_ptr< IborIndex > parseIborIndex(const string &s, const Handle< YieldTermStructure > &h=Handle< YieldTermStructure >())
Size size(const ValueType &v)
QuantLib::BootstrapHelper< QuantLib::OptionletVolatilityStructure > helper
std::map< std::string, std::vector< QuantLib::Period > > zeroInflationPillars_
std::set< std::string > removeTodaysFixingIndices_
std::map< ore::analytics::RiskFactorKey, QuantLib::ext::shared_ptr< QuantLib::Instrument > > parHelpers_
par helpers (all except cap/floors)
std::map< ore::analytics::RiskFactorKey, std::set< ore::analytics::RiskFactorKey > > parHelperDependencies_
list of (raw) risk factors on which a par helper depends
std::map< std::string, std::vector< QuantLib::Period > > yieldCurvePillars_
par QuantLib::Instrument pillars
std::map< ore::analytics::RiskFactorKey, QuantLib::Handle< QuantLib::YieldTermStructure > > parCapsYts_
std::map< ore::analytics::RiskFactorKey, QuantLib::ext::shared_ptr< QuantLib::CapFloor > > parCaps_
par helpers: IR cap / floors
std::map< ore::analytics::RiskFactorKey, QuantLib::Handle< QuantLib::OptionletVolatilityStructure > > parCapsVts_
std::map< ore::analytics::RiskFactorKey, QuantLib::ext::shared_ptr< QuantLib::YoYInflationCapFloor > > parYoYCaps_
std::map< std::string, std::vector< QuantLib::Period > > yoyCapFloorPillars_
std::map< std::string, std::vector< QuantLib::Period > > capFloorPillars_
std::map< std::string, std::vector< QuantLib::Period > > cdsPillars_
std::map< std::string, std::vector< QuantLib::Period > > yoyInflationPillars_