Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
TestConfigurationObjects Class Reference

Static class to allow for easy construction of configuration objects for use within tests. More...

#include <test/testmarket.hpp>

+ Collaboration diagram for TestConfigurationObjects:

Static Public Member Functions

static QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameterssetupSimMarketData (bool hasSwapVolCube=false, bool hasYYCapVols=false)
 ScenarioSimMarketParameters instance. More...
 
static QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioDatasetupSensitivityScenarioData (bool hasSwapVolCube=false, bool hasYYCapVols=false, bool parConversion=false)
 SensitivityScenarioData instance. More...
 
static QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameterssetupSimMarketData2 ()
 ScenarioSimMarketParameters instance, 2 currencies. More...
 
static QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameterssetupSimMarketData5 ()
 ScenarioSimMarketParameters instance, 5 currencies. More...
 
static QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioDatasetupSensitivityScenarioData2 ()
 SensitivityScenarioData instance, 2 currencies. More...
 
static QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioDatasetupSensitivityScenarioData5 ()
 SensitivityScenarioData instance, 5 currencies. More...
 
static QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioDatasetupSensitivityScenarioData2b ()
 SensitivityScenarioData instance, 2 currencies, shifts more granular than base curve. More...
 
static void setConventions ()
 Set Conventions. More...
 
static void setConventions2 ()
 

Detailed Description

Static class to allow for easy construction of configuration objects for use within tests.

Definition at line 222 of file testmarket.hpp.

Member Function Documentation

◆ setupSimMarketData()

QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > setupSimMarketData ( bool  hasSwapVolCube = false,
bool  hasYYCapVols = false 
)
static

ScenarioSimMarketParameters instance.

Definition at line 1246 of file testmarket.cpp.

