Skip to content

Commit 0e8aa94

Browse files
author
jenkins
committed
git subrepo pull (merge) ore
subrepo: subdir: "ore" merged: "d516dce414" upstream: origin: "git@gitlab.acadiasoft.net:qs/ore.git" branch: "master" commit: "d561f05ac7" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "110b9eb"
2 parents 9a33831 + d561f05 commit 0e8aa94

18 files changed

Lines changed: 343 additions & 86 deletions

File tree

Docker/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ DEBIAN_TAG=11.7
33
# it's recommended to include CMAKE_BUILD_TYPE and BOOST_VARIANT in QL_TAG, ORE_TAG, BOOST_TAG
44
# to distinguish a release build from a debug build
55

6-
QL_TAG=1.31.1_55f433ce8
6+
QL_TAG=1.31.1_d2327d5a7135
77
ORE_TAG=latest
88
BOOST_TAG=1.78.0
99
BOOST_DIR=1_78_0

Docs/AMC/amc.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ \subsection{Pricing Engine Configuration}\label{sec:pricing_engine_config}
256256
257257
\begin{enumerate}
258258
\item \verb+Training.Sequence+: The sequence type for the traning phase, can be \verb+MersenneTwister+,
259-
\verb+MersenneTwisterAntithetc+, \verb+Sobol+ or \verb+SobolBrownianBridge+
259+
\verb+MersenneTwisterAntithetc+, \verb+Sobol+, \verb+Burley2020Sobol+, \verb+SobolBrownianBridge+,
260+
\verb+Burley2020SobolBrownianBridge+
260261
\item \verb+Training.Seed+: The seed for the random number generation in the training phase
261262
\item \verb+Training.Samples+: The number of samples to be used for the training phase
262263
\item \verb+Pricing.Sequence+: The sequence type for the pricing phase, same values allowed as for training

Docs/ScriptedTrade/docs/models.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ \subsection{Pricing Engine Configuration}\label{pricingengine_config}
111111
\item RegressionOrder: The order of the polynomial basis to compute conditional expectations via regression
112112
analysis. Applies to MC only.
113113
\item SequenceType: The sequence type used for pricing. Defaults to SobolBrownianBridge. Possible values
114-
SobolBrownianBridge, MersenneTwister, MersenneTwisterAnithetic, Sobol. Applies to MC only.
114+
SobolBrownianBridge, Burley2020SobolBrownianBridge, MersenneTwister, MersenneTwisterAnithetic, Sobol,
115+
Burley2020Sobol. Applies to MC only.
115116
\item PolynomType: The polynom type used for regression analysis. Defaults to Monomial. Possible values Monomial,
116117
Laguerre, Hermite, Hyperbolic, Legendre, Chebyshev, Chebychev2nd. Applies to MC only.
117118
\item TrainingSamples: If given, pricing and training are separate phases and traning phase is using this number of

