Skip to content

Commit 1e6ff0a

Browse files
Merge remote-tracking branch 'origin/master' into github_modules
2 parents e736726 + e4c7e25 commit 1e6ff0a

222 files changed

Lines changed: 10258 additions & 1494 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.

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_fbc86b31
2+
QL_TAG=1.25_62dbd76ae
33
BOOST_TAG=1.72.0
44
BOOST_DIR=1_72_0
55
NUM_CORES=16

Docs/UserGuide/tradecomponents/commodityfloatingleg.tex

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,14 @@ \subsubsection{Commodity Floating Leg Data}
230230
\lstinline!Tag! [Optional]: This node takes any string and can be used to link the floating leg with a fixed leg that has not explicitly provided its own quantities. This can be useful in situations where the quantities on the floating leg are specified with a \lstinline!CommodityQuantityFrequency! that is not simply \lstinline!PerCalculationPeriod!. The fixed leg does not have the \lstinline!CommodityQuantityFrequency! field. In these cases, the fixed leg can omit its \lstinline!Quantities! node and take the quantities from the floating leg. This \lstinline!Tag! node allows the fixed leg to link to a specific floating leg if there is more than one floating leg on the trade i.e.\ the fixed leg must just have the same \lstinline!Tag!. The link is also used to set the payment dates of the fixed leg if CommodityPayRelativeTo is set to FutureExpiryDate.
231231

232232
\item
233-
\lstinline!DailyExpiryOffset! [Optional]: This node allows any non-negative integer value. It only has effect if \lstinline!IsAveraged! is set to \emph{true}, and the underlying commodity \lstinline!Name! is not being averaged and has a daily contract frequency. I.e. for an averaging leg on an underlying that is not averaging.
234-
235-
If this node is omitted, it defaults to zero. This node indicates which future contract is being referenced on each \textit{Pricing Date} in the averaging period by acting as a business day offset, using the commodity \lstinline!Name!'s expiry calendar, from the \textit{Pricing Date}. It is useful in the base metals market where the future contract being averaged on each \textit{Pricing Date} is the cash contract on that \textit{Pricing Date} i.e.\ the contract with expiry date two business days after the \textit{Pricing Date}. In this case, the \lstinline!DailyExpiryOffset! would be set to \lstinline!2!.
233+
\lstinline!DailyExpiryOffset! [Optional]: This node allows any non-negative integer value. It only has effect the
234+
underlying commodity \lstinline!Name! is not being averaged and has a daily contract frequency.
235+
236+
If this node is omitted, it defaults to zero. This node indicates which future contract is being referenced on each
237+
\textit{Pricing Date} by acting as a business day offset, using the commodity \lstinline!Name!'s expiry calendar, from
238+
the \textit{Pricing Date}. It is useful e.g. in the base metals market where a future contract on each \textit{Pricing
239+
Date} is the cash contract on that \textit{Pricing Date} i.e.\ the contract with expiry date two business days after
240+
the \textit{Pricing Date}. In this case, the \lstinline!DailyExpiryOffset! would be set to \lstinline!2!.
236241

237242
\item \lstinline!FXIndex! [Optional]: If \lstinline!IsAveraged! is \emph{true} this node allows the fx conversion to be applied daily in the computation of averaged cash flows. It cannot be used with the \lstinline!Indexing! node.
238243

Docs/UserGuide/tradecomponents/floatinglegdata.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ \subsubsection{Floating Leg Data, Spreads, Gearings, Caps and Floors}
189189
For overnight coupons this is the number of business days by which the value dates are shifted into the past to get
190190
the fixing observation dates. In the context of RFRs the FixingDays parameter is sometimes also called
191191
``obervation lag''.
192+
193+
The calendar used for the fixing gap, is the calendar associated with the floating index, as defined in the conventions for the index.
192194

193195
Allowable values: A non-negative whole number. Defaults to the index's fixing days if blank or omitted. See defaults per index in Table \ref{tab:fixingdaysdefaults}.
194196

