Skip to content

Commit 24c5511

Browse files
committed
Merge remote-tracking branch 'upstream/master' into index-replacements
2 parents 8f0b79a + ce3294f commit 24c5511

123 files changed

Lines changed: 4094 additions & 2809 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,6 +1,6 @@
11
TAG=latest
22
DEBIAN_TAG=11.7
3-
QL_TAG=1.30_9921a4d7
3+
QL_TAG=1.30_4274655e
44
BOOST_TAG=1.78.0
55
BOOST_DIR=1_78_0
66
NUM_CORES=16

Docs/UserGuide/tradecomponents/floatinglegdata.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ \subsubsection{Floating Leg Data, Spreads, Gearings, Caps and Floors}
250250
251251
\item Caps [Optional]: This node contains child elements of type \lstinline!Cap! indicating that the coupon rate is
252252
capped at the given rate (after applying gearing and spread, if any). The mode of specification is analogous to
253-
spreads, see above. Caps / Floors are supported for Ibor and compounded / averaged OIS coupons, but not for coupons
253+
spreads, see above. Caps / Floors are supported for Ibor, SIFMA, compounded / averaged OIS coupons, but not for coupons
254254
with subperiods.
255255
256256
For OIS coupons notice how the gearing $g$ and spread $s$ enter the calculation of the coupon amount $A$ dependent on

Docs/UserGuide/tradedata/capfloor.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
\subsubsection{Cap/Floor}
22
\label{ss:capfloor}
33

4-
The \lstinline!CapFloorData! node is the trade data container for the \emph{CapFloor} trade type. It's a cap, floor or collar
5-
(i.e. a portfolio of a long cap and a short floor for a long position in the collar) on a series of Ibor or CMS rates.
4+
The \lstinline!CapFloorData! node is the trade data container for the \emph{CapFloor} trade type. It's a cap, floor or
5+
collar (i.e. a portfolio of a long cap and a short floor for a long position in the collar) on a series of Ibor, SIFMA,
6+
OIS, CMS, Duration-adjusted CMS, CMS Spread, CPI, YY coupons.
67

78
The \lstinline!CapFloorData! node contains a \lstinline!LongShort! sub-node which indicates whether the cap (floor, collar)
89
is long or short, and a \lstinline!LegData! sub-node where the

Docs/UserGuide/tradedata/commodityoption.tex

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,24 +118,29 @@ \subsubsection{Commodity Spread Option}
118118
Exactly one payer and one receiver leg are required, the leg with \lstinline!isPayer! setto \emph{true} is the long (positive) position in the spread payoff.
119119

120120
Within the two \lstinline!LegData!, the \lstinline!Quantity! node has must be equal.
121-
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.
121+
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. The gearing could also be used for the heat rate factor in spark / heat rate options.
122122

123123
Other than the two legs, the following nodes complete the \lstinline!CommoditySpreadOptionData! container:
124124
\begin{itemize}
125125
\item \lstinline!SpreadStrike!: The strike value for the spread. Allowable values: Any real number.
126126
\item \lstinline!OptionData!: This is a trade component sub-node outlined in section \ref{ss:option_data}.
127127
The relevant fields in the \lstinline!OptionData! node for an CommoditySpreadOption are
128-
129-
\begin{itemize}
130-
\item \lstinline!LongShort! The allowable values are \emph{Long} or \emph{Short}.
131-
132-
\item \lstinline!OptionType! The allowable values are \emph{Call} or \emph{Put}.
133-
134-
\item A \lstinline!PaymentData! [Optional] node can be added which defines the settlement date of the option payoff.
135-
136-
\item \lstinline!Premiums! [Optional]: Option premium amounts paid by the option buyer to the option seller. See section \ref{ss:premiums}
137-
138-
\end{itemize}
128+
\begin{itemize}
129+
\item \lstinline!LongShort! The allowable values are \emph{Long} or \emph{Short}.
130+
131+
\item \lstinline!OptionType! The allowable values are \emph{Call} or \emph{Put}.
132+
133+
\item A \lstinline!PaymentData! [Optional] node can be added which defines the settlement date of the option payoff.
134+
135+
\item \lstinline!Premiums! [Optional]: Option premium amounts paid by the option buyer to the option seller. See section \ref{ss:premiums}
136+
\end{itemize}
137+
\item \lstinline!OptionStripPaymentDates! [Optional]: If the number of cashflows per leg is greater than 1, we can group options by their expiry date into strips. All option in a strip will have the same payment date as defined in this node. The payment date will be \emph{lag} business days after the latest expiry date in the strip. The node has following sub-nodes:
138+
\begin{itemize}
139+
\item \lstinline!OptionStripDefinition! A schedule node \ref{ss:schedule_data} defining the option strips. The $n$ dates in the schedule defining $n-1$ strips, each strip include the period's start date and excludes period's end date. All options with expiry within start and end of a period are falling in the same strip. The schedule has to cover all option expiries. The first date in the schedule has to be before or on the first expiry date of the options and the last date in the schedule has to be after last expiry date of the options.
140+
\item \lstinline!PaymentCalendar! Calendar defining valid business days for the payment date.
141+
\item \lstinline!PaymentLag! number of business days.
142+
\item \lstinline!PaymentConvention! business day convention for the option strip payment date.
143+
\end{itemize}
139144
\end{itemize}
140145