Docs/UserGuide/parameterisation/simulation.tex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@
5656
%\item {\tt Scenario: } Choose between {\em Simple } and {\em Complex } implementations, the latter optimized for
5757
% more efficient memory usage. \todo[inline]{Remove Scenario choice}
5858
\item {\tt DayCounter:} Day count convention used to translate dates to times. Optional, defaults to ActualActual ISDA.
59-
\item {\tt Sequence:} Choose random sequence generator ({\em MersenneTwister, MersenneTwisterAntithetic, Sobol,
60-
SobolBrownianBridge}).
59+
\item {\tt Sequence:} Choose random sequence generator ({\em MersenneTwister, MersenneTwisterAntithetic,
60+
Sobol,Burley2020Sobol, SobolBrownianBridge, Burley2020SobolBrownianBridge}).
6161
\item {\tt Seed:} Random number generator seed
6262
\item {\tt Samples:} Number of Monte Carlo paths to be produced
6363
%\item {\tt Fixings: } Choose whether fixings should be simulated or not, and if so which fixing simulation method to
6464
use ({\em Backward, Forward, BestOfForwardBackward, InterpolatedForwardBackward}), which number of forward horizon days
6565
to use if one of the {\em Forward } related methods is chosen.
66-
\item {\tt Ordering:} If the sequence type {\em SobolBrownianBridge} is used, ordering of variates ({\em Factors, Steps,
67-
Diagonal})
68-
\item {\tt DirectionIntegers:} If the sequence type {\em SobolBrownianBridge} or {\em Sobol} is used, type of direction
69-
integers in Sobol generator ({\em Unit, Jaeckel, SobolLevitan, SobolLevitanLemieux, JoeKuoD5, JoeKuoD6, JoeKuoD7, Kuo,
70-
Kuo2, Kuo3})
66+
\item {\tt Ordering:} If the sequence type {\em SobolBrownianBridge} or {\em Burley2020SobolBrownianBridge} is used,
67+
ordering of variates ({\em Factors, Steps, Diagonal})
68+
\item {\tt DirectionIntegers:} If the sequence type {\em SobolBrownianBridge}, {\em Burley2020SobolBrownianBridge}, {\em
69+
Sobol} or {\em Burley2020Sobol} is used, type of direction integers in Sobol generator ({\em Unit, Jaeckel,
70+
SobolLevitan, SobolLevitanLemieux, JoeKuoD5, JoeKuoD6, JoeKuoD7, Kuo, Kuo2, Kuo3})
7171
\item {\tt CloseOutLag}: If this tag is present, this specifies the close-out period length (e.g. 2W) used; otherwise no close-out grid is built. The close-out grid is an auxiliary time grid that is offset from the main default date grid by the close-out period, typically set to the applicable margin period of risk. If present, it is used to evolve the portfolio value and determine close-out values associated with the preceding default date valuation.
7272
\item {\tt MporMode}: This tag is expected if the previous one is present, permissible values are then {\tt StickyDate} and {\tt ActualDate}. {\tt StickyDate} means that only market data is evolved from the default date to close-out date for close-out date valuation, the valuation as of date remains unchanged and trades do not ``age'' over the period. As a consequence, exposure evolutions will not show spikes caused by cash flows within the close-out period. {\tt ActualDate} means that trades will also age over the close-out period so that one can experience exposure evolution spikes due to cash flows.
7373
\end{itemize}
@@ -797,4 +797,4 @@
797797
\label{lst:simulation_market_configuration}
798798
\end{longlisting}
799799
800-
\todo[inline]{Comment on cap/floor surface structure and reaction to time decay}
800+
\todo[inline]{Comment on cap/floor surface structure and reaction to time decay}

Docs/UserGuide/tradecomponents/legdatanotionals.tex

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ \subsubsection{Leg Data and Notionals}
210210
outlined in section \ref{ss:cashflowlegdata}.
211211
\item CMSLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{CMS} (Constant Maturity Swap). It is
212212
outlined in section \ref{ss:cmslegdata}.
213-
%\item CMBLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{CMB} (Constant Maturity Bond). It is
213+
% \item CMBLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{CMB} (Constant Maturity Bond). It is
214214
% outlined in section \ref{ss:cmblegdata}.
215215
\item DigitalCMSLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{DigitalCMS}. It is
216216
outlined in section \ref{ss:digitalcmslegdata}.
@@ -228,8 +228,10 @@ \subsubsection{Leg Data and Notionals}
228228
outlined in section \ref{ss:yylegdata}.
229229
\item ZeroCouponFixedLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{ZeroCouponFixed}. It is
230230
outlined in section \ref{ss:zerolegdata}.
231-
% \item CommodityFloatingLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{CommodityFloating} It is
232-
%outlined in section \ref{ss:commodity_floating_leg_data}.
233-
%\item CommodityFixedLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{CommodityFixed} It is outlined in section \ref{ss:commodity_fixed_leg_data}.
234-
%\item EquityMarginLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{EquityMargin} It is outlined in section \ref{ss:equity_margin_leg_data}.
231+
% \item FormulaBasedLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{FormulaBased}. It is
232+
% outlined in section \ref{ss:formulalegdata}.
233+
% \item CommodityFloatingLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{CommodityFloating} It is
234+
% outlined in section \ref{ss:commodity_floating_leg_data}.
235+
% \item CommodityFixedLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{CommodityFixed} It is outlined in section \ref{ss:commodity_fixed_leg_data}.
236+
% \item EquityMarginLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{EquityMargin} It is outlined in section \ref{ss:equity_margin_leg_data}.
235237
\end{itemize}

