@@ -1379,6 +1379,10 @@ void OREAppInputParameters::loadParameters() {
13791379 if (!tmp.empty () && parseBool (tmp))
13801380 insertAnalytic (" XVA_STRESS" );
13811381
1382+ tmp = params_->get (" xvaSensitivity" , " active" , false );
1383+ if (!tmp.empty () && parseBool (tmp))
1384+ insertAnalytic (" XVA_SENSITIVITY" );
1385+
13821386 tmp = params_->get (" simulation" , " salvageCorrelationMatrix" , false );
13831387 if (tmp != " " )
13841388 setSalvageCorrelationMatrix (parseBool (tmp));
@@ -1407,7 +1411,8 @@ void OREAppInputParameters::loadParameters() {
14071411 setExposureBaseCurrency (baseCurrency ());
14081412
14091413 if (analytics ().find (" EXPOSURE" ) != analytics ().end () || analytics ().find (" XVA" ) != analytics ().end () ||
1410- analytics ().find (" XVA_STRESS" ) != analytics ().end ()) {
1414+ analytics ().find (" XVA_STRESS" ) != analytics ().end () ||
1415+ analytics ().find (" XVA_SENSITIVITY" ) != analytics ().end ()) {
14111416 tmp = params_->get (" simulation" , " simulationConfigFile" , false );
14121417 if (tmp != " " ) {
14131418 string simulationConfigFile = (inputPath / tmp).generic_string ();
@@ -1505,7 +1510,8 @@ void OREAppInputParameters::loadParameters() {
15051510 }
15061511 }
15071512
1508- if (analytics ().find (" XVA" ) != analytics ().end () || analytics ().find (" XVA_STRESS" ) != analytics ().end ()) {
1513+ if (analytics ().find (" XVA" ) != analytics ().end () || analytics ().find (" XVA_STRESS" ) != analytics ().end () ||
1514+ analytics ().find (" XVA_SENSITIVITY" ) != analytics ().end ()) {
15091515 tmp = params_->get (" xva" , " csaFile" , false );
15101516 QL_REQUIRE (tmp != " " , " Netting set manager is required for XVA" );
15111517 string csaFile = (inputPath / tmp).generic_string ();
@@ -1818,6 +1824,30 @@ void OREAppInputParameters::loadParameters() {
18181824 }
18191825 }
18201826
1827+ /* ************
1828+ * XVA Sensi
1829+ *************/
1830+
1831+ if (analytics ().find (" XVA_SENSITIVITY" ) != analytics ().end ()) {
1832+ tmp = params_->get (" xvaSensitivity" , " marketConfigFile" , false );
1833+ if (!tmp.empty ()) {
1834+ string file = (inputPath / tmp).generic_string ();
1835+ LOG (" Loading xva stress test scenario sim market parameters from file" << file);
1836+ setXvaSensiSimMarketParamsFromFile (file);
1837+ } else {
1838+ WLOG (" ScenarioSimMarket parameters for xva stress testing not loaded" );
1839+ }
1840+
1841+ tmp = params_->get (" xvaStress" , " sensitivityConfigFile" , false );
1842+ if (!tmp.empty ()) {
1843+ string file = (inputPath / tmp).generic_string ();
1844+ LOG (" Load xav stress test scenario data from file" << file);
1845+ setXvaSensiScenarioDataFromFile (file);
1846+ } else {
1847+ WLOG (" Xva Stress scenario data not loaded" );
1848+ }
1849+ }
1850+
18211851 /* ************
18221852 * cashflow npv and dynamic backtesting
18231853 *************/
0 commit comments