Docs/UserGuide/tradecomponents/underlying.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ \subsubsection{Underlying}
201201
\item \lstinline!Weight! [Optional]:
202202
The relative weight of the underlying if part of a basket. For a single underlying this can be omitted or set to 1.
203203

204-
Allowable values: A number between -1 and 1. Defaults to 1 if left blank or omitted. \\
204+
Allowable values: A real number. Defaults to 1 if left blank or omitted. \\
205205
Notes on negative weights in the \emph{TotalReturnSwap} trade type: \\
206206
Negative weights for EquityOptionPositions are allowed, but not recommended. A negative weight for an EquityOptionPosition is equivalent to inverting the LongShort flag in the respective OptionData node. \\
207207
For EquityPositions a negative weight means that flows are in the opposite direction of the Payer flag on the return leg. A use case for negative weights is for a basket of EquityPositions that include both long and short positions.

Docs/UserGuide/tradedata/commodityoption.tex

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
\subsubsection{Commodity Option}
32
\label{ss:input_commodity_option}
43

@@ -101,3 +100,61 @@ \subsubsection{Commodity Digital Option}
101100
\mbox{Digital Put} = \frac{\mbox{Payoff}}{\Delta} \times \left( \mbox{Put}(K+ \Delta/2) - \mbox{Put}(K- \Delta/2) \right)
102101
\end{align*}
103102
so that the long digital option has positive value in both cases. The strike spread $\Delta$ used here is set to 1\% of strike $K$.
103+
104+
\subsubsection{Commodity Spread Option}
105+
\label{ss:input_commodity_spread_option}
106+
107+
A commodity Spread Option is represented with trade type \emph{CommoditySpreadOption} and a corresponding
108+
\lstinline!CommoditySpreadOptionData! node.
109+
110+
The \lstinline!CommoditySpreadOptionData! node is the trade data container for the \emph{CommoditySpreadOption} trade type.
111+
The structure of a \lstinline!CommoditySpreadOptionData! node for a commodity option is shown in Listing \ref{lst:com_s_option_data}.
112+
113+
The \lstinline!CommoditySpreadOptionData! include exactly two \lstinline!LegData! nodes of type \emph{CommodityFloating}.
114+
Details on these are described in \ref{ss:commodityfloatingleg}.
115+
The resulting Legs must produce the same amount of cashflows (i.e.~the number of \emph{calculation period}s must be the same for the long and short positions).
116+
If the number of cashflows per leg is 1, this trade represents a vanilla commodity spread option.
117+
If is greater than 1, it represents a multi-period commodity spread option.
118+
The first one represents the long position on the relevant asset, and the \lstinline!isPayer! must be set to \emph{true}.
119+
The second one represents the short position on the relevant asset, and the \lstinline!isPayer! must be set to \emph{false}.
120+
121+
Within the two \lstinline!LegData!, the \lstinline!Quantity! node has must be equal.
122+
If the underlying contracts are quoted using different units (e.g. barrels vs liters), the \lstinline!Gearing! node must be used to account for this difference.
123+
124+
125+
Other than the two legs, the following nodes complete the \lstinline!CommoditySpreadOptionData! container:
126+
\begin{itemize}
127+
\item \lstinline!ExerciseDate!: the exercise date. Allowable values: See Date in Table \ref{tab:allow_stand_data}.
128+
\item \lstinline!SpreadStrike!: The strike value for the spread. Allowable values: Any real number.
129+
\item \lstinline!OptionType! [Optional]: The allowable values are \emph{Call} or \emph{Put}. If not provided, default value is \emph{Call}.
130+
\item \lstinline!SettlementDate! [Optional]: A date in which the trade is settled.
131+
Allowable values: This should be a valid date as outlined in Table \ref{tab:allow_stand_data}. If not provided, it is assumed that the trade is settled on the \lstinline!ExerciseDate!.
132+
\item \lstinline!Currency!: The settlement currency for the trade. \\
133+
Allowable values: See \lstinline!Currency! in Table \ref{tab:allow_stand_data}.
134+
\end{itemize}
135+
136+
\begin{listing}[H]
137+
%\hrule\medskip
138+
\begin{minted}[fontsize=\footnotesize]{xml}
139+
<CommoditySpreadOptionData>
140+
<LegData>
141+
<LegType>CommodityFloating</LegType>
142+
<IsPayer>true<IsPayer>
143+
...
144+
</LegData>
145+
<LegData>
146+
<LegType>CommodityFloating</LegType>
147+
<IsPayer>false<IsPayer>
148+
...
149+
</LegData>
150+
<ExerciseDate>2022-12-25</ExerciseDate>
151+
<Quantity>1000</Quantity>
152+
<SpreadStrike>2.3</SpreadStrike>
153+
<OptionType>Call</OptionType>
154+
<SettlmentDate>2022-12-31</SettlementDate>
155+
<Currency>USD</Currency>
156+
</CommoditySpreadOptionData>
157+
\end{minted}
158+
\caption{Commodity Option data}
159+
\label{lst:com_s_option_data}
160+
\end{listing}