Docs/UserGuide/tradedata/convertiblebond.tex

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,23 @@ \subsubsection{Convertible Bond}
22
\label{ss:convertible_bond}
33

44
A convertible bond is set up using a {\tt ConvertibleBondData} block as shown in listing
5-
\ref{lst:convertiblebonddata1}. The bond details are read from reference data in this case. The meanings and allowable
6-
values of the elements in the block are as follows:
5+
\ref{lst:convertiblebonddata1}. The bond details are read from reference data in this case.
6+
7+
A convertible bond is a bond, that can be converted into a prespecified number of shares, given by:
8+
$$
9+
NumberOfShares = \frac{BondNotional}{ConversionRatio}
10+
$$
11+
12+
Where the Conversion Ratio is specified in the underlying bond reference data.
13+
14+
The shares are usually from the bond issuer, but it is also possible that the shares arefrom a different issuer (exchangeables). In addition, the share currency can be differentfrom the bond currency in both cases (cross-currency convertibles).
15+
16+
17+
The bond might be callable by the issuer (typically in American style) and / or puttableby the investor (typically in Bermudan style). The issuer calls can be “hard calls”,which are call rights in the traditional sense, as opposed to “soft calls” which can onlythe exercised if the equity price observed on the exercise date is above a prespecifiedthreshold given by TriggerRatios. If a soft call is exercised, the investor has the right to convert the bond intoshares instead of accepting the payment from the issuer call (“forced conversion”).
18+
19+
20+
The meanings and allowable
21+
values of the elements in the {\tt ConvertibleBondData} block are as follows:
722

823
\begin{itemize}
924
\item SecurityId: The underlying security identifier\\
@@ -124,8 +139,21 @@ \subsubsection{Convertible Bond}
124139
Allowable values: true, false
125140
126141
\item TriggerRatios: A list of trigger ratios $T$ for soft calls. A soft call can be executed only if the equity price
127-
on the exercise date is above the conversion price times the trigger ratio, i.e. $S_t > C^P_tT$. Only applicable to
142+
on the exercise date is above the Conversion Price (defined below) times the trigger ratio, i.e. $S_t > C^P_tT$. Only applicable to
128143
Calls, not to Puts. Required for soft calls, can be omitted otherwise.\\
144+
145+
$$
146+
Conversion Price, C^P_t = \frac{1}{ConversionRatio}
147+
$$
148+
149+
For cross-currency trades the conversion price is usually quoted in equity ccy, i.e.
150+
151+
$$
152+
Conversion Price, C^P_t = \frac{1}{ConversionRatio \cdot X_t}
153+
$$
154+
155+
where $X_t$ converts one equity ccy unit to bond ccy
156+
129157
Allowable values: Any positive real number.
130158
131159
\item NofMTriggers: A list of n-of-m trigger specifications for calls, i.e. the soft-call trigger defined by