141146
\begin{listing}[H]
@@ -164,6 +169,22 @@ \subsubsection{Commodity Spread Option}
164169
</Premiums>
165170
</OptionData>
166171
<SpreadStrike>2.3</SpreadStrike>
172+
<OptionStripPaymentDates>
173+
<OptionStripDefinition>
174+
<Rules>
175+
<StartDate>2023-07-01</StartDate>
176+
<EndDate>2023-10-01</EndDate>
177+
<Tenor>1M</Tenor>
178+
<Calendar>NullCalendar</Calendar>
179+
<Convention>Unadjusted</Convention>
180+
<TermConvention>Unadjusted</TermConvention>
181+
<Rule>Backward</Rule>
182+
</Rules>
183+
</OptionStripDefinition>
184+
<PaymentCalendar>ICE_FuturesUS,US-NERC</PaymentCalendar>
185+
<PaymentLag>5</PaymentLag>
186+
<PaymentConvention>MF</PaymentConvention>
187+
</OptionStripPaymentDates>
167188
</CommoditySpreadOptionData>
168189
\end{minted}
169190
\caption{Commodity Option data}

Docs/UserGuide/tradedata/crosscurrencyswap.tex

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ \subsubsection{Cross Currency Swap}
77
\item Optionally additional legs of type \emph{Cashflow}.
88
\end{itemize}
99

10-
10+
Rebalancing\\
1111
A Cross Currency Swap can be rebalancing, meaning the notional amount on one leg resets to the equivalent of a fixed amount in another currency (called ForeignCurrency, and is typically the currency of the other leg) at each period. This is represented using an \lstinline!FXReset! node on the resetting/rebalancing leg, within the \lstinline!Notionals! node.
1212

1313
Note that for rebalancing Cross Currency Swaps, the Notional in leg currency on the rebalancing leg is optional. If set, it is used as starting notional, and causes the first period (if forward starting) to be considered as "on-the-run" for purposes of SIMM exemptions as the fx rate for the notional is considered to have been fixed from the inception of the trade. If no notional on the rebalancing leg is set, the starting notional will be based on a projected fx rate (i.e. not "on-the-run") until the actual fixing date.
@@ -127,3 +127,56 @@ \subsubsection{Cross Currency Swap}
127127
\label{lst:crosscurrencyswapreset}
128128
\end{listing}
129129