Docs/UserGuide/tradedata/creditdefaultswap.tex

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\subsubsection{Credit Default Swap}
1+
\subsubsection{Credit Default Swap / Quanto Credit Default Swap}
22

33
A credit default swap, trade type \lstinline!CreditDefaultSwap!, is set up using a \lstinline!CreditDefaultSwapData! block as shown in listing \ref{lst:cdsdata} or \ref{lst:cdsdata_with_ref_info}. The \lstinline!CreditDefaultSwapData! block must include either a \lstinline!CreditCurveId! element or a \lstinline!ReferenceInformation! node.
44

@@ -81,3 +81,42 @@ \subsubsection{Credit Default Swap}
8181
\caption{\lstinline!CreditDefaultSwapData! with \lstinline!ReferenceInformation!}
8282
\label{lst:cdsdata_with_ref_info}
8383
\end{listing}
84+
85+
A quanto credit default swap is a credit default swap with different denomination and settlement currencies. Listing
86+
\ref{lst:quanto_cds} shows an Example: The trade has a notional of 50 million BRL and pays a $6\%$ premium. The premuim
87+
amounts are converted using the FX-TR20H-USD-BRL fixing two days before they are settled in USD. The hypothetical
88+
protection amounts computed for pricing purposes are converted to USD in a similar fashion.
89+
90+
\begin{listing}[H]
91+
%\hrule\medskip
92+
\begin{minted}[fontsize=\footnotesize]{xml}
93+
<LegData>
94+
<LegType>Fixed</LegType>
95+
<Payer>true</Payer>
96+
<!-- This is the settlement currency -->
97+
<Currency>USD</Currency>
98+
<!-- This is the BRL notional -->
99+
<Notionals>
100+
<Notional>50000000</Notional>
101+
</Notionals>
102+
<!-- The FX index used to convert BRL amounts to the settlement ccy USD -->
103+
<Indexings>
104+
<Indexing>
105+
<Index>FX-TR20H-USD-BRL</Index>
106+
<FixingDays>2</FixingDays>
107+
<FixingCalendar>USD,BRL</FixingCalendar>
108+
<IsInArrears>true</IsInArrears>
109+
</Indexing>
110+
</Indexings>
111+
...
112+
<FixedLegData>
113+
<Rates>
114+
<Rate>0.06</Rate>
115+
</Rates>
116+
</FixedLegData>
117+
...
118+
</LegData>
119+
\end{minted}
120+
\caption{Quanto CDS CreditDefaultSwap Data}
121+
\label{lst:quanto_cds}
122+
\end{listing}

Docs/UserGuide/tradedata/fx_barrieroption.tex

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ \subsubsection{FX Barrier Option}
5454

5555
\begin{itemize}
5656

57-
\item OptionData: This is a trade component sub-node outlined in section \ref{ss:option_data}.
57+
\item \lstinline!OptionData!: This is a trade component sub-node outlined in section \ref{ss:option_data}.
5858
The relevant fields in the \lstinline!OptionData! node for an FxBarrierOption are:
5959

