Skip to content

Commit a7d45a2

Browse files
pcaspersjenkins
authored andcommitted
QPR-11990 generate scenario in ore
1 parent 7f382e8 commit a7d45a2

17 files changed

Lines changed: 364 additions & 4 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#Date,Scenario,Numeraire,DiscountCurve/EUR/0,DiscountCurve/EUR/1,DiscountCurve/EUR/2,DiscountCurve/EUR/3,DiscountCurve/EUR/4,DiscountCurve/EUR/5,DiscountCurve/EUR/6,DiscountCurve/EUR/7,DiscountCurve/EUR/8,DiscountCurve/EUR/9,DiscountCurve/EUR/10,DiscountCurve/EUR/11,DiscountCurve/USD/0,DiscountCurve/USD/1,DiscountCurve/USD/2,DiscountCurve/USD/3,DiscountCurve/USD/4,DiscountCurve/USD/5,DiscountCurve/USD/6,DiscountCurve/USD/7,DiscountCurve/USD/8,DiscountCurve/USD/9,DiscountCurve/USD/10,DiscountCurve/USD/11,IndexCurve/EUR-EONIA/0,IndexCurve/EUR-EONIA/1,IndexCurve/EUR-EONIA/2,IndexCurve/EUR-EONIA/3,IndexCurve/EUR-EONIA/4,IndexCurve/EUR-EONIA/5,IndexCurve/EUR-EONIA/6,IndexCurve/EUR-EONIA/7,IndexCurve/EUR-EONIA/8,IndexCurve/EUR-EONIA/9,IndexCurve/EUR-EONIA/10,IndexCurve/EUR-EONIA/11,IndexCurve/EUR-EURIBOR-3M/0,IndexCurve/EUR-EURIBOR-3M/1,IndexCurve/EUR-EURIBOR-3M/2,IndexCurve/EUR-EURIBOR-3M/3,IndexCurve/EUR-EURIBOR-3M/4,IndexCurve/EUR-EURIBOR-3M/5,IndexCurve/EUR-EURIBOR-3M/6,IndexCurve/EUR-EURIBOR-3M/7,IndexCurve/EUR-EURIBOR-3M/8,IndexCurve/EUR-EURIBOR-3M/9,IndexCurve/EUR-EURIBOR-3M/10,IndexCurve/EUR-EURIBOR-3M/11,IndexCurve/USD-FedFunds/0,IndexCurve/USD-FedFunds/1,IndexCurve/USD-FedFunds/2,IndexCurve/USD-FedFunds/3,IndexCurve/USD-FedFunds/4,IndexCurve/USD-FedFunds/5,IndexCurve/USD-FedFunds/6,IndexCurve/USD-FedFunds/7,IndexCurve/USD-FedFunds/8,IndexCurve/USD-FedFunds/9,IndexCurve/USD-FedFunds/10,IndexCurve/USD-FedFunds/11
2+
2016-02-05,1,1.00000000,0.99922271,0.99839123,0.99502396,0.98998808,0.98006773,0.96058946,0.94150059,0.90439805,0.81798217,0.73982380,0.66913343,0.54733975,0.96323035,0.92533328,0.78597395,0.62324611,0.42279399,0.80495132,0.77890061,0.71785604,0.59886312,0.50998082,0.43073596,0.30080571,0.99922271,0.99839123,0.99502396,0.98998808,0.98006773,0.96058946,0.94150059,0.90439805,0.81798217,0.73982380,0.66913343,0.54733975,0.99922281,0.99839130,0.99502399,0.99545439,0.99628459,1.00345900,1.00431973,0.99920773,0.94178829,0.86397679,0.80298042,0.71169139,0.99982649,0.99964082,0.99879515,0.99737205,0.99434185,0.98710681,0.97871928,0.95417112,0.87291300,0.78061520,0.69840036,0.56555320