130+
Non-Deliverable\\
131+
Note that Cross Currency Swaps having legs in non-deliverable currencies with payment in a deliverable currency are supported by using the Indexings node (\ref{ss:indexings}), setting Settlement to \emph{Cash} and setting the Currency to the deliverable currency, while keeping the Notional expressed in the non-deliverable currency amount.
132+
133+
The Indexings node includes a mandatory fx Index field defining the deliverable and non-deliverable currency pair, and an optional InitialNotionalFixing field for the contractual fx rate to be applied to the initial notional exchange. Notice that the InitialNotionalFixing rate has to be expressed as amount in deliverable or payment currency per unit of non-deliverable currency, and if omitted defaults to a projected (if in the future) or an fx fixing from market data (if in the past). The Indexing node can also include optional FixingCalendar, IsInArrears and FixingDays fields to determine the date(s) of the fx fixing(s).
134+
135+
Listing \ref{lst:ndir_xccy_swap} includes an example USD-CLP non-deliverable cross currency swap where one leg is in CLP which is a non-deliverable
136+
currency, and the other is in USD which is deliverable. Note that it is possible for both legs to be in different non-deliverable currencies.
137+
138+
\begin{listing}[H]
139+
%\hrule\medskip
140+
\begin{minted}[fontsize=\footnotesize]{xml}
141+
<SwapData>
142+
<Settlement>Cash</Settlement>
143+
<LegData>
144+
<LegType>Floating</LegType>
145+
<Payer>false</Payer>
146+
<Currency>USD</Currency>
147+
<Notionals>
148+
<Notional>1000000</Notional>
149+
<Exchanges>
150+
<NotionalInitialExchange>true</NotionalInitialExchange>
151+
<NotionalFinalExchange>true</NotionalFinalExchange>
152+
</Exchanges>
153+
</Notionals>
154+
...
155+
</LegData>
156+
<LegData>
157+
<LegType>Floating</LegType>
158+
<Payer>false</Payer>
159+
<Currency>USD</Currency><!-- Payment currency is USD rather than CLP -->
160+
<Notionals>
161+
<Notional>850000000</Notional><!-- in CLP -->
162+
<Exchanges>
163+
<NotionalInitialExchange>true</NotionalInitialExchange>
164+
<NotionalFinalExchange>true</NotionalFinalExchange>
165+
</Exchanges>
166+
</Notionals>
167+
<Indexings>
168+
<Indexing>
169+
<Index>FX-TR20H-CLP-USD</Index><!-- to convert CLP flows into USD -->
170+
<FixingCalendar>CLP,USD</FixingCalendar>
171+
<IsInArrears>true</IsInArrears>
172+
<FixingDays>2</FixingDays>
173+
<InitialNotionalFixing>0.15</InitialNotionalFixing><!-- applied to initial ntl exchange -->
174+
</Indexing>
175+
</Indexings>
176+
...
177+
</LegData>
178+
</SwapData>
179+
\end{minted}
180+
\caption{Non deliverable Cross Currency Swap}
181+
\label{lst:ndir_xccy_swap}
182+
\end{listing}

Docs/UserGuide/tradedata/swap.tex

Lines changed: 2 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -32,65 +32,10 @@ \subsubsection{Swap}
3232
\end{listing}
3333

3434

35-
Note that Swaps for non-deliverable currencies with payment in a deliverable currency are supported using the Indexings node (\ref{ss:indexings}).
35+
Note that Swaps in non-deliverable currencies with payment in a deliverable currency are supported by setting Settlement to \emph{Cash} and - on both legs - using the Indexings node (\ref{ss:indexings}), as well as setting the Currency to the deliverable currency, while keeping the Notional expressed in the non-deliverable currency amount.
3636

37-
A non-deliverable cross currency Swap has Settlement set to \emph{Cash}, and one leg is a regular leg in the deliverable
38-
currency without Indexings. The other leg has Currency set to the deliverable currency, Notional in the non–deliverable
39-
currency and Indexings with an FX Index between the deliverable and non-deliverable currency. See Listing
40-
\ref{lst:ndir_xccy_swap} for an example USD-CLP non-deliverable cross currency swap where CLP is the non–deliverable
41-
currency. Notice that a contractual fx rate to be applied to the initial notional exchange is specified in the field
42-
\emph{InitialNotionalFixing}. Notice that this rate has to be expressed with target currency = payment currency.
37+
Within the Indexings node, an fx Index field is mandatory defining the deliverable and non-deliverable currencies and fixing source. The Indexing node can also include optional FixingCalendar, IsInArrears and FixingDays fields to determine the date(s) of the fx fixing(s). See Listing \ref{lst:ndir_swap} for an example non-deliverable IR swap where USD is the payment currency and CLP is the non-deliverable currency.
4338