Docs/UserGuide/tradedata/equitycliquetoption.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ \subsubsection{Equity Cliquet Option}
4040
<OptionType>Call</OptionType>
4141
<Moneyness>1.0</Moneyness>
4242
<LocalCap>0.07</LocalCap>
43-
<LocalFloor></LocalFloor>
44-
<GlobalCap></GlobalCap>
43+
<LocalFloor>-0.06</LocalFloor>
44+
<GlobalCap>0.07</GlobalCap>
4545
<GlobalFloor>-0.07</GlobalFloor>
4646
<ScheduleData>
4747
<Dates>
@@ -84,13 +84,13 @@ \subsubsection{Equity Cliquet Option}
8484
\item Moneyness: Adjustment of option return. The moneyness M each forward starting option is being struck at.\\
8585
Allowable values: Any real number. Expressed in decimal form where 1.0 is at-the-money, 1.1 is 110\% of the at-the-money strike, 0.9 is 90\% of the at-the-money strike, etc.
8686
\item LocalCap[Optional]: The local cap, $cap_{l}$, in each of the option return. \\
87-
Allowable values: Any real number. If left blank or omitted, no local cap is applied.
87+
Allowable values: Any real number. If omitted, no local cap is applied. Can't be left blank.
8888
\item LocalFloor[Optional]: The local floor, $floor_{l}$, in each of the option return. \\
89-
Allowable values: Any real number. If left blank or omitted, no local floor is applied.
89+
Allowable values: Any real number. If omitted, no local floor is applied. Can't be left blank.
9090
\item GlobalCap[Optional]: The global cap, $cap_{g}$, for the option return. \\
91-
Allowable values: Any real number. If left blank or omitted, no global cap is applied.
91+
Allowable values: Any real number. If omitted, no global cap is applied. Can't be left blank.
9292
\item GlobalFloor[Optional]: The global floor,$floor_{g}$, for the option return. \\
93-
Allowable values: Any real number. If left blank or omitted, no global floor is applied.
93+
Allowable values: Any real number. If omitted, no global floor is applied. Can't be left blank.
9494
\item ScheduleData: A schedule of dates that define the valuation dates of the consecutive forward starting options forming the Equity Cliquet Option. The first date in the schedule is the start date of the first consecutive option, the second date in the schedule is the end/valuation date of the first consecutive option, and also the start date of the second consecutive option, etc. The last date is the final valuation date, with payoff of the whole Cliquet option at this date plus \lstinline!SettlementDays!. \\
9595
Allowable values: A node on the same form as \lstinline!ScheduleData!, (see \ref{ss:schedule_data}).
9696
\item SettlementDays[Optional]: Number of days from the last valuation date to the payoff being paid or received. The payoff date is determined with regards to calendar and

Docs/UserGuide/userguide.tex

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,7 +2851,8 @@ \subsubsection*{Pricing Engine Configuration}
28512851

28522852
\begin{enumerate}
28532853
\item \verb+Training.Sequence+: The sequence type for the traning phase, can be \verb+MersenneTwister+,
2854-
\verb+MersenneTwisterAntithetc+, \verb+Sobol+ or \verb+SobolBrownianBridge+
2854+
\verb+MersenneTwisterAntithetc+, \verb+Sobol+, \verb+Burley2020Sobol+, \verb+SobolBrownianBridge+,
2855+
\verb+Burley2020SobolBrownianBridge+
28552856
\item \verb+Training.Seed+: The seed for the random number generation in the training phase
28562857
\item \verb+Training.Samples+: The number of samples to be used for the training phase
28572858
\item \verb+Pricing.Sequence+: The sequence type for the pricing phase, same values allowed as for training
@@ -5131,17 +5132,17 @@ \subsubsection{Parameters}\label{sec:sim_params}
51315132
% more efficient memory usage. \todo[inline]{Remove Scenario choice}
51325133
\item {\tt DayCounter:} Day count convention used to translate dates to times. Optional, defaults to ActualActual ISDA.
51335134
\item {\tt Sequence:} Choose random sequence generator ({\em MersenneTwister, MersenneTwisterAntithetic, Sobol,
5134-
SobolBrownianBridge}).
5135+
Burley2020Sobol, SobolBrownianBridge, Burley2020SobolBrownianBridge}).
51355136
\item {\tt Seed:} Random number generator seed
51365137
\item {\tt Samples:} Number of Monte Carlo paths to be produced
51375138
%\item {\tt Fixings: } Choose whether fixings should be simulated or not, and if so which fixing simulation method to
51385139
use ({\em Backward, Forward, BestOfForwardBackward, InterpolatedForwardBackward}), which number of forward horizon days
51395140
to use if one of the {\em Forward } related methods is chosen.
5140-
\item {\tt Ordering:} If the sequence type {\em SobolBrownianBridge} is used, ordering of variates ({\em Factors, Steps,
5141-
Diagonal})
5142-
\item {\tt DirectionIntegers:} If the sequence type {\em SobolBrownianBridge} or {\em Sobol} is used, type of direction
5143-
integers in Sobol generator ({\em Unit, Jaeckel, SobolLevitan, SobolLevitanLemieux, JoeKuoD5, JoeKuoD6, JoeKuoD7, Kuo,
5144-
Kuo2, Kuo3})
5141+
\item {\tt Ordering:} If the sequence type {\em SobolBrownianBridge} or {\em Burley2020SobolBrownianBridge} is used,
5142+
ordering of variates ({\em Factors, Steps, Diagonal})
5143+
\item {\tt DirectionIntegers:} If the sequence type {\em SobolBrownianBridge}, {\em Burley2020SobolBrownianBridge}, {\em
5144+
Sobol} or {\em Burley2020Sobol} is used, type of direction integers in Sobol generator ({\em Unit, Jaeckel,
5145+
SobolLevitan, SobolLevitanLemieux, JoeKuoD5, JoeKuoD6, JoeKuoD7, Kuo, Kuo2, Kuo3})
51455146
\item {\tt CloseOutLag}: If this tag is present, this specifies the close-out period length (e.g. 2W) used; otherwise no close-out grid is built. The close-out grid is an auxiliary time grid that is offset from the main default date grid by the close-out period, typically set to the applicable margin period of risk. If present, it is used to evolve the portfolio value and determine close-out values associated with the preceding default date valuation.
51465147
\item {\tt MporMode}: This tag is expected if the previous one is present, permissible values are then {\tt StickyDate} and {\tt ActualDate}. {\tt StickyDate} means that only market data is evolved from the default date to close-out date for close-out date valuation, the valuation as of date remains unchanged and trades do not ``age'' over the period. As a consequence, exposure evolutions will not show spikes caused by cash flows within the close-out period. {\tt ActualDate} means that trades will also age over the close-out period so that one can experience exposure evolution spikes due to cash flows.
51475148
\end{itemize}