Examples/Example_55/Input/ore.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0"?>
2+
<ORE>
3+
<Setup>
4+
<Parameter name="asofDate">2016-02-05</Parameter>
5+
<Parameter name="inputPath">Input</Parameter>
6+
<Parameter name="outputPath">Output</Parameter>
7+
<Parameter name="logFile">log.txt</Parameter>
8+
<Parameter name="logMask">31</Parameter>
9+
<Parameter name="marketDataFile">../../Input/market_20160205_flat.txt</Parameter>
10+
<Parameter name="fixingDataFile">../../Input/fixings_20160205.txt</Parameter>
11+
<Parameter name="implyTodaysFixings">N</Parameter>
12+
<Parameter name="curveConfigFile">../../Input/curveconfig.xml</Parameter>
13+
<Parameter name="conventionsFile">../../Input/conventions.xml</Parameter>
14+
<Parameter name="marketConfigFile">../../Input/todaysmarket.xml</Parameter>
15+
<Parameter name="pricingEnginesFile">../../Input/pricingengine.xml</Parameter>
16+
<Parameter name="observationModel">None</Parameter>
17+
<Parameter name="baseCurrency">EUR</Parameter>
18+
<Parameter name="nThreads">1</Parameter>
19+
</Setup>
20+
<Markets>
21+
<Parameter name="lgmcalibration">collateral_inccy</Parameter>
22+
<Parameter name="fxcalibration">xois_eur</Parameter>
23+
<Parameter name="pricing">xois_eur</Parameter>
24+
<Parameter name="simulation">xois_eur</Parameter>
25+
<Parameter name="sensitivity">xois_eur</Parameter>
26+
</Markets>
27+
<Analytics>
28+
<Analytic type="scenario">
29+
<Parameter name="active">Y</Parameter>
30+
<Parameter name="simulationConfigFile">simulation.xml</Parameter>
31+
<Parameter name="scenarioOutputFile">scenario.csv</Parameter>
32+
</Analytic>
33+
</Analytics>
34+
</ORE>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0"?>
2+
<PricingEngines>
3+
<Product type="ScriptedTrade">
4+
<Model>Generic</Model>
5+
<ModelParameters>
6+
<Parameter name="Model">GaussianCam</Parameter>
7+
<Parameter name="BaseCcy">USD</Parameter>
8+
<Parameter name="EnforceBaseCcy">false</Parameter>
9+
<Parameter name="GridCoarsening">3M(1W),1Y(1M),5Y(3M),10Y(1Y),50Y(5Y)</Parameter>
10+
<Parameter name="IrReversion_EUR">0.01</Parameter>
11+
<Parameter name="IrReversion_GBP">0.01</Parameter>
12+
<Parameter name="FullDynamicFx">true</Parameter>
13+
<Parameter name="FullDynamicIr">true</Parameter>
14+
<!-- DK or JY -->
15+
<Parameter name="InfModelType">JY</Parameter>
16+
</ModelParameters>
17+
<Engine>Generic</Engine>
18+
<EngineParameters>
19+
<Parameter name="Engine">MC</Parameter>
20+
<Parameter name="Samples">10000</Parameter>
21+
<Parameter name="RegressionOrder">4</Parameter>
22+
<Parameter name="TimeStepsPerYear">24</Parameter>
23+
<Parameter name="Interactive">false</Parameter>
24+
<Parameter name="BootstrapTolerance">1.0</Parameter>
25+
<Parameter name="ZeroVolatility">false</Parameter>
26+
<Parameter name="Interactive">false</Parameter>
27+
</EngineParameters>
28+
</Product>
29+
<GlobalParameters>
30+
<Parameter name="ContinueOnCalibrationError">true</Parameter>
31+
</GlobalParameters>
32+
</PricingEngines>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Simulation>
2+
<Market>
3+
<BaseCurrency>EUR</BaseCurrency>
4+
<Currencies>
5+
<Currency>USD</Currency>
6+
<Currency>EUR</Currency>
7+
</Currencies>
8+
<YieldCurves>
9+
<Configuration curve="">
10+
<Tenors>2W, 1M, 3M, 6M, 1Y, 2Y, 3Y, 5Y, 10Y, 15Y, 20Y, 30Y</Tenors>
11+
<Interpolation>LogLinear</Interpolation>
12+
<Extrapolation>FlatZero</Extrapolation>
13+
</Configuration>
14+
</YieldCurves>
15+
<Indices>
16+
<Index>USD-FedFunds</Index>
17+
<Index>USD-Libor-3M</Index>
18+
<Index>EUR-EONIA</Index>
19+
<Index>EUR-EURIBOR-3M</Index>
20+
</Indices>
21+
<BenchmarkCurves/>
22+
<FxRates>
23+
<CurrencyPairs/>
24+
</FxRates>
25+
</Market>
26+
</Simulation>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<TodaysMarket>
2+
<Configuration id="default">
3+
<YieldCurvesId>default</YieldCurvesId>
4+
<DiscountingCurvesId>default</DiscountingCurvesId>
5+
<IndexForwardingCurvesId>default</IndexForwardingCurvesId>
6+
<SwapIndexCurvesId>default</SwapIndexCurvesId>
7+
<ZeroInflationIndexCurvesId>default</ZeroInflationIndexCurvesId>
8+
<YYInflationIndexCurvesId>default</YYInflationIndexCurvesId>
9+
<FxSpotsId>default</FxSpotsId>
10+
<FxVolatilitiesId>default</FxVolatilitiesId>
11+
<SwaptionVolatilitiesId>default</SwaptionVolatilitiesId>
12+
<YieldVolatilitiesId>default</YieldVolatilitiesId>
13+
<CapFloorVolatilitiesId>default</CapFloorVolatilitiesId>
14+
<CDSVolatilitiesId>default</CDSVolatilitiesId>
15+
<DefaultCurvesId>default</DefaultCurvesId>
16+
<YYInflationCapFloorVolatilitiesId>default</YYInflationCapFloorVolatilitiesId>
17+
<ZeroInflationCapFloorVolatilitiesId>default</ZeroInflationCapFloorVolatilitiesId>
18+
<EquityCurvesId>default</EquityCurvesId>
19+
<EquityVolatilitiesId>default</EquityVolatilitiesId>
20+
<SecuritiesId>default</SecuritiesId>
21+
<BaseCorrelationsId>default</BaseCorrelationsId>
22+
<CommodityCurvesId>default</CommodityCurvesId>
23+
<CommodityVolatilitiesId>default</CommodityVolatilitiesId>
24+
<CorrelationsId>default</CorrelationsId>
25+
</Configuration>
26+
<DiscountingCurves id="default">
27+
<DiscountingCurve currency="USD">Yield/EUR/EUR-EONIA</DiscountingCurve>
28+
<DiscountingCurve currency="AUD">Yield/AUD/AUD-IN-USD</DiscountingCurve>
29+
<DiscountingCurve currency="TRY">Yield/TRY/TRY-IN-USD</DiscountingCurve>
30+
<DiscountingCurve currency="AMD">Yield/AMD/AMD-IN-USD</DiscountingCurve>
31+
<DiscountingCurve currency="EUR">Yield/EUR/EUR-IN-USD</DiscountingCurve>
32+
</DiscountingCurves>
33+
<IndexForwardingCurves id="default">
34+
<Index name="USD-FedFunds">Yield/USD/USD-FedFunds</Index>
35+
<Index name="EUR-EONIA">Yield/EUR/EUR-EONIA</Index>
36+
<Index name="EUR-ESTER">Yield/EUR/EUR-ESTER</Index>
37+
<Index name="EUR-EURIBOR-3M">Yield/EUR/EUR-EURIBOR-3M</Index>
38+
<Index name="USD-SOFR">Yield/USD/USD-SOFR</Index>
39+
<Index name="USD-LIBOR-3M">Yield/USD/USD-LIBOR-3M</Index>
40+
</IndexForwardingCurves>
41+
<FxSpots id="default">
42+
<FxSpot pair="EURUSD">FX/EUR/USD</FxSpot>
43+
</FxSpots>
44+
</TodaysMarket>

