Skip to content

Commit c35529d

Browse files
author
sebastien.bouvard
committed
merge master
2 parents 1c5a1ca + a8e44a8 commit c35529d

10 files changed

Lines changed: 134 additions & 158 deletions

File tree

Docs/UserGuide/parameterisation/sensitivity.tex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,9 @@ \subsubsection*{Par Sensitivity Analysis}
341341
ParConversion Fields:
342342
343343
\begin{itemize}
344-
\item \textbf{Instruments} a comma separated list of par instrument types, see below for the possible values.
344+
\item \textbf{Instruments} a comma separated list of par instrument types, see below for the possible values. The
345+
3-letter instrument code can be extended by an arbitrary suffix to reference different conventions. For example, you
346+
can use FRA1, FRA2 in the instrument list to build FRA instruments with different convention ids FRA1, FRA2.
345347
\item \textbf{DiscountCurve} \textit{optional}: discount curve used for pricing the par instrument.
346348
\item \textbf{RateComputationPeriod} \textit{optional}: required for OIS CapFloors, sepcify the period of the optionlet.
347349
\end{itemize}

Docs/UserGuide/pricing/ir_capfloor.tex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,10 @@ \subsubsection{Pricing of an backward looking RFR caplet}
150150

151151
and which allows to price an RFR caplet as if it was a standard Ibor caplet with caplet volatility
152152
$\sigma_\text{eff}(t_1)$ and fixing time $t_1$. We do not use $\sigma_\text{eff}$ to represent caplet volatilities in
153-
bootstrapped or proxied caplet volatility surfaces for RFR underlyings. We also do not report $\sigma_\text{eff}$ as the
154-
pricing vol in the cashflow report. Instead we use $\sigma(t_0)$ in all cases (where we set $\sigma(t_0) := \sigma(0)$
155-
for $t_0 < 0$).
153+
bootstrapped or proxied caplet volatility surfaces for RFR underlyings. Instead we use $\sigma(t_0)$, where we set
154+
$\sigma(t_0) := \sigma(0)$ for $t_0 < 0$. However we report $\sigma_\text{eff}$ as ``EffectiveCapVolatility'',
155+
``EffectiveFloorVolatility'' in the cashflow report, in addition to ``CapVolatility'', ``FloorVolatility'' referring to
156+
$\sigma(t_0)$.
156157

157158
\subsubsection{Pricing of a SIFMA caplet}
158159

ORE-SWIG/OREAnalytics-SWIG/SWIG/orea_app.i

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ public:
208208
// Setters for stress testing
209209
void setStressThreshold(Real r);
210210
void setStressSimMarketParams(const std::string& xml);
211-
void setStressScenarioData(const std::string& xml);
211+
void setStressScenarioData(const std::string& xml);
212+
void setStressScenarioData(const ext::shared_ptr<StressTestScenarioData>& stressScenarioData);
212213
void setStressPricingEngine(const std::string& xml);
213214
void setStressPricingEngine(const ext::shared_ptr<EngineData>& engineData);
214215
// Setters for VaR

