Skip to content

Commit f5584ca

Browse files
Merge remote-tracking branch 'origin/master' into github_modules
2 parents 8cba423 + 620091f commit f5584ca

398 files changed

Lines changed: 24341 additions & 3398 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[submodule "QuantLib"]
22
path = QuantLib
3-
url = git@github.com:OpenSourceRisk/QuantLib.git
3+
url = git@gitlab.acadiasoft.net:qs/quantlib.git
44
branch = master
55
ignore = dirty

App/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ target_link_libraries(ore ${QLE_LIB_NAME})
3434
target_link_libraries(ore ${QL_LIB_NAME})
3535
target_link_libraries(ore ${Boost_LIBRARIES})
3636

37+
if(MSVC AND MSVC_WHOLE_PROGRAM_OPTIMIZATION)
38+
target_compile_options(ore PRIVATE "$<$<CONFIG:RelWithDebInfo>:/GL>")
39+
target_link_options(ore PRIVATE "$<$<CONFIG:RelWithDebInfo>:/INCREMENTAL:NO>")
40+
target_link_options(ore PRIVATE "$<$<CONFIG:RelWithDebInfo>:/LTCG>")
41+
target_link_options(ore PRIVATE "$<$<CONFIG:RelWithDebInfo>:/OPT:REF>")
42+
target_link_options(ore PRIVATE "$<$<CONFIG:RelWithDebInfo>:/OPT:ICF>")
43+
endif()
44+
3745
install(TARGETS ore
3846
RUNTIME DESTINATION bin
3947
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE

CMakePresets.json

Lines changed: 104 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,83 @@
11
{
22
"version": 2,
33
"configurePresets": [
4+
{
5+
"name": "windows-ninja-x64-relWithDebInfo",
6+
"binaryDir": "${sourceDir}/build",
7+
"generator": "Ninja",
8+
"cacheVariables": {
9+
"CMAKE_C_COMPILER": "cl.exe",
10+
"CMAKE_CXX_COMPILER": "cl.exe",
11+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
12+
"BOOST_INCLUDEDIR": "$env{BOOST}",
13+
"BOOST_LIBRARYDIR": "$env{BOOST_LIB64}",
14+
"QL_BUILD_EXAMPLES": false,
15+
"QL_BUILD_TEST_SUITE": false,
16+
"QL_BUILD_BENCHMARK": false,
17+
"MSVC_LINK_DYNAMIC_RUNTIME": true,
18+
"MSVC_WHOLE_PROGRAM_OPTIMIZATION": true,
19+
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
20+
},
21+
"architecture": {
22+
"value": "x64",
23+
"strategy": "external"
24+
},
25+
"vendor": {
26+
"microsoft.com/VisualStudioSettings/CMake/1.0": {
27+
"intelliSenseMode": "windows-msvc-x64",
28+
"hostOS": [
29+
"Windows"
30+
]
31+
}
32+
}
33+
},
34+
{
35+
"name": "windows-ninja-x64-debug",
36+
"binaryDir": "${sourceDir}/build",
37+
"generator": "Ninja",
38+
"cacheVariables": {
39+
"CMAKE_C_COMPILER": "cl.exe",
40+
"CMAKE_CXX_COMPILER": "cl.exe",
41+
"CMAKE_BUILD_TYPE": "Debug",
42+
"BOOST_INCLUDEDIR": "$env{BOOST}",
43+
"BOOST_LIBRARYDIR": "$env{BOOST_LIB64}",
44+
"QL_BUILD_EXAMPLES": false,
45+
"QL_BUILD_TEST_SUITE": false,
46+
"QL_BUILD_BENCHMARK": false,
47+
"MSVC_LINK_DYNAMIC_RUNTIME": false,
48+
"MSVC_WHOLE_PROGRAM_OPTIMIZATION": false,
49+
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
50+
},
51+
"architecture": {
52+
"value": "x64",
53+
"strategy": "external"
54+
},
55+
"vendor": {
56+
"microsoft.com/VisualStudioSettings/CMake/1.0": {
57+
"intelliSenseMode": "windows-msvc-x64",
58+
"hostOS": [
59+
"Windows"
60+
]
61+
}
62+
}
63+
},
464
{
565
"name": "windows-msvc-x64",
666
"binaryDir": "${sourceDir}/build",
767
"generator": "Visual Studio 17 2022",
868
"cacheVariables": {
9-
"Boost_DIR": "$env{BOOST}",
10-
"Boost_INCLUDE_DIR": "$env{BOOST_INCLUDE_DIR}",
11-
"Boost_LIBRARY_DIR": "$env{BOOST_LIBRARYDIR}",
69+
"BOOST_INCLUDEDIR": "$env{BOOST}",
70+
"BOOST_LIBRARYDIR": "$env{BOOST_LIB64}",
71+
"QL_BUILD_EXAMPLES": false,
72+
"QL_BUILD_TEST_SUITE": false,
73+
"QL_BUILD_BENCHMARK": false,
1274
"MSVC_LINK_DYNAMIC_RUNTIME": true,
13-
"OREPLUS_LICENSE": false
75+
"MSVC_WHOLE_PROGRAM_OPTIMIZATION": true,
76+
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
1477
},
1578
"architecture": {
1679
"value": "x64",
17-
"strategy": "external"
80+
"strategy": "set"
1881
},
1982
"vendor": {
2083
"microsoft.com/VisualStudioSettings/CMake/1.0": {
@@ -30,15 +93,18 @@
3093
"binaryDir": "${sourceDir}/build",
3194
"generator": "Visual Studio 17 2022",
3295
"cacheVariables": {
33-
"Boost_DIR": "$env{BOOST}",
34-
"Boost_INCLUDE_DIR": "$env{BOOST_INCLUDE_DIR}",
35-
"Boost_LIBRARY_DIR": "$env{BOOST_LIBRARYDIR}",
96+
"BOOST_INCLUDEDIR": "$env{BOOST}",
97+
"BOOST_LIBRARYDIR": "$env{BOOST_LIB64}",
98+
"QL_BUILD_EXAMPLES": false,
99+
"QL_BUILD_TEST_SUITE": false,
100+
"QL_BUILD_BENCHMARK": false,
36101
"MSVC_LINK_DYNAMIC_RUNTIME": false,
37-
"OREPLUS_LICENSE": false
102+
"MSVC_WHOLE_PROGRAM_OPTIMIZATION": true,
103+
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
38104
},
39105
"architecture": {
40106
"value": "x64",
41-
"strategy": "external"
107+
"strategy": "set"
42108
},
43109
"vendor": {
44110
"microsoft.com/VisualStudioSettings/CMake/1.0": {
@@ -52,24 +118,46 @@
52118
],
53119
"buildPresets": [
54120
{
55-
"name": "windows-msvc-x64-release",
56-
"configurePreset": "windows-msvc-x64",
121+
"name": "windows-ninja-x64-relWithDebInfo",
122+
"configurePreset": "windows-ninja-x64-relWithDebInfo",
57123
"configuration": "RelWithDebInfo"
58124
},
125+
{
126+
"name": "windows-ninja-x64-debug",
127+
"configurePreset": "windows-ninja-x64-debug",
128+
"configuration": "Debug"
129+
},
130+
{
131+
"name": "windows-msvc-x64-relWithDebInfo",
132+
"configurePreset": "windows-msvc-x64",
133+
"configuration": "RelWithDebInfo",
134+
"nativeToolOptions": [
135+
"-m"
136+
]
137+
},
59138
{
60139
"name": "windows-msvc-x64-debug",
61140
"configurePreset": "windows-msvc-x64",
62-
"configuration": "Debug"
141+
"configuration": "Debug",
142+
"nativeToolOptions": [
143+
"-m"
144+
]
63145
},
64146
{
65-
"name": "windows-msvc-x64-static-release",
147+
"name": "windows-msvc-x64-static-relWithDebInfo",
66148
"configurePreset": "windows-msvc-x64-static",
67-
"configuration": "RelWithDebInfo"
149+
"configuration": "RelWithDebInfo",
150+
"nativeToolOptions": [
151+
"-m"
152+
]
68153
},
69154
{
70155
"name": "windows-msvc-x64-static-debug",
71156
"configurePreset": "windows-msvc-x64-static",
72-
"configuration": "Debug"
157+
"configuration": "Debug",
158+
"nativeToolOptions": [
159+
"-m"
160+
]
73161
}
74162
]
75163
}

Docker/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
TAG=latest
2-
QL_TAG=1.25_49108fc15
2+
QL_TAG=1.25_fbc86b31
33
BOOST_TAG=1.72.0
44
BOOST_DIR=1_72_0
55
NUM_CORES=16

Docker/Dockerfile-ORE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# syntax = docker/dockerfile:experimental
1+
# syntax = nexus3.acadiasoft.net:4445/docker/dockerfile:experimental
22
ARG quantlib_version=${QL_TAG}
33
FROM env_quantlib:${quantlib_version}
44

@@ -24,7 +24,7 @@ RUN cd /ore \
2424
&& find -regex ".*\.\(sh\|in\|ac\|am\)" -exec dos2unix {} ';' \
2525
&& cp Docker/CMakeLists_ORE.txt CMakeLists.txt \
2626
&& mkdir -p build.ore && cd build.ore \
27-
&& cmake .. -DBUILD_DOC=ON -DCMAKE_BUILD_TYPE=Release
27+
&& cmake .. -DBUILD_DOC=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-mavx2" -DORE_ENABLE_PARALLEL_UNIT_TEST_RUNNER=ON
2828

2929
WORKDIR /ore/build.ore
3030
RUN --mount=type=cache,target=/ccache/ make -j ${num_cores} \

Docker/Dockerfile-QuantLib

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# syntax = docker/dockerfile:experimental
1+
# syntax = nexus3.acadiasoft.net:4445/docker/dockerfile:experimental
22
ARG boost_version=latest
33
FROM build_env_boost:${boost_version}
44

@@ -23,13 +23,15 @@ ENV CCACHE_DIR="/ccache"
2323
RUN cd /ore/QuantLib \
2424
&& find -regex ".*\.\(sh\|in\|ac\|am\)" -exec dos2unix {} ';' \
2525
&& mkdir -p build.ql && cd build.ql \
26-
&& cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_CXX_FLAGS="-D BOOST_ENABLE_ASSERT_HANDLER" -DQL_ENABLE_SESSIONS=ON
26+
&& cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_CXX_FLAGS="-D BOOST_ENABLE_ASSERT_HANDLER -mavx2" -DQL_ENABLE_SESSIONS=ON -DQL_ENABLE_PARALLEL_UNIT_TEST_RUNNER=ON
2727

2828
WORKDIR /ore/QuantLib/build.ql
2929
RUN --mount=type=cache,target=/ccache/ make -j ${num_cores} \
3030
&& make install \
3131
&& cd / \
32+
&& cp -r /ore/QuantLib/test-suite /usr/local/include \
3233
&& rm -rf ore \
3334
&& ldconfig
35+
3436

3537
CMD bash

Docker/DockerfileRunORE.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose --env-file Docker/.e
55
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose --env-file Docker/.env -f Docker/docker-compose-ore.yml build || exit 1
66
docker-compose --env-file Docker/.env -f Docker/docker-compose-test.yml build || exit 1
77
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose --env-file Docker/.env -f Docker/docker-compose-ore-app.yml build || exit 1
8-

Docs/UserGuide/conventions.tex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,10 @@ \subsubsection{Commodity Future Conventions}
941941
...
942942
</AveragingData>
943943
<HoursPerDay>...</HoursPerDay>
944+
<SavingsTime>...<SavingsTime>
945+
<ValidContractMonths>
946+
<Month>...</Month>
947+
</ValidContractMonths>
944948
</CommodityFuture>
945949
\end{minted}
946950
\caption{Commodity future conventions}
@@ -981,6 +985,8 @@ \subsubsection{Commodity Future Conventions}
981985
\item \lstinline!OptionContinuationMappings! [Optional]: When building option volatility structures, we may use market data that has a continuation expiry, i.e. \lstinline!c1!, \lstinline!c2!, etc. , as opposed to an explicit expiry date or tenor. In some cases, the continuation expiries coming from the market data provider may skip serial months and therefore we use the mapping here to map from the market data provider index to the relevant serial month. For example, for the Crude Palm Oil contract \lstinline!XKLS:FCPO!, the option expiry months are serial up to the 9th month and then alternate months. So, we would add a mapping from 10 to 11, 11 to 13 and so on so that the correct option expiry is arrived at when reading the market data quotes and constructing the option volatility structure.
982986
\item \lstinline!AveragingData! [Optional]: This node is needed for future contracts that are used in a piecewise commodity curve \lstinline!PriceSegment! and whose underlying is the average of other future prices or spot prices over a given period. An example is the ICE PMI power contract with contract specifications outlined \href{https://www.theice.com/products/6590369/PJM-Western-Hub-Real-Time-Peak-1-MW-Fixed-Price-Future}{here}. It is described in detail below.
983987
\item \lstinline!HoursPerDay! [Optional]: For power derivatives, quantities are sometimes given as a quantity per hour. To deduce the quantity for the day which is multiplied by that day's future price, one needs to know the number of hours in the day associated with the future price. For example ICE PDQ is the daily PJM Western Hub Real Time Peak future contract. The price each day for this contract is the average of the locational marginal prices (LMPs) for all hours ending 08:00 to 23:00 Eastern Pacific Time. In other words, there are 16 hours in the day that feed in to the average yielding this settlement price. For this contract, \lstinline!HoursPerDay! would be \lstinline!16!. This field is only needed if a trade XML references this commodity contract, has \lstinline!CommodityQuantityFrequency! set to \lstinline!PerHour! and has no \lstinline!HoursPerDay! value set directly in the XML.
988+
\item \lstinline!SavingsTime! [Optional]: For some derivatives, quantities are given as quantity per calendar day and hour. The monthly quantity is then scaled by the number of calendar days times hours per day (see above) plus or minus a daylight savings correction. To compute the daylight savings correction a convention is needed that describes the dates on which dates one hour is gained resp. lost. Currently supported conventions are US, Null. Default is US if no convention is given.
989+
\item \lstinline!ValidContractMonths! [Optional]: For some commodities the contract frequency is almost monthly but for some calendar months there are no contracts listed. For example Corn Futures are only listed for the expiry months March, May, July, September and December. For those contracts the \emph{ContractFrequency} need to be set to \emph{Monthly} and the valid months have to be added to this node. This node is ignored for all other frequencies and if its omitted all calendar months are valid.
984990
\end{itemize}
985991
986992
\begin{listing}[h!]
14.1 KB
Binary file not shown.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
\subsubsection{Commodity Fixed Leg}
2+
\label{ss:commodityfixedleg}
3+
4+
A commodity fixed leg is specified in a \lstinline!LegData! node with \lstinline!LegType! set to \lstinline!CommodityFixed!. It is used to define a sequence of cashflows that are linked to a fixed price in a commodity derivative contract. Each cashflow has an associated \textit{Calculation Period}. The outline of a commodity fixed leg is given in listing \ref{lst:commodityfixedleg}. It has the usual \lstinline!LegData! elements described in section \ref{ss:leg_data} and a \lstinline!CommodityFixedLegData! node that is described in section \ref{ss:commodity_fixed_leg_data} below. The section \ref{ss:commodity_schedules} describes some aspects of the \lstinline!ScheduleData! node in the context of commodity derivatives.
5+
6+
\begin{listing}[h!]
7+
\begin{minted}[fontsize=\footnotesize]{xml}
8+
<LegData>
9+
<LegType>CommodityFixed</LegType>
10+
<Payer>...</Payer>
11+
<Currency>...</Currency>
12+
<PaymentConvention>...</PaymentConvention>
13+
<PaymentLag>...</PaymentLag>
14+
<PaymentCalendar>...</PaymentCalendar>
15+
<ScheduleData>
16+
...
17+
</ScheduleData>
18+
<PaymentDates>
19+
<PaymentDate>...</PaymentDate>
20+
</PaymentDates>
21+
<CommodityFixedLegData>
22+
...
23+
</CommodityFixedLegData>
24+
</LegData>
25+
\end{minted}
26+
\caption{Commodity fixed leg outline.}
27+
\label{lst:commodityfixedleg}
28+
\end{listing}
29+
30+
\subsubsection{Commodity Fixed Leg Data}
31+
\label{ss:commodity_fixed_leg_data}
32+
The \lstinline!CommodityFixedLegData! node outline is shown in listing \ref{lst:commodity_fixed_leg_data}. The meaning and allowable values for each node are as follows:
33+
34+
\begin{itemize}
35+
36+
\item
37+
\lstinline!Quantities! [Optional]: this node is used to specify a constant quantity or a quantity that varies over the calculation periods. The usage of this node is analagous to the usage of the \lstinline!Notionals! node as outlined in section \ref{ss:leg_data}. For convenience, this node can be omitted if the quantities are identical to those on a commodity floating leg, outlined in Section \ref{ss:commodityfloatingleg}, on the same trade. In this case, the quantities from the floating leg are used. If there is only a single commodity floating leg, as is the case in a standard swap, the quantities are taken from that leg. If there are multiple commodity floating legs on the trade, a specific commodity floating leg can be picked using the \lstinline!Tag! node specified below. In other words, a \lstinline!Tag! can be specified on the fixed leg and the same \lstinline!Tag! specified on the floating leg from which the quantities should be taken.
38+
39+
\item
40+
\lstinline!Prices!: this node is used to specify a constant price or a price that varies over the calculation periods. The usage of this node is analagous to the usage of the \lstinline!Notionals! node as outlined in section \ref{ss:leg_data}.
41+
42+
\item
43+
\lstinline!CommodityPayRelativeTo! [Optional]: the allowable values for this node are \\
44+
\lstinline!CalculationPeriodStartDate!, \lstinline!CalculationPeriodEndDate!, \lstinline!TerminationDate!, \lstinline!FutureExpiryDate!. They specify whether payment is relative to the calculation period start date, calculation period end date, leg maturity date or the future expiry date (of the corresponding cashflow on the floating leg with the same Tag as the fixed leg) respectively. The default is \lstinline!CalculationPeriodEndDate!. The payment date is then further adjusted by the payment conventions outlined in section \ref{ss:leg_data} i.e. \lstinline!PaymentConvention! and \lstinline!PaymentLag!. If explicit payment dates are given via the \lstinline!PaymentDates! node described in section \ref{ss:leg_data}, then those explicit payment dates are used instead and adjusted by the \lstinline!PaymentCalendar! and \lstinline!PaymentConvention!.
45+
46+
\item
47+
\lstinline!Tag! [Optional]: The use of this node is explained in the \lstinline!Quantities! resp. \lstinline!CommodityPayRelativeTo! piece above.
48+
49+
\end{itemize}
50+
51+
\begin{listing}[h!]
52+
\begin{minted}[fontsize=\footnotesize]{xml}
53+
<CommodityFixedLegData>
54+
<Quantities>
55+
<Quantity>...</Quantity>
56+
</Quantities>
57+
<Prices>
58+
<Price>...</Price>
59+
</Prices>
60+
<CommodityPayRelativeTo>...</CommodityPayRelativeTo>
61+
<Tag>...</Tag>
62+
</CommodityFixedLegData>
63+
\end{minted}
64+
\caption{Commodity fixed leg data outline.}
65+
\label{lst:commodity_fixed_leg_data}
66+
\end{listing}

0 commit comments

Comments
 (0)