6060
\begin{itemize}
@@ -71,45 +71,47 @@ \subsubsection{FX Barrier Option}
7171

7272
\item \lstinline!Settlement! The allowable values are \emph{Cash} or \emph{Physical}.
7373

74+
\item A \lstinline!PaymentData! [Optional] node can be added which defines the settlement of the option payoff.
75+
7476
\item An \lstinline!ExerciseDates! node where exactly one ExerciseDate date element must be given.
7577

76-
\item Premiums [Optional]: Option premium amounts paid by the option buyer to the option seller.
78+
\item \lstinline!Premiums! [Optional]: Option premium amounts paid by the option buyer to the option seller.
7779

7880
Allowable values: See section \ref{ss:premiums}
7981

8082
\end{itemize}
8183

8284

8385

84-
\item BarrierData: This is a trade component sub-node outlined in section \ref{ss:barrier_data}.
86+
\item \lstinline!BarrierData!: This is a trade component sub-node outlined in section \ref{ss:barrier_data}.
8587
Level specified in BarrierData should be quoted as the amount in SoldCurrency per unit BoughtCurrency, with both currencies as defined in FxBarrierOptionData node.
8688
Changing the option from Call to Put or vice versa does not require switching the barrier level, i.e. the level stays quoted as SoldCurrency per unit BoughtCurrency, regardless of Put/Call.
8789

88-
\item StartDate[Optional]: The start date for checking if a barrier has been breached prior to today's date. If omitted or left blank no check is made and it is assumed no barrier has been breached in the past. Has no impact if set to today's date or a date in the future.
90+
\item \lstinline!StartDate! [Optional]: The start date for checking if a barrier has been breached prior to today's date. If omitted or left blank no check is made and it is assumed no barrier has been breached in the past. Has no impact if set to today's date or a date in the future.
8991

9092
Allowable values: See \lstinline!Date! in Table \ref{tab:allow_stand_data}.
9193

92-
\item Calendar[Optional]: The calendar associated with the FX Index. Required if StartDate is set to a date prior to today's date, otherwise optional.
94+
\item \lstinline!Calendar! [Optional]: The calendar associated with the FX Index. Required if StartDate is set to a date prior to today's date, otherwise optional.
9395

9496
Allowable values: See Table \ref{tab:calendar} Calendar.
9597

96-
\item FXIndex[Optional]: A reference to an FX Index source to check if the barrier has been breached. Required if StartDate is set to a date prior to today's date, otherwise optional and can be omitted but not left blank.
98+
\item \lstinline!FXIndex! [Optional]: A reference to an FX Index source to check if the barrier has been breached. Required if StartDate is set to a date prior to today's date, otherwise optional and can be omitted but not left blank.
9799

98100
Allowable values: The format of the FX Index is``FX-SOURCE-CCY1-CCY2'' as described in table \ref{tab:fxindex_data}.
99101

100-
\item BoughtCurrency: The bought currency of the FX barrier option. See OptionData above for more details.
102+
\item \lstinline!BoughtCurrency!: The bought currency of the FX barrier option. See OptionData above for more details.
101103

102104
Allowable values: See Table \ref{tab:currency} \lstinline!Currency!.
103105

104-
\item BoughtAmount: The amount in the BoughtCurrency.
106+
\item \lstinline!BoughtAmount!: The amount in the BoughtCurrency.
105107

106108
Allowable values: Any positive real number.
107109

108-
\item SoldCurrency: The sold currency of the FX barrier option. See OptionData above for more details.
110+
\item \lstinline!SoldCurrency!: The sold currency of the FX barrier option. See OptionData above for more details.
109111

110112
Allowable values: See Table \ref{tab:currency} \lstinline!Currency!.
111113

112-
\item SoldAmount: The amount in the SoldCurrency.
114+
\item \lstinline!SoldAmount!: The amount in the SoldCurrency.
113115

114116
Allowable values: Any positive real number.
115117