ORE-SWIG/OREAnalytics-SWIG/SWIG/orea_scenario.i

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ class StressTestScenarioData : public XMLSerializable {
8282
public:
8383
struct CurveShiftData {
8484
ShiftType shiftType;
85-
vector<Real> shifts;
86-
vector<Period> shiftTenors;
85+
std::vector<Real> shifts;
86+
std::vector<Period> shiftTenors;
8787
};
8888

8989
struct SpotShiftData {
@@ -93,8 +93,8 @@ class StressTestScenarioData : public XMLSerializable {
9393

9494
struct VolShiftData {
9595
ShiftType shiftType;
96-
vector<Period> shiftExpiries;
97-
vector<Real> shifts;
96+
std::vector<Period> shiftExpiries;
97+
std::vector<Real> shifts;
9898
};
9999

100100
struct FXVolShiftData {
@@ -104,35 +104,35 @@ class StressTestScenarioData : public XMLSerializable {
104104
Weighted
105105
};
106106
ShiftType shiftType;
107-
vector<Period> shiftExpiries;
108-
vector<Real> shifts;
109-
vector<Period> weightTenors;
110-
vector<Real> weights;
107+
std::vector<Period> shiftExpiries;
108+
std::vector<Real> shifts;
109+
std::vector<Period> weightTenors;
110+
std::vector<Real> weights;
111111
AtmShiftMode mode = AtmShiftMode::Explicit;
112112
};
113113

114114
struct CapFloorVolShiftData {
115115
ShiftType shiftType;
116-
vector<Period> shiftExpiries;
117-
vector<double> shiftStrikes;
118-
std::map<Period, vector<Real>> shifts;
116+
std::vector<Period> shiftExpiries;
117+
std::vector<double> shiftStrikes;
118+
std::map<Period, std::vector<Real>> shifts;
119119
};
120120
struct SwaptionVolShiftData {
121121
ShiftType shiftType;
122122
Real parallelShiftSize;
123-
vector<Period> shiftExpiries;
124-
vector<Period> shiftTerms;
125-
map<pair<Period, Period>, Real> shifts;
123+
std::vector<Period> shiftExpiries;
124+
std::vector<Period> shiftTerms;
125+
std::map<std::pair<Period, Period>, Real> shifts;
126126
};
127127
struct CommodityVolShiftData {
128128
ShiftType shiftType;
129-
vector<Period> shiftExpiries;
130-
vector<Real> shiftMoneyness;
131-
vector<Real> shifts;
129+
std::vector<Period> shiftExpiries;
130+
std::vector<Real> shiftMoneyness;
131+
std::vector<Real> shifts;
132132
};
133133
struct StressTestData {
134134
~StressTestData() {}
135-
string label;
135+
std::string label;
136136
bool irCurveParShifts;
137137
bool irCapFloorParShifts;
138138
bool creditCurveParShifts;

ORE-SWIG/setup.py

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@
55
"""
66

77
import os, sys, math, codecs
8-
from distutils.cmd import Command
9-
from distutils.command.build_ext import build_ext
10-
from distutils.command.build import build
11-
from distutils.ccompiler import get_default_compiler
12-
try:
13-
from setuptools import setup, Extension
14-
except:
8+
if sys.version_info < (3,10):
9+
from distutils.cmd import Command
10+
from distutils.command.build_ext import build_ext
11+
from distutils.command.build import build
12+
from distutils.ccompiler import get_default_compiler
1513
from distutils.core import setup, Extension
16-
from distutils import sysconfig
14+
from distutils import sysconfig
15+
else:
16+
from setuptools import Command
17+
from setuptools.command.build_ext import build_ext
18+
from setuptools.command.build import build
19+
from setuptools._distutils.ccompiler import get_default_compiler
20+
from setuptools import setup, Extension
1721

1822
class test(Command):
1923
# Original version of this class posted
@@ -68,22 +72,13 @@ def run(self):
6872
qle_swig_dir = os.path.join("QuantExt-SWIG","SWIG")
6973
oredata_swig_dir = os.path.join("OREData-SWIG","SWIG")
7074
orea_swig_dir = os.path.join("OREAnalytics-SWIG","SWIG")
71-
if sys.version_info.major >= 3:
72-
os.system('swig -python -c++ ' +
73-
'-I%s ' % ql_swig_dir +
74-
'-I%s ' % qle_swig_dir +
75-
'-I%s ' % oredata_swig_dir +
76-
'-I%s ' % orea_swig_dir +
77-
'-o oreanalytics_wrap.cpp ' +
78-
os.path.join("OREAnalytics-SWIG","SWIG","oreanalytics.i"))
79-
else:
80-
os.system('swig -python -c++ ' +
81-
'-I%s ' % ql_swig_dir +
82-
'-I%s ' % qle_swig_dir +
83-
'-I%s ' % oredata_swig_dir +
84-
'-I%s ' % orea_swig_dir +
85-
'-o oreanalytics_wrap.cpp ' +
86-
os.path.join("OREAnalytics-SWIG","SWIG","oreanalytics.i"))
75+
os.system('swig -python -c++ ' +
76+
'-I%s ' % ql_swig_dir +
77+
'-I%s ' % qle_swig_dir +
78+
'-I%s ' % oredata_swig_dir +
79+
'-I%s ' % orea_swig_dir +
80+
'-o oreanalytics_wrap.cpp ' +
81+
os.path.join("OREAnalytics-SWIG","SWIG","oreanalytics.i"))
8782

8883
class my_build(build):
8984
user_options = build.user_options + [
@@ -264,13 +259,6 @@ def finalize_options(self):
264259

265260
datafiles = []
266261

267-
# patch distutils if it can't cope with the "classifiers" or
268-
# "download_url" keywords
269-
if sys.version < '2.2.3':
270-
from distutils.dist import DistributionMetadata
271-
DistributionMetadata.classifiers = None
272-
DistributionMetadata.download_url = None
273-
274262
classifiers = [
275263
'Development Status :: 5 - Production/Stable',
276264
'Environment :: Console',
@@ -297,7 +285,7 @@ def finalize_options(self):
297285
""",
298286
author = "Quaternion Risk Management",
299287
author_email = "info@quaternion.com",
300-
url = "http://quaternion.com",
288+
url = "http://opensourcerisk.org/",
301289
license = codecs.open('LICENSE.txt','r+',
302290
encoding='utf8').read(),
303291
classifiers = classifiers,

ORE-SWIG/tutorials.03.build_windows.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ its prerequisites, e.g:
4848
SET ZLIB_ROOT=C:\repos\vcpkg\packages\zlib_x64-windows (optional)
4949
SET ORE_DIR=C:\repos\ore
5050

51-
# Build ORE and ORE-SWIG
51+
# Build ORE and ORESWIG
5252

53-
There are two ways to build ORESWIG: using **cmake**, or using **setup.py**.
54-
With cmake, you can generate the wrapper. With setup.py you can generate both
55-
the wrapper and the wheel. Regardless, ORE libraries must be built first.
53+
You can use **cmake** to build ORE and the ORESWIG wrapper. You can use
54+
**setup.py** to build the ORESWIG wrapper and wheel. If you use setup.py to
55+
build ORE-SWIG, you must first build ORE.
5656

5757
## Build ORE/ORESWIG via CMake
5858

@@ -70,7 +70,7 @@ Make sure to add the location of the ORE-SWIG package to your PYTHONPATH, e.g:
7070

7171
SET PYTHONPATH=%ORE_DIR%\build\ORE-SWIG;%ORE_DIR%\build\ORE-SWIG\Release
7272

73-
## Build ORE/ORESWIG via setup.py
73+
## Build ORESWIG via setup.py
7474

7575
If using the setup.py method, you would have to build ORE with cmake as
7676
demonstrated above, but, when configuring cmake, disable the SWIG build with:
@@ -84,6 +84,8 @@ we create a virtual environment into which we install the packages required by
8484
setup.py.
8585

8686
cd %ORE_DIR%\ORE-SWIG
87+
SET BOOST=C:\repos\boost\boost_1_72_0
88+
SET BOOST_LIB64=C:\repos\boost\boost_1_72_0\lib64-msvc-14.2
8789
SET ORE_STATIC_RUNTIME=1
8890
SET ORE_USE_ZLIB=1
8991
SET PATH=%PATH%;C:\path\to\swig
@@ -116,9 +118,9 @@ not then `cube.dat` is generated as a flat (plain text) file.
116118
## Build the wheel with setup.py
117119

118120
Whether you used cmake or setup.py above to build the wrapper, you can use
119-
setup.py to build the wheel. If you used setup.py then you already have the
120-
python virtual environment, and you can reuse it, otherwise you can create a
121-
new one as shown below.
121+
setup.py to build the wheel. If you used setup.py before then you already have
122+
the python virtual environment, and you can reuse it, otherwise you can create
123+
a new one as shown below.
122124

123125
cd %ORE_DIR%\ORE-SWIG
124126
SET BOOST=C:\repos\boost\boost_1_72_0

0 commit comments

Comments
 (0)