1246 {
1247 QuantLib::ext::shared_ptr<ore::analytics::ScenarioSimMarketParameters> simMarketData(
1249
1250 simMarketData->baseCcy() = "EUR";
1251 simMarketData->setDiscountCurveNames({"EUR", "GBP", "USD", "CHF", "JPY"});
1252 simMarketData->setYieldCurveTenors("",
1253 {2 * Weeks, 1 * Months, 3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
1254 5 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years, 30 * Years});
1255 simMarketData->setIndices({"EUR-EURIBOR-2W", "EUR-EURIBOR-1M", "EUR-EURIBOR-3M", "EUR-EURIBOR-6M", "USD-LIBOR-2W",
1256 "USD-LIBOR-1M", "USD-LIBOR-3M", "USD-LIBOR-6M", "GBP-LIBOR-2W", "GBP-LIBOR-1M",
1257 "GBP-LIBOR-3M", "GBP-LIBOR-6M", "CHF-LIBOR-6M", "JPY-LIBOR-2W", "JPY-LIBOR-1M",
1258 "JPY-LIBOR-3M", "JPY-LIBOR-6M", "JPY-TONAR"});
1259 simMarketData->interpolation() = "LogLinear";
1260 simMarketData->swapIndices()["EUR-CMS-2Y"] = "EUR-EURIBOR-6M";
1261 simMarketData->swapIndices()["EUR-CMS-30Y"] = "EUR-EURIBOR-6M";
1262
1263 simMarketData->setSwapVolTerms("", {1 * Years, 2 * Years, 3 * Years, 4 * Years, 5 * Years, 7 * Years, 10 * Years,
1264 15 * Years, 20 * Years, 30 * Years});
1265 simMarketData->setSwapVolExpiries("",
1266 {2 * Weeks, 1 * Months, 3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
1267 5 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years, 30 * Years});
1268 simMarketData->setSwapVolKeys({"EUR", "GBP", "USD", "CHF", "JPY"});
1269 simMarketData->swapVolDecayMode() = "ForwardVariance";
1270 simMarketData->setSimulateSwapVols(true); // false;
1271 if (hasSwapVolCube) {
1272 simMarketData->setSwapVolIsCube("", true);
1273 simMarketData->simulateSwapVolATMOnly() = false;
1274 simMarketData->setSwapVolStrikeSpreads("", {-0.02, -0.005, 0.0, 0.005, 0.02});
1275 }
1276
1277 simMarketData->setFxVolExpiries("",
1278 vector<Period>{1 * Months, 3 * Months, 6 * Months, 2 * Years, 3 * Years, 4 * Years, 5 * Years});
1279 simMarketData->setFxVolDecayMode(string("ConstantVariance"));
1280 simMarketData->setSimulateFXVols(true); // false;
1281 simMarketData->setFxVolCcyPairs({"EURUSD", "EURGBP", "EURCHF", "EURJPY"});
1282 simMarketData->setFxVolIsSurface(true);
1283 simMarketData->setFxVolMoneyness(vector<Real>{0.1, 0.5, 1, 1.5, 2, 2.5, 3});
1284 simMarketData->setFxCcyPairs({"EURUSD", "EURGBP", "EURCHF", "EURJPY"});
1285
1286 simMarketData->setSimulateCapFloorVols(true);
1287 simMarketData->capFloorVolDecayMode() = "ForwardVariance";
1288 simMarketData->setCapFloorVolKeys({"EUR", "USD"});
1289 simMarketData->setCapFloorVolExpiries(
1290 "", {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
1291 simMarketData->setCapFloorVolStrikes("", {0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06});
1292
1293 simMarketData->setDefaultNames({"dc", "dc2", "dc3"});
1294 simMarketData->setDefaultTenors("", {3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 10 * Years,
1295 13 * Years, 15 * Years, 20 * Years});
1296 simMarketData->setSimulateSurvivalProbabilities(true);
1297 simMarketData->setSimulateRecoveryRates(false);
1298 simMarketData->setDefaultCurveCalendars("", "TARGET");
1299
1300 simMarketData->setSimulateCdsVols(true);
1301 simMarketData->cdsVolExpiries() = {6 * Months, 1 * Years, 2 * Years, 5 * Years, 10 * Years};
1302 simMarketData->cdsVolDecayMode() = "ForwardVariance";
1303 simMarketData->setCdsVolNames({"dc", "dc2", "dc3"});
1304
1305 simMarketData->setEquityNames({"SP5", "Lufthansa"});
1306 simMarketData->setEquityDividendTenors("SP5", {6 * Months, 1 * Years, 2 * Years});
1307 simMarketData->setEquityDividendTenors("Lufthansa", {6 * Months, 1 * Years, 2 * Years});
1308
1309 simMarketData->setSimulateEquityVols(true);
1310 simMarketData->setEquityVolDecayMode("ForwardVariance");
1311 simMarketData->setEquityVolNames({"SP5", "Lufthansa"});
1312 simMarketData->setEquityVolExpiries("",
1313 {2 * Weeks, 1 * Months, 3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
1314 5 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years, 30 * Years});
1315 simMarketData->setEquityVolIsSurface("", true);
1316 simMarketData->setEquityVolMoneyness(
1317 "", {0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 1.0, 1.05, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.5, 3.0});
1318
1319 simMarketData->setSimulateBaseCorrelations(true);
1320 simMarketData->setBaseCorrelationNames({"Tranch1"});
1321 simMarketData->baseCorrelationDetachmentPoints() = {0.03, 0.06, 0.09, 0.12, 0.22, 1.0};
1322 simMarketData->baseCorrelationTerms() = {1 * Days};
1323
1324 simMarketData->setZeroInflationIndices({"UKRPI"});
1325 simMarketData->setZeroInflationTenors("UKRPI", {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years,
1326 10 * Years, 15 * Years, 20 * Years});
1327
1328 simMarketData->setYoyInflationIndices({"UKRPI"});
1329 simMarketData->setYoyInflationTenors(
1330 "UKRPI", {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
1331
1332 if (hasYYCapVols) {
1333 simMarketData->setSimulateYoYInflationCapFloorVols(true);
1334 simMarketData->setYoYInflationCapFloorVolNames({"UKRPI"});
1335 simMarketData->setYoYInflationCapFloorVolExpiries(
1336 "UKRPI", {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
1337 simMarketData->setYoYInflationCapFloorVolStrikes("", {-0.02, -0.01, 0.00, 0.01, 0.02, 0.03});
1338 simMarketData->yoyInflationCapFloorVolDecayMode() = "ForwardVariance";
1339 }
1340
1341 return simMarketData;
1342}
+ Here is the caller graph for this function:

◆ setupSensitivityScenarioData()

QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > setupSensitivityScenarioData ( bool  hasSwapVolCube = false,
bool  hasYYCapVols = false,
bool  parConversion = false 
)
static

SensitivityScenarioData instance.

Definition at line 1358 of file testmarket.cpp.

1358 {
1359 QuantLib::ext::shared_ptr<ore::analytics::SensitivityScenarioData> sensiData =
1360 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData>(parConversion);
1361 vector<string> oisInstruments = {"OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS",
1362 "OIS", "OIS", "OIS", "OIS", "OIS", "OIS"};
1363 vector<string> xbsInstruments = {"FXF", "FXF", "FXF", "FXF", "FXF", "XBS", "XBS",
1364 "XBS", "XBS", "XBS", "XBS", "XBS", "XBS"};
1365
1367 fxsData.shiftType = ShiftType::Relative;
1368 fxsData.shiftSize = 0.001;
1369
1371 fxvsData.shiftType = ShiftType::Relative;
1372 fxvsData.shiftSize = 0.1;
1373 fxvsData.shiftExpiries = {5 * Years};
1374
1376 cfvsData.shiftType = ShiftType::Absolute;
1377 cfvsData.shiftSize = 0.00001;
1378 cfvsData.shiftExpiries = {1 * Years, 2 * Years, 3 * Years, 5 * Years, 10 * Years};
1379 cfvsData.shiftStrikes = {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.10};
1380
1382 swvsData.shiftType = ShiftType::Relative;
1383 swvsData.shiftSize = 0.001;
1384 swvsData.shiftExpiries = {2 * Weeks, 1 * Months, 3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
1385 5 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years, 30 * Years};
1386 swvsData.shiftTerms = {1 * Years, 2 * Years, 3 * Years, 4 * Years, 5 * Years,
1387 7 * Years, 10 * Years, 15 * Years, 20 * Years, 30 * Years};
1388 if (hasSwapVolCube)
1389 swvsData.shiftStrikes = {-0.02, -0.005, 0.0, 0.005, 0.02};
1390
1392 cdsvsData.shiftType = ShiftType::Relative;
1393 cdsvsData.shiftSize = 0.01;
1394 cdsvsData.shiftExpiries = {6 * Months, 1 * Years, 2 * Years, 5 * Years, 10 * Years};
1395
1397 eqsData.shiftType = ShiftType::Relative;
1398 eqsData.shiftSize = 0.01;
1399
1401 eqvsData.shiftType = ShiftType::Relative;
1402 eqvsData.shiftSize = 0.01;
1403 eqvsData.shiftExpiries = {2 * Weeks, 1 * Months, 3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
1404 5 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years, 30 * Years};
1405
1406 QuantLib::ext::shared_ptr<ore::analytics::SensitivityScenarioData::CurveShiftData> eqdivData =
1407 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>();
1408 eqdivData->shiftType = ShiftType::Absolute;
1409 eqdivData->shiftSize = 0.00001;
1410 eqdivData->shiftTenors = {6 * Months, 1 * Years, 2 * Years};
1411
1413 bcorrData.shiftType = ShiftType::Absolute;
1414 bcorrData.shiftSize = 0.01;
1415 bcorrData.shiftLossLevels = {0.03, 0.06, 0.09, 0.12, 0.22, 1.0};
1416 bcorrData.shiftTerms = {1 * Days};
1417
1418 QuantLib::ext::shared_ptr<ore::analytics::SensitivityScenarioData::CurveShiftParData> zinfData =
1419 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>();
1420 zinfData->shiftType = ShiftType::Absolute;
1421 zinfData->shiftSize = 0.0001;
1422 zinfData->shiftTenors = {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years,
1423 7 * Years, 10 * Years, 15 * Years, 20 * Years};
1424 zinfData->parInstruments = {"ZIS", "ZIS", "ZIS", "ZIS", "ZIS", "ZIS", "ZIS", "ZIS", "ZIS"};
1425 zinfData->parInstrumentConventions["ZIS"] = "UKRPI";
1426
1427 QuantLib::ext::shared_ptr<ore::analytics::SensitivityScenarioData::CurveShiftParData> yinfData =
1428 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>();
1429 yinfData->shiftType = ShiftType::Absolute;
1430 yinfData->shiftSize = 0.0001;
1431 yinfData->shiftTenors = {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years};
1432 yinfData->parInstruments = {"YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS"};
1433 yinfData->parInstrumentConventions["ZIS"] = "UKRPI";
1434 yinfData->parInstrumentConventions["YYS"] = "UKRPI";
1435
1436 auto yinfCfData = QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CapFloorVolShiftParData>();
1437 yinfCfData->shiftType = ShiftType::Absolute;
1438 yinfCfData->shiftSize = 0.00001;
1439 yinfCfData->shiftExpiries = {1 * Years, 2 * Years, 3 * Years, 5 * Years,
1440 7 * Years, 10 * Years, 15 * Years, 20 * Years};
1441 yinfCfData->shiftStrikes = {-0.02, -0.01, 0.00, 0.01, 0.02, 0.03};
1442 yinfCfData->parInstruments = {"YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS"};
1443 yinfCfData->parInstrumentSingleCurve = false;
1444 yinfCfData->parInstrumentConventions["ZIS"] = "UKRPI";
1445 yinfCfData->parInstrumentConventions["YYS"] = "UKRPI";
1446
1447 {
1449 cvsData.parInstrumentSingleCurve = true;
1450 cvsData.parInstrumentConventions["DEP"] = "EUR-DEP-CONVENTIONS";
1451 cvsData.parInstrumentConventions["FRA"] = "EUR-FRA-CONVENTIONS";
1452 cvsData.parInstrumentConventions["IRS"] = "EUR-6M-SWAP-CONVENTIONS";
1453 sensiData->discountCurveShiftData()["EUR"] =
1454 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1455 }
1456
1457 {
1459 cvsData.parInstrumentSingleCurve = true;
1460 cvsData.parInstrumentConventions["DEP"] = "USD-DEP-CONVENTIONS";
1461 cvsData.parInstrumentConventions["FRA"] = "USD-FRA-CONVENTIONS";
1462 cvsData.parInstrumentConventions["IRS"] = "USD-3M-SWAP-CONVENTIONS";
1463 sensiData->discountCurveShiftData()["USD"] =
1464 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1465 }
1466
1467 {
1469 cvsData.parInstrumentSingleCurve = true;
1470 cvsData.parInstrumentConventions["DEP"] = "GBP-DEP-CONVENTIONS";
1471 cvsData.parInstrumentConventions["FRA"] = "GBP-FRA-CONVENTIONS";
1472 cvsData.parInstrumentConventions["IRS"] = "GBP-6M-SWAP-CONVENTIONS";
1473 sensiData->discountCurveShiftData()["GBP"] =
1474 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1475 }
1476
1477 {
1479 cvsData.parInstrumentSingleCurve = true;
1480 cvsData.parInstrumentConventions["DEP"] = "JPY-DEP-CONVENTIONS";
1481 cvsData.parInstrumentConventions["FRA"] = "JPY-FRA-CONVENTIONS";
1482 cvsData.parInstrumentConventions["IRS"] = "JPY-6M-SWAP-CONVENTIONS";
1483 cvsData.parInstrumentConventions["OIS"] = "JPY-OIS-CONVENTIONS";
1484 cvsData.parInstruments = oisInstruments; // aligned with market setup
1485 sensiData->discountCurveShiftData()["JPY"] =
1486 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1487 }
1488 {
1490 cvsData.parInstrumentSingleCurve = true;
1491 cvsData.parInstrumentConventions["DEP"] = "CHF-DEP-CONVENTIONS";
1492 cvsData.parInstrumentConventions["FRA"] = "CHF-FRA-CONVENTIONS";
1493 cvsData.parInstrumentConventions["IRS"] = "CHF-6M-SWAP-CONVENTIONS";
1494 cvsData.parInstrumentConventions["FXF"] = "CHF-FX-CONVENTIONS";
1495 cvsData.parInstrumentConventions["XBS"] = "CHF-XCCY-BASIS-CONVENTIONS";
1496 cvsData.parInstruments = xbsInstruments; // aligned with market setup
1497 sensiData->discountCurveShiftData()["CHF"] =
1498 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1499 }
1500 {
1502 cvsData.parInstrumentSingleCurve = false;
1503 cvsData.parInstrumentConventions["DEP"] = "EUR-DEP-CONVENTIONS";
1504 cvsData.parInstrumentConventions["FRA"] = "EUR-FRA-CONVENTIONS";
1505 cvsData.parInstrumentConventions["IRS"] = "EUR-6M-SWAP-CONVENTIONS";
1506 sensiData->indexCurveShiftData()["EUR-EURIBOR-2W"] =
1507 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1508 }
1509 {
1511 cvsData.parInstrumentSingleCurve = false;
1512 cvsData.parInstrumentConventions["DEP"] = "EUR-DEP-CONVENTIONS";
1513 cvsData.parInstrumentConventions["FRA"] = "EUR-FRA-CONVENTIONS";
1514 cvsData.parInstrumentConventions["IRS"] = "EUR-6M-SWAP-CONVENTIONS";
1515 sensiData->indexCurveShiftData()["EUR-EURIBOR-1M"] =
1516 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1517 }
1518 {
1520 cvsData.parInstrumentSingleCurve = false;
1521 cvsData.parInstrumentConventions["DEP"] = "EUR-DEP-CONVENTIONS";
1522 cvsData.parInstrumentConventions["FRA"] = "EUR-FRA-CONVENTIONS";
1523 cvsData.parInstrumentConventions["IRS"] = "EUR-6M-SWAP-CONVENTIONS";
1524 sensiData->indexCurveShiftData()["EUR-EURIBOR-3M"] =
1525 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1526 }
1527 {
1529 cvsData.parInstrumentSingleCurve = false;
1530 cvsData.parInstrumentConventions["DEP"] = "EUR-DEP-CONVENTIONS";
1531 cvsData.parInstrumentConventions["FRA"] = "EUR-FRA-CONVENTIONS";
1532 cvsData.parInstrumentConventions["IRS"] = "EUR-6M-SWAP-CONVENTIONS";
1533 sensiData->indexCurveShiftData()["EUR-EURIBOR-6M"] =
1534 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1535 }
1536 {
1538 cvsData.parInstrumentSingleCurve = false;
1539 cvsData.parInstrumentConventions["DEP"] = "USD-DEP-CONVENTIONS";
1540 cvsData.parInstrumentConventions["FRA"] = "USD-FRA-CONVENTIONS";
1541 cvsData.parInstrumentConventions["IRS"] = "USD-6M-SWAP-CONVENTIONS";
1542 sensiData->indexCurveShiftData()["USD-LIBOR-2W"] =
1543 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1544 }
1545 {
1547 cvsData.parInstrumentSingleCurve = false;
1548 cvsData.parInstrumentConventions["DEP"] = "USD-DEP-CONVENTIONS";
1549 cvsData.parInstrumentConventions["FRA"] = "USD-FRA-CONVENTIONS";
1550 cvsData.parInstrumentConventions["IRS"] = "USD-6M-SWAP-CONVENTIONS";
1551 sensiData->indexCurveShiftData()["USD-LIBOR-1M"] =
1552 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1553 }
1554 {
1556 cvsData.parInstrumentSingleCurve = false;
1557 cvsData.parInstrumentConventions["DEP"] = "USD-DEP-CONVENTIONS";
1558 cvsData.parInstrumentConventions["FRA"] = "USD-FRA-CONVENTIONS";
1559 cvsData.parInstrumentConventions["IRS"] = "USD-6M-SWAP-CONVENTIONS";
1560 sensiData->indexCurveShiftData()["USD-LIBOR-3M"] =
1561 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1562 }
1563 {
1565 cvsData.parInstrumentSingleCurve = false;
1566 cvsData.parInstrumentConventions["DEP"] = "USD-DEP-CONVENTIONS";
1567 cvsData.parInstrumentConventions["FRA"] = "USD-FRA-CONVENTIONS";
1568 cvsData.parInstrumentConventions["IRS"] = "USD-6M-SWAP-CONVENTIONS";
1569 sensiData->indexCurveShiftData()["USD-LIBOR-6M"] =
1570 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1571 }
1572 {
1574 cvsData.parInstrumentSingleCurve = false;
1575 cvsData.parInstrumentConventions["DEP"] = "GBP-DEP-CONVENTIONS";
1576 cvsData.parInstrumentConventions["FRA"] = "GBP-FRA-CONVENTIONS";
1577 cvsData.parInstrumentConventions["IRS"] = "GBP-6M-SWAP-CONVENTIONS";
1578 sensiData->indexCurveShiftData()["GBP-LIBOR-2W"] =
1579 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1580 }
1581 {
1583 cvsData.parInstrumentSingleCurve = false;
1584 cvsData.parInstrumentConventions["DEP"] = "GBP-DEP-CONVENTIONS";
1585 cvsData.parInstrumentConventions["FRA"] = "GBP-FRA-CONVENTIONS";
1586 cvsData.parInstrumentConventions["IRS"] = "GBP-6M-SWAP-CONVENTIONS";
1587 sensiData->indexCurveShiftData()["GBP-LIBOR-1M"] =
1588 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1589 }
1590 {
1592 cvsData.parInstrumentSingleCurve = false;
1593 cvsData.parInstrumentConventions["DEP"] = "GBP-DEP-CONVENTIONS";
1594 cvsData.parInstrumentConventions["FRA"] = "GBP-FRA-CONVENTIONS";
1595 cvsData.parInstrumentConventions["IRS"] = "GBP-6M-SWAP-CONVENTIONS";
1596 sensiData->indexCurveShiftData()["GBP-LIBOR-3M"] =
1597 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1598 }
1599 {
1601 cvsData.parInstrumentSingleCurve = false;
1602 cvsData.parInstrumentConventions["DEP"] = "GBP-DEP-CONVENTIONS";
1603 cvsData.parInstrumentConventions["FRA"] = "GBP-FRA-CONVENTIONS";
1604 cvsData.parInstrumentConventions["IRS"] = "GBP-6M-SWAP-CONVENTIONS";
1605 sensiData->indexCurveShiftData()["GBP-LIBOR-6M"] =
1606 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1607 }
1608 {
1610 cvsData.parInstrumentSingleCurve = false;
1611 cvsData.parInstrumentConventions["DEP"] = "JPY-DEP-CONVENTIONS";
1612 cvsData.parInstrumentConventions["FRA"] = "JPY-FRA-CONVENTIONS";
1613 cvsData.parInstrumentConventions["IRS"] = "JPY-6M-SWAP-CONVENTIONS";
1614 cvsData.parInstrumentConventions["OIS"] = "JPY-OIS-CONVENTIONS";
1615 sensiData->indexCurveShiftData()["JPY-TONAR"] =
1616 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1617 }
1618 {
1620 cvsData.parInstrumentSingleCurve = false;
1621 cvsData.parInstrumentConventions["DEP"] = "JPY-DEP-CONVENTIONS";
1622 cvsData.parInstrumentConventions["FRA"] = "JPY-FRA-CONVENTIONS";
1623 cvsData.parInstrumentConventions["IRS"] = "JPY-6M-SWAP-CONVENTIONS";
1624 cvsData.parInstrumentConventions["OIS"] = "JPY-OIS-CONVENTIONS";
1625 sensiData->indexCurveShiftData()["JPY-LIBOR-2W"] =
1626 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1627 }
1628 {
1630 cvsData.parInstrumentSingleCurve = false;
1631 cvsData.parInstrumentConventions["DEP"] = "JPY-DEP-CONVENTIONS";
1632 cvsData.parInstrumentConventions["FRA"] = "JPY-FRA-CONVENTIONS";
1633 cvsData.parInstrumentConventions["IRS"] = "JPY-6M-SWAP-CONVENTIONS";
1634 cvsData.parInstrumentConventions["OIS"] = "JPY-OIS-CONVENTIONS";
1635 sensiData->indexCurveShiftData()["JPY-LIBOR-1M"] =
1636 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1637 }
1638 {
1640 cvsData.parInstrumentSingleCurve = false;
1641 cvsData.parInstrumentConventions["DEP"] = "JPY-DEP-CONVENTIONS";
1642 cvsData.parInstrumentConventions["FRA"] = "JPY-FRA-CONVENTIONS";
1643 cvsData.parInstrumentConventions["IRS"] = "JPY-6M-SWAP-CONVENTIONS";
1644 cvsData.parInstrumentConventions["OIS"] = "JPY-OIS-CONVENTIONS";
1645 sensiData->indexCurveShiftData()["JPY-LIBOR-3M"] =
1646 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1647 }
1648 {
1650 cvsData.parInstrumentSingleCurve = false;
1651 cvsData.parInstrumentConventions["DEP"] = "JPY-DEP-CONVENTIONS";
1652 cvsData.parInstrumentConventions["FRA"] = "JPY-FRA-CONVENTIONS";
1653 cvsData.parInstrumentConventions["IRS"] = "JPY-6M-SWAP-CONVENTIONS";
1654 cvsData.parInstrumentConventions["OIS"] = "JPY-OIS-CONVENTIONS";
1655 sensiData->indexCurveShiftData()["JPY-LIBOR-6M"] =
1656 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1657 }
1658 {
1660 cvsData.parInstrumentSingleCurve = true;
1661 cvsData.parInstrumentConventions["DEP"] = "CHF-DEP-CONVENTIONS";
1662 cvsData.parInstrumentConventions["FRA"] = "CHF-FRA-CONVENTIONS";
1663 cvsData.parInstrumentConventions["IRS"] = "CHF-6M-SWAP-CONVENTIONS";
1664 cvsData.parInstrumentConventions["FXF"] = "CHF-FX-CONVENTIONS";
1665 cvsData.parInstrumentConventions["XBS"] = "CHF-XCCY-BASIS-CONVENTIONS";
1666 sensiData->indexCurveShiftData()["CHF-LIBOR-6M"] =
1667 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1668 }
1669 sensiData->fxShiftData()["EURUSD"] = fxsData;
1670 sensiData->fxShiftData()["EURGBP"] = fxsData;
1671 sensiData->fxShiftData()["EURJPY"] = fxsData;
1672 sensiData->fxShiftData()["EURCHF"] = fxsData;
1673
1674 sensiData->fxVolShiftData()["EURUSD"] = fxvsData;
1675 sensiData->fxVolShiftData()["EURGBP"] = fxvsData;
1676 sensiData->fxVolShiftData()["EURJPY"] = fxvsData;
1677 sensiData->fxVolShiftData()["EURCHF"] = fxvsData;
1678
1679 sensiData->swaptionVolShiftData()["EUR"] = swvsData;
1680 sensiData->swaptionVolShiftData()["GBP"] = swvsData;
1681 sensiData->swaptionVolShiftData()["USD"] = swvsData;
1682 sensiData->swaptionVolShiftData()["JPY"] = swvsData;
1683 sensiData->swaptionVolShiftData()["CHF"] = swvsData;
1684
1685 sensiData->capFloorVolShiftData()["EUR"] =
1686 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CapFloorVolShiftData>(cfvsData);
1687 sensiData->capFloorVolShiftData()["EUR"]->indexName = "EUR-EURIBOR-6M";
1688 sensiData->capFloorVolShiftData()["USD"] =
1689 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CapFloorVolShiftData>(cfvsData);
1690 sensiData->capFloorVolShiftData()["USD"]->indexName = "USD-LIBOR-6M";
1691
1692 sensiData->creditCcys()["dc"] = "USD";
1693 sensiData->creditCcys()["dc2"] = "EUR";
1694 sensiData->creditCcys()["dc3"] = "GBP";
1695 {
1697 cvsData.shiftTenors = {3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
1698 5 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years};
1699 cvsData.parInstruments = {"CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS"};
1700 cvsData.parInstrumentConventions["CDS"] = "CDS-STANDARD-CONVENTIONS";
1701 sensiData->creditCurveShiftData()["dc"] =
1702 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1703 }
1704 {
1706 cvsData.shiftTenors = {3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
1707 5 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years};
1708 cvsData.parInstruments = {"CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS"};
1709 cvsData.parInstrumentConventions["CDS"] = "CDS-STANDARD-CONVENTIONS";
1710 sensiData->creditCurveShiftData()["dc2"] =
1711 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1712 }
1713 {
1715 cvsData.shiftTenors = {3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
1716 5 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years};
1717 cvsData.parInstruments = {"CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS"};
1718 cvsData.parInstrumentConventions["CDS"] = "CDS-STANDARD-CONVENTIONS";
1719 sensiData->creditCurveShiftData()["dc3"] =
1720 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftParData>(cvsData);
1721 }
1722 sensiData->cdsVolShiftData()["dc"] = cdsvsData;
1723 sensiData->cdsVolShiftData()["dc2"] = cdsvsData;
1724 sensiData->cdsVolShiftData()["dc3"] = cdsvsData;
1725
1726 sensiData->equityShiftData()["SP5"] = eqsData;
1727 sensiData->equityShiftData()["Lufthansa"] = eqsData;
1728
1729 sensiData->equityVolShiftData()["SP5"] = eqvsData;
1730 sensiData->equityVolShiftData()["Lufthansa"] = eqvsData;
1731 sensiData->dividendYieldShiftData()["SP5"] = eqdivData;
1732 sensiData->dividendYieldShiftData()["Lufthansa"] = eqdivData;
1733
1734 sensiData->baseCorrelationShiftData()["Tranch1"] = bcorrData;
1735
1736 sensiData->zeroInflationCurveShiftData()["UKRPI"] = zinfData;
1737
1738 sensiData->yoyInflationCurveShiftData()["UKRPI"] = yinfData;
1739
1740 if (hasYYCapVols)
1741 sensiData->yoyInflationCapFloorVolShiftData()["UKRPI"] = yinfCfData;
1742
1743 return sensiData;
1744};
ore::analytics::SensitivityScenarioData::CurveShiftParData createCurveData()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setupSimMarketData2()

QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > setupSimMarketData2 ( )
static

ScenarioSimMarketParameters instance, 2 currencies.

Definition at line 1747 of file testmarket.cpp.

1747 {
1748 QuantLib::ext::shared_ptr<ore::analytics::ScenarioSimMarketParameters> simMarketData(
1750 simMarketData->baseCcy() = "EUR";
1751 simMarketData->setDiscountCurveNames({"EUR", "GBP"});
1752 simMarketData->setYieldCurveNames({"BondCurve0"});
1753 simMarketData->setYieldCurveTenors("", {1 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years, 4 * Years,
1754 5 * Years, 6 * Years, 7 * Years, 8 * Years, 9 * Years, 10 * Years,
1755 12 * Years, 15 * Years, 20 * Years, 25 * Years, 30 * Years});
1756 simMarketData->setIndices({"EUR-EURIBOR-6M", "GBP-LIBOR-6M"});
1757 simMarketData->setDefaultNames({"BondIssuer0"});
1758 simMarketData->setDefaultTenors(
1759 "", {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
1760 simMarketData->setSecurities({"Bond0"});
1761 simMarketData->setSimulateSurvivalProbabilities(true);
1762 simMarketData->setDefaultCurveCalendars("", "TARGET");
1763 simMarketData->interpolation() = "LogLinear";
1764
1765 simMarketData->setSwapVolTerms(
1766 "", {1 * Years, 2 * Years, 3 * Years, 4 * Years, 5 * Years, 7 * Years, 10 * Years, 20 * Years});
1767 simMarketData->setSwapVolExpiries(
1768 "", {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 20 * Years});
1769 simMarketData->setSwapVolKeys({"EUR", "GBP"});
1770 simMarketData->swapVolDecayMode() = "ForwardVariance";
1771 simMarketData->setSimulateSwapVols(true);
1772
1773 simMarketData->setFxVolExpiries("",
1774 vector<Period>{1 * Months, 3 * Months, 6 * Months, 2 * Years, 3 * Years, 4 * Years, 5 * Years});
1775 simMarketData->setFxVolDecayMode(string("ConstantVariance"));
1776 simMarketData->setSimulateFXVols(true);
1777 simMarketData->setFxVolCcyPairs({"EURGBP"});
1778 simMarketData->setFxVolIsSurface(true);
1779 simMarketData->setFxVolMoneyness(vector<Real>{0.1, 0.2, 0.3, 0.5, 1, 2, 3});
1780
1781 simMarketData->setFxCcyPairs({"EURGBP"});
1782
1783 simMarketData->setSimulateCapFloorVols(false);
1784
1785 return simMarketData;
1786}
+ Here is the caller graph for this function:

◆ setupSimMarketData5()

QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > setupSimMarketData5 ( )
static

ScenarioSimMarketParameters instance, 5 currencies.

Definition at line 1788 of file testmarket.cpp.

1788 {
1789 QuantLib::ext::shared_ptr<ore::analytics::ScenarioSimMarketParameters> simMarketData(
1791
1792 simMarketData->baseCcy() = "EUR";
1793 simMarketData->setDiscountCurveNames({"EUR", "GBP", "USD", "CHF", "JPY"});
1794 simMarketData->setYieldCurveTenors("", {1 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years, 4 * Years,
1795 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years, 30 * Years});
1796 simMarketData->setIndices(
1797 {"EUR-EURIBOR-6M", "USD-LIBOR-3M", "USD-LIBOR-6M", "GBP-LIBOR-6M", "CHF-LIBOR-6M", "JPY-LIBOR-6M"});
1798 simMarketData->swapIndices()["EUR-CMS-2Y"] = "EUR-EURIBOR-6M";
1799 simMarketData->swapIndices()["EUR-CMS-30Y"] = "EUR-EURIBOR-6M";
1800
1801 simMarketData->setYieldCurveNames({"BondCurve0"});
1802 simMarketData->interpolation() = "LogLinear";
1803
1804 simMarketData->setSwapVolTerms("", {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 20 * Years});
1805 simMarketData->setSwapVolExpiries(
1806 "", {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 20 * Years});
1807 simMarketData->setSwapVolKeys({"EUR", "GBP", "USD", "CHF", "JPY"});
1808 simMarketData->swapVolDecayMode() = "ForwardVariance";
1809 simMarketData->setSimulateSwapVols(true); // false;
1810
1811 simMarketData->setFxVolExpiries("",
1812 vector<Period>{1 * Months, 3 * Months, 6 * Months, 2 * Years, 3 * Years, 4 * Years, 5 * Years});
1813 simMarketData->setFxVolDecayMode(string("ConstantVariance"));
1814 simMarketData->setSimulateFXVols(true); // false;
1815 simMarketData->setFxVolCcyPairs({"EURUSD", "EURGBP", "EURCHF", "EURJPY", "GBPCHF"});
1816 simMarketData->setFxVolIsSurface(true);
1817 simMarketData->setFxVolMoneyness(vector<Real>{0.1, 0.2, 0.3, 0.5, 1, 2, 3});
1818
1819 simMarketData->setFxCcyPairs({"EURUSD", "EURGBP", "EURCHF", "EURJPY"});
1820
1821 simMarketData->setSimulateCapFloorVols(true);
1822 simMarketData->capFloorVolDecayMode() = "ForwardVariance";
1823 simMarketData->setCapFloorVolKeys({"EUR", "USD"});
1824 simMarketData->setCapFloorVolExpiries(
1825 "", {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
1826 simMarketData->setCapFloorVolStrikes("", {0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06});
1827
1828 simMarketData->setDefaultNames({"BondIssuer0"});
1829 simMarketData->setDefaultTenors(
1830 "", {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
1831 simMarketData->setSimulateSurvivalProbabilities(true);
1832 simMarketData->setSecurities({"Bond0"});
1833 simMarketData->setDefaultCurveCalendars("", "TARGET");
1834
1835 simMarketData->setEquityNames({"SP5", "Lufthansa"});
1836 simMarketData->setEquityDividendTenors("SP5", {6 * Months, 1 * Years, 2 * Years});
1837 simMarketData->setEquityDividendTenors("Lufthansa", {6 * Months, 1 * Years, 2 * Years});
1838
1839 simMarketData->setSimulateEquityVols(true);
1840 simMarketData->setEquityVolDecayMode("ForwardVariance");
1841 simMarketData->setEquityVolNames({"SP5", "Lufthansa"});
1842 simMarketData->setEquityVolExpiries("", {6 * Months, 1 * Years, 2 * Years, 3 * Years,
1843 5 * Years, 7 * Years, 10 * Years, 20 * Years});
1844 simMarketData->setEquityVolIsSurface("", false);
1845 simMarketData->setSimulateEquityVolATMOnly(true);
1846 simMarketData->setEquityVolMoneyness("", {1});
1847
1848 simMarketData->setZeroInflationIndices({"UKRPI"});
1849 simMarketData->setZeroInflationTenors(
1850 "UKRPI", {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
1851 simMarketData->setYoyInflationIndices({"UKRPI"});
1852 simMarketData->setYoyInflationTenors(
1853 "UKRPI", {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years});
1854
1855 simMarketData->setCommodityCurveSimulate(true);
1856 simMarketData->setCommodityNames({"COMDTY_GOLD_USD", "COMDTY_WTI_USD"});
1857 simMarketData->setCommodityCurveTenors("", {0 * Days, 1 * Years, 2 * Years, 5 * Years});
1858
1859 simMarketData->setCommodityVolSimulate(true);
1860 simMarketData->commodityVolDecayMode() = "ForwardVariance";
1861 simMarketData->setCommodityVolNames({"COMDTY_GOLD_USD", "COMDTY_WTI_USD"});
1862 simMarketData->commodityVolExpiries("COMDTY_GOLD_USD") = {1 * Years, 2 * Years, 5 * Years};
1863 simMarketData->commodityVolMoneyness("COMDTY_GOLD_USD") = {1.0};
1864 simMarketData->commodityVolExpiries("COMDTY_WTI_USD") = {1 * Years, 5 * Years};
1865 simMarketData->commodityVolMoneyness("COMDTY_WTI_USD") = {0.9, 0.95, 1.0, 1.05, 1.1};
1866
1867 return simMarketData;
1868}
+ Here is the caller graph for this function:

◆ setupSensitivityScenarioData2()

QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > setupSensitivityScenarioData2 ( )
static

SensitivityScenarioData instance, 2 currencies.

Definition at line 1870 of file testmarket.cpp.

1870 {
1871 QuantLib::ext::shared_ptr<ore::analytics::SensitivityScenarioData> sensiData =
1872 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData>();
1873
1875 cvsData.shiftTenors = {1 * Years, 2 * Years, 3 * Years, 5 * Years,
1876 7 * Years, 10 * Years, 15 * Years, 20 * Years}; // multiple tenors: triangular shifts
1877 cvsData.shiftType = ShiftType::Absolute;
1878 cvsData.shiftSize = 0.0001;
1879
1881 fxsData.shiftType = ShiftType::Relative;
1882 fxsData.shiftSize = 0.01;
1883
1885 fxvsData.shiftType = ShiftType::Relative;
1886 fxvsData.shiftSize = 1.0;
1887 fxvsData.shiftExpiries = {2 * Years, 5 * Years};
1888
1890 cfvsData.shiftType = ShiftType::Absolute;
1891 cfvsData.shiftSize = 0.0001;
1892 cfvsData.shiftExpiries = {1 * Years, 2 * Years, 3 * Years, 5 * Years, 10 * Years};
1893 cfvsData.shiftStrikes = {0.05};
1894
1896 swvsData.shiftType = ShiftType::Relative;
1897 swvsData.shiftSize = 0.01;
1898 swvsData.shiftExpiries = {3 * Years, 5 * Years, 10 * Years};
1899 swvsData.shiftTerms = {2 * Years, 5 * Years, 10 * Years};
1900
1901 sensiData->discountCurveShiftData()["EUR"] =
1902 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
1903
1904 sensiData->discountCurveShiftData()["GBP"] =
1905 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
1906
1907 sensiData->indexCurveShiftData()["EUR-EURIBOR-6M"] =
1908 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
1909 sensiData->indexCurveShiftData()["GBP-LIBOR-6M"] =
1910 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
1911
1912 sensiData->yieldCurveShiftData()["BondCurve0"] =
1913 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
1914
1915 sensiData->fxShiftData()["EURGBP"] = fxsData;
1916
1917 sensiData->fxVolShiftData()["EURGBP"] = fxvsData;
1918
1919 sensiData->swaptionVolShiftData()["EUR"] = swvsData;
1920 sensiData->swaptionVolShiftData()["GBP"] = swvsData;
1921
1922 sensiData->creditCurveShiftData()["BondIssuer0"] =
1923 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
1924
1925 // sensiData->capFloorVolLabel() = "VOL_CAPFLOOR";
1926 // sensiData->capFloorVolShiftData()["EUR"] = cfvsData;
1927 // sensiData->capFloorVolShiftData()["EUR"].indexName = "EUR-EURIBOR-6M";
1928 // sensiData->capFloorVolShiftData()["GBP"] = cfvsData;
1929 // sensiData->capFloorVolShiftData()["GBP"].indexName = "GBP-LIBOR-6M";
1930
1931 return sensiData;
1932}
+ Here is the caller graph for this function:

◆ setupSensitivityScenarioData5()

QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > setupSensitivityScenarioData5 ( )
static

SensitivityScenarioData instance, 5 currencies.

Definition at line 2002 of file testmarket.cpp.

2002 {
2003 QuantLib::ext::shared_ptr<ore::analytics::SensitivityScenarioData> sensiData =
2004 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData>();
2005
2007 cvsData.shiftTenors = {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years,
2008 7 * Years, 10 * Years, 15 * Years, 20 * Years}; // multiple tenors: triangular shifts
2009 cvsData.shiftType = ShiftType::Absolute;
2010 cvsData.shiftSize = 0.0001;
2011
2013 fxsData.shiftType = ShiftType::Relative;
2014 fxsData.shiftSize = 0.01;
2015
2017 fxvsData.shiftType = ShiftType::Relative;
2018 fxvsData.shiftSize = 1.0;
2019 fxvsData.shiftExpiries = {5 * Years};
2020
2022 cfvsData.shiftType = ShiftType::Absolute;
2023 cfvsData.shiftSize = 0.0001;
2024 cfvsData.shiftExpiries = {1 * Years, 2 * Years, 3 * Years, 5 * Years, 10 * Years};
2025 cfvsData.shiftStrikes = {0.01, 0.02, 0.03, 0.04, 0.05};
2026
2028 swvsData.shiftType = ShiftType::Relative;
2029 swvsData.shiftSize = 0.01;
2030 swvsData.shiftExpiries = {2 * Years, 5 * Years, 10 * Years};
2031 swvsData.shiftTerms = {5 * Years, 10 * Years};
2032
2034 eqsData.shiftType = ShiftType::Relative;
2035 eqsData.shiftSize = 0.01;
2036
2038 eqvsData.shiftType = ShiftType::Relative;
2039 eqvsData.shiftSize = 0.01;
2040 eqvsData.shiftExpiries = {5 * Years};
2041
2043 zinfData.shiftType = ShiftType::Absolute;
2044 zinfData.shiftSize = 0.0001;
2045 zinfData.shiftTenors = {1 * Years, 2 * Years, 3 * Years, 5 * Years, 7 * Years, 10 * Years, 15 * Years, 20 * Years};
2046
2047 auto commodityShiftData = QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>();
2048 commodityShiftData->shiftType = ShiftType::Relative;
2049 commodityShiftData->shiftSize = 0.01;
2050 commodityShiftData->shiftTenors = {0 * Days, 1 * Years, 2 * Years, 5 * Years};
2051
2053 commodityVolShiftData.shiftType = ShiftType::Relative;
2054 commodityVolShiftData.shiftSize = 0.01;
2055 commodityVolShiftData.shiftExpiries = {1 * Years, 2 * Years, 5 * Years};
2056 commodityVolShiftData.shiftStrikes = {0.9, 0.95, 1.0, 1.05, 1.1};
2057
2058 sensiData->discountCurveShiftData()["EUR"] =
2059 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
2060
2061 sensiData->discountCurveShiftData()["USD"] =
2062 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
2063
2064 sensiData->discountCurveShiftData()["GBP"] =
2065 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
2066
2067 sensiData->discountCurveShiftData()["JPY"] =
2068 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
2069
2070 sensiData->discountCurveShiftData()["CHF"] =
2071 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
2072
2073 sensiData->indexCurveShiftData()["EUR-EURIBOR-6M"] =
2074 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
2075
2076 sensiData->indexCurveShiftData()["USD-LIBOR-3M"] =
2077 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
2078
2079 sensiData->indexCurveShiftData()["GBP-LIBOR-6M"] =
2080 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
2081
2082 sensiData->indexCurveShiftData()["JPY-LIBOR-6M"] =
2083 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
2084
2085 sensiData->indexCurveShiftData()["CHF-LIBOR-6M"] =
2086 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
2087
2088 sensiData->yieldCurveShiftData()["BondCurve0"] =
2089 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
2090
2091 sensiData->creditCurveShiftData()["BondIssuer0"] =
2092 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
2093
2094 sensiData->fxShiftData()["EURUSD"] = fxsData;
2095 sensiData->fxShiftData()["EURGBP"] = fxsData;
2096 sensiData->fxShiftData()["EURJPY"] = fxsData;
2097 sensiData->fxShiftData()["EURCHF"] = fxsData;
2098
2099 sensiData->fxVolShiftData()["EURUSD"] = fxvsData;
2100 sensiData->fxVolShiftData()["EURGBP"] = fxvsData;
2101 sensiData->fxVolShiftData()["EURJPY"] = fxvsData;
2102 sensiData->fxVolShiftData()["EURCHF"] = fxvsData;
2103 sensiData->fxVolShiftData()["GBPCHF"] = fxvsData;
2104
2105 sensiData->swaptionVolShiftData()["EUR"] = swvsData;
2106 sensiData->swaptionVolShiftData()["GBP"] = swvsData;
2107 sensiData->swaptionVolShiftData()["USD"] = swvsData;
2108 sensiData->swaptionVolShiftData()["JPY"] = swvsData;
2109 sensiData->swaptionVolShiftData()["CHF"] = swvsData;
2110
2111 sensiData->capFloorVolShiftData()["EUR"] =
2112 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CapFloorVolShiftData>(cfvsData);
2113 sensiData->capFloorVolShiftData()["EUR"]->indexName = "EUR-EURIBOR-6M";
2114 sensiData->capFloorVolShiftData()["USD"] =
2115 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CapFloorVolShiftData>(cfvsData);
2116 sensiData->capFloorVolShiftData()["USD"]->indexName = "USD-LIBOR-3M";
2117
2118 sensiData->equityShiftData()["SP5"] = eqsData;
2119 sensiData->equityShiftData()["Lufthansa"] = eqsData;
2120
2121 sensiData->equityVolShiftData()["SP5"] = eqvsData;
2122 sensiData->equityVolShiftData()["Lufthansa"] = eqvsData;
2123
2124 sensiData->zeroInflationCurveShiftData()["UKRPI"] =
2125 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(zinfData);
2126
2127 sensiData->yoyInflationCurveShiftData()["UKRPI"] =
2128 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(zinfData);
2129
2130 sensiData->commodityCurveShiftData()["COMDTY_GOLD_USD"] = commodityShiftData;
2131 sensiData->commodityCurrencies()["COMDTY_GOLD_USD"] = "USD";
2132 sensiData->commodityCurveShiftData()["COMDTY_WTI_USD"] = commodityShiftData;
2133 sensiData->commodityCurrencies()["COMDTY_WTI_USD"] = "USD";
2134
2135 sensiData->commodityVolShiftData()["COMDTY_GOLD_USD"] = commodityVolShiftData;
2136 sensiData->commodityVolShiftData()["COMDTY_WTI_USD"] = commodityVolShiftData;
2137
2138 return sensiData;
2139}
+ Here is the caller graph for this function:

◆ setupSensitivityScenarioData2b()

QuantLib::ext::shared_ptr< ore::analytics::SensitivityScenarioData > setupSensitivityScenarioData2b ( )
static

SensitivityScenarioData instance, 2 currencies, shifts more granular than base curve.

Definition at line 1934 of file testmarket.cpp.

1934 {
1935 QuantLib::ext::shared_ptr<ore::analytics::SensitivityScenarioData> sensiData =
1936 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData>();
1937
1938 // shift curve has more points than underlying curve, has tenor points where the underlying curve hasn't, skips some
1939 // tenor points that occur in the underlying curve (e.g. 2Y, 3Y, 4Y)
1941 cvsData.shiftTenors = {1 * Years, 15 * Months, 18 * Months, 21 * Months, 27 * Months, 30 * Months, 33 * Months,
1942 42 * Months, 54 * Months, 5 * Years, 6 * Years, 7 * Years, 8 * Years, 9 * Years,
1943 10 * Years, 11 * Years, 12 * Years, 13 * Years, 14 * Years, 15 * Years, 16 * Years,
1944 17 * Years, 18 * Years, 19 * Years, 20 * Years};
1945 cvsData.shiftType = ShiftType::Absolute;
1946 cvsData.shiftSize = 0.0001;
1947
1949 fxsData.shiftType = ShiftType::Relative;
1950 fxsData.shiftSize = 0.01;
1951
1953 fxvsData.shiftType = ShiftType::Relative;
1954 fxvsData.shiftSize = 1.0;
1955 fxvsData.shiftExpiries = {2 * Years, 5 * Years};
1956
1958 cfvsData.shiftType = ShiftType::Absolute;
1959 cfvsData.shiftSize = 0.0001;
1960 cfvsData.shiftExpiries = {1 * Years, 2 * Years, 3 * Years, 5 * Years, 10 * Years};
1961 cfvsData.shiftStrikes = {0.05};
1962
1964 swvsData.shiftType = ShiftType::Relative;
1965 swvsData.shiftSize = 0.01;
1966 swvsData.shiftExpiries = {3 * Years, 5 * Years, 10 * Years};
1967 swvsData.shiftTerms = {2 * Years, 5 * Years, 10 * Years};
1968
1969 sensiData->discountCurveShiftData()["EUR"] =
1970 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
1971
1972 sensiData->discountCurveShiftData()["GBP"] =
1973 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
1974
1975 sensiData->indexCurveShiftData()["EUR-EURIBOR-6M"] =
1976 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
1977 sensiData->indexCurveShiftData()["GBP-LIBOR-6M"] =
1978 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
1979
1980 sensiData->yieldCurveShiftData()["BondCurve0"] =
1981 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
1982
1983 sensiData->fxShiftData()["EURGBP"] = fxsData;
1984
1985 sensiData->fxVolShiftData()["EURGBP"] = fxvsData;
1986
1987 sensiData->swaptionVolShiftData()["EUR"] = swvsData;
1988 sensiData->swaptionVolShiftData()["GBP"] = swvsData;
1989
1990 sensiData->creditCurveShiftData()["BondIssuer0"] =
1991 QuantLib::ext::make_shared<ore::analytics::SensitivityScenarioData::CurveShiftData>(cvsData);
1992
1993 // sensiData->capFloorVolLabel() = "VOL_CAPFLOOR";
1994 // sensiData->capFloorVolShiftData()["EUR"] = cfvsData;
1995 // sensiData->capFloorVolShiftData()["EUR"].indexName = "EUR-EURIBOR-6M";
1996 // sensiData->capFloorVolShiftData()["GBP"] = cfvsData;
1997 // sensiData->capFloorVolShiftData()["GBP"].indexName = "GBP-LIBOR-6M";
1998
1999 return sensiData;
2000}
+ Here is the caller graph for this function:

◆ setConventions()

void setConventions ( )
static

Set Conventions.

Definition at line 1182 of file testmarket.cpp.

1182 {
1183 QuantLib::ext::shared_ptr<Conventions> conventions = QuantLib::ext::make_shared<Conventions>();
1184
1185 // add conventions
1186 conventions->add(QuantLib::ext::make_shared<ore::data::SwapIndexConvention>("EUR-CMS-2Y", "EUR-6M-SWAP-CONVENTIONS"));
1187 conventions->add(QuantLib::ext::make_shared<ore::data::SwapIndexConvention>("EUR-CMS-30Y", "EUR-6M-SWAP-CONVENTIONS"));
1188 conventions->add(QuantLib::ext::make_shared<ore::data::SwapIndexConvention>("USD-CMS-1Y", "USD-3M-SWAP-CONVENTIONS"));
1189 conventions->add(QuantLib::ext::make_shared<ore::data::SwapIndexConvention>("USD-CMS-2Y", "USD-3M-SWAP-CONVENTIONS"));
1190 conventions->add(QuantLib::ext::make_shared<ore::data::SwapIndexConvention>("USD-CMS-30Y", "USD-3M-SWAP-CONVENTIONS"));
1191 conventions->add(QuantLib::ext::make_shared<ore::data::SwapIndexConvention>("GBP-CMS-2Y", "GBP-3M-SWAP-CONVENTIONS"));
1192 conventions->add(QuantLib::ext::make_shared<ore::data::SwapIndexConvention>("GBP-CMS-30Y", "GBP-6M-SWAP-CONVENTIONS"));
1193 conventions->add(QuantLib::ext::make_shared<ore::data::SwapIndexConvention>("CHF-CMS-2Y", "CHF-3M-SWAP-CONVENTIONS"));
1194 conventions->add(QuantLib::ext::make_shared<ore::data::SwapIndexConvention>("CHF-CMS-30Y", "CHF-6M-SWAP-CONVENTIONS"));
1195 conventions->add(QuantLib::ext::make_shared<ore::data::SwapIndexConvention>("JPY-CMS-1Y", "JPY-LIBOR-6M-SWAP-CONVENTIONS"));
1196 conventions->add(QuantLib::ext::make_shared<ore::data::SwapIndexConvention>("JPY-CMS-2Y", "JPY-LIBOR-6M-SWAP-CONVENTIONS"));
1197 conventions->add(QuantLib::ext::make_shared<ore::data::SwapIndexConvention>("JPY-CMS-30Y", "JPY-LIBOR-6M-SWAP-CONVENTIONS"));
1198
1199 conventions->add(QuantLib::ext::make_shared<ore::data::IRSwapConvention>("EUR-6M-SWAP-CONVENTIONS", "TARGET", "Annual", "MF", "30/360", "EUR-EURIBOR-6M"));
1200 conventions->add(QuantLib::ext::make_shared<ore::data::IRSwapConvention>("USD-3M-SWAP-CONVENTIONS", "US", "Semiannual", "MF", "30/360", "USD-LIBOR-3M"));
1201 conventions->add(QuantLib::ext::make_shared<ore::data::IRSwapConvention>("GBP-3M-SWAP-CONVENTIONS", "UK", "Semiannual", "MF", "A365", "GBP-LIBOR-3M"));
1202 conventions->add(QuantLib::ext::make_shared<ore::data::IRSwapConvention>("GBP-6M-SWAP-CONVENTIONS", "UK", "Semiannual", "MF", "A365", "GBP-LIBOR-6M"));
1203 conventions->add(QuantLib::ext::make_shared<ore::data::IRSwapConvention>("CHF-3M-SWAP-CONVENTIONS", "TARGET", "Annual", "MF", "30/360", "CHF-LIBOR-3M"));
1204 conventions->add(QuantLib::ext::make_shared<ore::data::IRSwapConvention>("CHF-6M-SWAP-CONVENTIONS", "TARGET", "Annual", "MF", "30/360", "CHF-LIBOR-6M"));
1205 conventions->add(QuantLib::ext::make_shared<ore::data::IRSwapConvention>("JPY-LIBOR-6M-SWAP-CONVENTIONS", "JP", "Semiannual", "MF", "A365", "JPY-LIBOR-6M"));
1206 conventions->add(QuantLib::ext::make_shared<ore::data::IRSwapConvention>("JPY-6M-SWAP-CONVENTIONS", "JP", "S", "MF", "ACT", "JPY-LIBOR-6M"));
1207 conventions->add(QuantLib::ext::make_shared<ore::data::IRSwapConvention>("USD-6M-SWAP-CONVENTIONS", "US", "S", "MF", "30/360", "USD-LIBOR-6M"));
1208
1209 conventions->add(QuantLib::ext::make_shared<ore::data::DepositConvention>("EUR-DEP-CONVENTIONS", "EUR-EURIBOR"));
1210 conventions->add(QuantLib::ext::make_shared<ore::data::DepositConvention>("USD-DEP-CONVENTIONS", "USD-LIBOR"));
1211 conventions->add(QuantLib::ext::make_shared<ore::data::DepositConvention>("GBP-DEP-CONVENTIONS", "GBP-LIBOR"));
1212 conventions->add(QuantLib::ext::make_shared<ore::data::DepositConvention>("JPY-DEP-CONVENTIONS", "JPY-LIBOR"));
1213 conventions->add(QuantLib::ext::make_shared<ore::data::DepositConvention>("CHF-DEP-CONVENTIONS", "CHF-LIBOR"));
1214
1215 conventions->add(QuantLib::ext::make_shared<ore::data::FraConvention>("EUR-FRA-CONVENTIONS", "EUR-EURIBOR-6M"));
1216 conventions->add(QuantLib::ext::make_shared<ore::data::FraConvention>("USD-FRA-CONVENTIONS", "USD-LIBOR-6M"));
1217 conventions->add(QuantLib::ext::make_shared<ore::data::FraConvention>("GBP-FRA-CONVENTIONS", "GBP-LIBOR-6M"));
1218 conventions->add(QuantLib::ext::make_shared<ore::data::FraConvention>("JPY-FRA-CONVENTIONS", "JPY-LIBOR-6M"));
1219 conventions->add(QuantLib::ext::make_shared<ore::data::FraConvention>("CHF-FRA-CONVENTIONS", "CHF-LIBOR-6M"));
1220
1221 conventions->add(QuantLib::ext::make_shared<FXConvention>("EUR-USD-FX", "0", "EUR", "USD", "10000", "EUR,USD"));
1222 conventions->add(QuantLib::ext::make_shared<FXConvention>("EUR-GBP-FX", "0", "EUR", "GBP", "10000", "EUR,GBP"));
1223 conventions->add(QuantLib::ext::make_shared<FXConvention>("EUR-CHF-FX", "0", "EUR", "CHF", "10000", "EUR,CHF"));
1224 conventions->add(QuantLib::ext::make_shared<FXConvention>("EUR-JPY-FX", "0", "EUR", "JPY", "10000", "EUR,JPY"));
1225
1226 conventions->add(QuantLib::ext::make_shared<ore::data::FXConvention>("CHF-FX-CONVENTIONS", "0", "CHF", "EUR", "10000",
1227 "CHF,EUR", "true"));
1228
1229 conventions->add(QuantLib::ext::make_shared<ore::data::OisConvention>(
1230 "JPY-OIS-CONVENTIONS", "2", "JPY-TONAR", "ACT/365", "JPY", "1", "false", "Annual", "MF", "MF", "Backward"));
1231
1232 conventions->add(QuantLib::ext::make_shared<ore::data::CdsConvention>(
1233 "CDS-STANDARD-CONVENTIONS", "0", "WeekendsOnly", "Quarterly", "Following", "CDS2015", "A360", "true", "true"));
1234
1235 conventions->add(QuantLib::ext::make_shared<ore::data::CrossCcyBasisSwapConvention>(
1236 "CHF-XCCY-BASIS-CONVENTIONS", "2", "CHF,EUR", "MF", "EUR-EURIBOR-6M", "CHF-LIBOR-6M", "false"));
1237
1238 conventions->add(QuantLib::ext::make_shared<ore::data::InflationSwapConvention>("UKRPI", "UK", "MF", "A365", "UKRPI",
1239 "false", "3M", "false", "UK", "MF"));
1240 conventions->add(QuantLib::ext::make_shared<ore::data::InflationSwapConvention>("UKRP1", "UK", "MF", "A365", "UKRPI",
1241 "false", "3M", "false", "UK", "MF"));
1242 InstrumentConventions::instance().setConventions(conventions);
1243}
+ Here is the caller graph for this function:

◆ setConventions2()

static void setConventions2 ( )
static