Docs/UserGuide/tradedata/fx_doublebarrieroption.tex

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,44 +77,46 @@ \subsubsection{FX Double Barrier Option}
7777

7878
\item \lstinline!Settlement! The allowable values are \emph{Cash} or \emph{Physical}.
7979

80+
\item A \lstinline!PaymentData! [Optional] node can be added which defines the settlement of the option payoff.
81+
8082
\item An \lstinline!ExerciseDates! node where exactly one ExerciseDate date element must be given.
8183

82-
\item Premiums [Optional]: Option premium amounts paid by the option buyer to the option seller.
84+
\item \lstinline!Premiums! [Optional]: Option premium amounts paid by the option buyer to the option seller.
8385

8486
Allowable values: See section \ref{ss:premiums}
8587

8688
\end{itemize}
8789

8890

89-
\item BarrierData: This is a trade component sub-node outlined in section \ref{ss:barrier_data}.
91+
\item \lstinline!BarrierData!: This is a trade component sub-node outlined in section \ref{ss:barrier_data}.
9092
Levels specified in BarrierData should be quoted as the amount in SoldCurrnecy per unit BoughtCurrency, with both currencies as defined in FxDoubleBarrierOptionData node.
9193
Changing the option from Call to Put or vice versa does not require switching the barrier levels. Two levels in ascending order should be defined in \lstinline!Levels!. \lstinline!Type! should be \emph{KnockOut} or \emph{KnockIn}.
9294

93-
\item StartDate[Optional]: The start date for checking if a barrier has been breached prior to today's date. If omitted or left blank no check is made and it is assumed no barrier has been breached in the past. Has no impact if set to today's date or a date in the future.
95+
\item \lstinline!StartDate! [Optional]: The start date for checking if a barrier has been breached prior to today's date. If omitted or left blank no check is made and it is assumed no barrier has been breached in the past. Has no impact if set to today's date or a date in the future.
9496

9597
Allowable values: See \lstinline!Date! in Table \ref{tab:allow_stand_data}.
9698

97-
\item Calendar[Optional]: The calendar associated with the FX Index. Required if StartDate is set to a date prior to today's date, otherwise optional.
99+
\item \lstinline!Calendar! [Optional]: The calendar associated with the FX Index. Required if StartDate is set to a date prior to today's date, otherwise optional.
98100

99101
Allowable values: See Table \ref{tab:calendar} Calendar.
100102

101-
\item FXIndex[Optional]: A reference to an FX Index source to check if the barrier has been breached. Required if StartDate is set to a date prior to today's date, otherwise optional and can be omitted but not left blank.
103+
\item \lstinline!FXIndex! [Optional]: A reference to an FX Index source to check if the barrier has been breached. Required if StartDate is set to a date prior to today's date, otherwise optional and can be omitted but not left blank.
102104

103105
Allowable values: The format of the FX Index is``FX-SOURCE-CCY1-CCY2'' as described in table \ref{tab:fxindex_data}.
104106

105-
\item BoughtCurrency: The bought currency of the FX barrier option. See OptionData above for more details.
107+
\item \lstinline!BoughtCurrency!: The bought currency of the FX barrier option. See OptionData above for more details.
106108

107109
Allowable values: See Table \ref{tab:currency} \lstinline!Currency!.
108110

109-
\item BoughtAmount: The amount in the BoughtCurrency.
111+
\item \lstinline!BoughtAmount!: The amount in the BoughtCurrency.
110112

111113
Allowable values: Any positive real number.
112114

113-
\item SoldCurrency: The sold currency of the FX barrier option. See OptionData above for more details.
115+
\item \lstinline!SoldCurrency!: The sold currency of the FX barrier option. See OptionData above for more details.
114116

115117
Allowable values: See Table \ref{tab:currency} \lstinline!Currency!.
116118

117-
\item SoldAmount: The amount in the SoldCurrency.
119+
\item \lstinline!SoldAmount!: The amount in the SoldCurrency.
118120

119121
Allowable values: Any positive real number.
120122

0 commit comments

Comments
 (0)