OREData/ored/portfolio/basketvarianceswap.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,12 @@ XMLNode* BasketVarianceSwap::toXML(XMLDocument& doc) {
228228
XMLUtils::appendNode(tradeNode, valuationSchedule);
229229

230230
XMLUtils::addChild(doc, tradeNode, "SettlementDate", settlementDate_);
231-
XMLUtils::addChild(doc, tradeNode, "Cap", cap_);
232-
XMLUtils::addChild(doc, tradeNode, "Floor", floor_);
231+
if (!cap_.empty()) {
232+
XMLUtils::addChild(doc, tradeNode, "Cap", cap_);
233+
}
234+
if (!floor_.empty()) {
235+
XMLUtils::addChild(doc, tradeNode, "Floor", floor_);
236+
}
233237
XMLUtils::addChild(doc, tradeNode, "SquaredPayoff", squaredPayoff_);
234238

235239
return node;

OREData/ored/portfolio/tarf.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ using namespace QuantExt;
121121
" d = DATEINDEX(FixingAndSimDates[a], FixingDates, GT);\n"
122122
" IF s > 0 THEN\n"
123123
" IF d > 1 THEN\n"
124-
// including Hits[d-1] in the regression is not stable
125-
" _AMC_NPV[s] = LongShort * NPVMEM( bwdPayoff, _AMC_SimDates[s], a, 1 == 1, AccProfit[d-1]);\n"
124+
// including Hits[d-1] or AccProfit[d-1] in the regression is not stable
125+
" _AMC_NPV[s] = LongShort * NPVMEM( bwdPayoff, _AMC_SimDates[s], a);\n"
126126
" ELSE\n"
127127
" _AMC_NPV[s] = LongShort * NPVMEM( bwdPayoff, _AMC_SimDates[s], a);\n"
128128
" END;\n"
@@ -229,7 +229,7 @@ using namespace QuantExt;
229229
" d = DATEINDEX(FixingAndSimDates[a], FixingDates, GT);\n"
230230
" IF s > 0 THEN\n"
231231
" IF d > 1 THEN\n"
232-
" _AMC_NPV[s] = LongShort * NPVMEM( bwdPayoff, _AMC_SimDates[s], a, 1 == 1, AccProfitPoints[d-1]);\n"
232+
" _AMC_NPV[s] = LongShort * NPVMEM( bwdPayoff, _AMC_SimDates[s], a);\n"
233233
" ELSE\n"
234234
" _AMC_NPV[s] = LongShort * NPVMEM( bwdPayoff, _AMC_SimDates[s], a);\n"
235235
" END;\n"

0 commit comments

Comments
 (0)