44-
A non-deliverable IR Swap has Currency set to the deliverable currency on both legs, Notional in the non-deliverable
45-
currency on both legs, and Indexings with an FX Index between the deliverable and non-deliverable currency on both
46-
legs. See Listing \ref{lst:ndir_swap} for an example non-deliverable IR swap where USD is the payment currency and CLP
47-
is the non-deliverable currency.
48-
49-
\begin{listing}[H]
50-
%\hrule\medskip
51-
\begin{minted}[fontsize=\footnotesize]{xml}
52-
<SwapData>
53-
<Settlement>Cash</Settlement>
54-
<LegData>
55-
<LegType>Floating</LegType>
56-
<Payer>false</Payer>
57-
<Currency>USD</Currency>
58-
<Notionals>
59-
<Notional>1000000</Notional>
60-
<Exchanges>
61-
<NotionalInitialExchange>true</NotionalInitialExchange>
62-
<NotionalFinalExchange>true</NotionalFinalExchange>
63-
</Exchanges>
64-
</Notionals>
65-
...
66-
</LegData>
67-
<LegData>
68-
<LegType>Floating</LegType>
69-
<Payer>false</Payer>
70-
<Currency>USD</Currency><!-- Payment currency is USD rather than CLP -->
71-
<Notionals>
72-
<Notional>850000000</Notional><!-- in CLP -->
73-
<Exchanges>
74-
<NotionalInitialExchange>true</NotionalInitialExchange>
75-
<NotionalFinalExchange>true</NotionalFinalExchange>
76-
</Exchanges>
77-
</Notionals>
78-
<Indexings>
79-
<Indexing>
80-
<Index>FX-TR20H-CLP-USD</Index><!-- to convert CLP flows into USD -->
81-
<FixingCalendar>CLP,USD</FixingCalendar>
82-
<IsInArrears>true</IsInArrears>
83-
<FixingDays>2</FixingDays>
84-
<InitialNotionalFixing>0.15</InitialNotionalFixing> <!-- applied to initial notional exchange -->
85-
</Indexing>
86-
</Indexings>
87-
...
88-
</LegData>
89-
</SwapData>
90-
\end{minted}
91-
\caption{Non deliverable Cross Currency Swap}
92-
\label{lst:ndir_xccy_swap}
93-
\end{listing}
9439

9540
\begin{listing}[H]
9641
%\hrule\medskip

Docs/UserGuide/tradedata/swaption.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ \subsubsection{Swaption}
9393

9494
\item \lstinline!OptionType![Optional]: This flag is optional for swaptions, and even if set, has no impact. Whether a swaption is a payer or receiver swaption is determined by the Payer flags on the legs of the underlying swap.
9595

96-
\item \lstinline!Style!: The exercise style of the Swaption. The allowable values are \emph{European} or \emph{Bermudan}.
96+
\item \lstinline!Style!: The exercise style of the Swaption. The allowable values are \emph{European}, \emph{Bermudan} or \emph{American}. Note that \emph{American} exercise style isn't supported, and if set to \emph{American}, it will behave as \emph{Bermudan} exercise style.
9797

9898
\item \lstinline!NoticePeriod![Optional]: The notice period defining the date (relative to the exercise date) on which the exercise
9999
decision has to be taken. If not given the notice period defaults to \emph{0D}, i.e. the notice date is identical to the

Examples/Example_23/ExpectedOutput/flows.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ averageOIS2,Swap,7,0,2019-08-09,Interest,-613308.8889,USD,0.0124040000,0.4944444
5959
averageOIS2,Swap,8,0,2020-02-10,Interest,-623645.5556,USD,0.0124040000,0.5027777778,2019-08-09,2020-02-10,0.0000,#N/A,#N/A,100000000.0000,0.9562859655,-596383.4921941592,0.8831293157,-526683.7453815951,EUR,#N/A,#N/A,#N/A,#N/A
6060
averageOIS2,Swap,9,0,2020-08-10,Interest,-620200.0000,USD,0.0124040000,0.5000000000,2020-02-10,2020-08-10,0.0000,#N/A,#N/A,100000000.0000,0.9483563111,-588170.5841673282,0.8831293157,-519430.6855356031,EUR,#N/A,#N/A,#N/A,#N/A
6161
averageOIS2,Swap,10,0,2021-02-09,Interest,-616754.4444,USD,0.0124040000,0.4972222222,2020-08-10,2021-02-09,0.0000,#N/A,#N/A,100000000.0000,0.9404493830,-580026.3367307166,0.8831293157,-512238.2618696701,EUR,#N/A,#N/A,#N/A,#N/A
62+
fra1,ForwardRateAgreement,1,0,2016-10-28,InterestProjected,-1372871.5757,EUR,-0.0007026433,19.2777777778,2016-10-28,2035-10-29,0.0000,2016-10-26,-0.0006926433,100000000.0000,1.0021811279,-1375865.9841961791,1.0000000000,-1375865.9841961791,EUR,#N/A,#N/A,#N/A,#N/A

0 commit comments

Comments
 (0)