Examples/Example_55/Readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Example using experimental xva cg engine.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"csv_settings": {
3+
"files": {
4+
"scenario.csv": {
5+
"keys": [
6+
"Date",
7+
"Scenario"
8+
]
9+
}
10+
}
11+
}
12+
}

Examples/Example_55/run.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python
2+
3+
import glob
4+
import os
5+
import sys
6+
sys.path.append('../')
7+
from ore_examples_helper import OreExample
8+
9+
oreex = OreExample(sys.argv[1] if len(sys.argv)>1 else False)
10+
11+
oreex.print_headline("Run ORE to produce AMC CG exposure")
12+
oreex.run("Input/ore.xml")

OREAnalytics/orea/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ aggregation/xvacalculator.cpp
1818
app/analytic.cpp
1919
app/analytics/parconversionanalytic.cpp
2020
app/analytics/pricinganalytic.cpp
21+
app/analytics/scenarioanalytic.cpp
2122
app/analytics/scenariostatisticsanalytic.cpp
2223
app/analytics/simmanalytic.cpp
2324
app/analytics/varanalytic.cpp
@@ -150,6 +151,7 @@ aggregation/xvacalculator.hpp
150151
app/analytic.hpp
151152
app/analytics/parconversionanalytic.hpp
152153
app/analytics/pricinganalytic.hpp
154+
app/analytics/scenarioanalytic.hpp
153155
app/analytics/scenariostatisticsanalytic.hpp
154156
app/analytics/simmanalytic.hpp
155157
app/analytics/varanalytic.hpp

OREAnalytics/orea/app/analytic.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,9 @@ class Analytic {
147147

148148
virtual std::set<QuantLib::Date> marketDates() const { return {inputs_->asof()}; }
149149

150-
private:
150+
protected:
151151
std::unique_ptr<Impl> impl_;
152152

153-
protected:
154153
//! list of analytic types run by this analytic
155154
std::set<std::string> types_;
156155
//! contains all the input parameters for the run

0 commit comments

Comments
 (0)