Skip to content

Commit 72087c4

Browse files
author
Damien Barker
committed
QPR-12959 update with master and resolve conflicts
2 parents f7ab4ab + 352cd1b commit 72087c4

78 files changed

Lines changed: 2550 additions & 2382 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.

Docs/UserGuide/curve_configurations/default_curves_from_cds.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ \subsubsection{Default Curves from CDS}
1515
The default curve's currency.
1616

1717
\item \lstinline!Type!:
18-
For a default curve built from CDS, the \lstinline!Type! should be set to \lstinline!SpreadCDS! if the \lstinline!Quotes! reference CDS spread quotes or \lstinline!Price! if the \lstinline!Quotes! reference upfront price quotes.
18+
For a default curve built from CDS, the \lstinline!Type! should be set to \lstinline!SpreadCDS! if the \lstinline!Quotes! reference CDS spread quotes or \lstinline!Price! if the \lstinline!Quotes! reference upfront price quotes or \lstinline!ConvSpreadCDS! if the \lstinline!Quotes! reference Conventional CDS spread quotes. Note that if ConvSpreadCDS or Price is used, the model will be IsdaCdsEngine. Else, MidPointCdsEngine.
1919

2020
\item \lstinline!DiscountCurve!:
2121
A reference to a valid discount curve specification that will be used to discount cashflows during the bootstrap process. It should be of the form \lstinline!Yield/Currency/curve_name! where \lstinline!curve_name! is the name of a yield curve defined in the yield curve configurations.
@@ -43,7 +43,7 @@ \subsubsection{Default Curves from CDS}
4343
using the adjacent terms of the provided quotes.
4444

4545
\item \lstinline!Quotes!:
46-
The \lstinline!Quotes! element should be populated with a list of valid \lstinline!Quote! elements. If the \lstinline!Type! is \lstinline!SpreadCDS!, the quotes should be CDS spread quote strings as documented in Section \ref{md:cds_spread_quote} and if \lstinline!Type! is \lstinline!Price!, the quotes should be CDS upfront price quote strings as documented in Section \ref{md:cds_price_quote}. The attribute \lstinline!optional! in the \lstinline!Quote! element should be set to \lstinline!true! if the associated quote is optional and set to \lstinline!false! if the associated quote is mandatory. If a quote is mandatory and not found in the market, the default curve building will fail. The attribute \lstinline!optional! may be omitted from the quote element. In this case, it defaults to \lstinline!false! and the quote is mandatory. Note also that instead of a list of explicit quotes, a single quote may be provided with the wildcard character \lstinline!*!. In this case, the market is searched for quotes matching the pattern. For example, \lstinline!CDS/CREDIT_SPREAD/JPM/SNRFOR/USD/XR14/*! would return all quotes in the market that start with \lstinline!CDS/CREDIT_SPREAD/JPM/SNRFOR/USD/XR14!.
46+
The \lstinline!Quotes! element should be populated with a list of valid \lstinline!Quote! elements. If the \lstinline!Type! is \lstinline!SpreadCDS!, the quotes should be CDS spread quote strings as documented in Section \ref{md:cds_spread_quote} and if \lstinline!Type! is \lstinline!Price!, the quotes should be CDS upfront price quote strings as documented in Section \ref{md:cds_price_quote} and If the \lstinline!Type! is \lstinline!ConvSpreadCDS!, the quotes should be Conv CDS spread quote strings as documented in Section \ref{md:cds_spread_quote}. The attribute \lstinline!optional! in the \lstinline!Quote! element should be set to \lstinline!true! if the associated quote is optional and set to \lstinline!false! if the associated quote is mandatory. If a quote is mandatory and not found in the market, the default curve building will fail. The attribute \lstinline!optional! may be omitted from the quote element. In this case, it defaults to \lstinline!false! and the quote is mandatory. Note also that instead of a list of explicit quotes, a single quote may be provided with the wildcard character \lstinline!*!. In this case, the market is searched for quotes matching the pattern. For example, \lstinline!CDS/CREDIT_SPREAD/JPM/SNRFOR/USD/XR14/*! would return all quotes in the market that start with \lstinline!CDS/CREDIT_SPREAD/JPM/SNRFOR/USD/XR14!.
4747

4848
\item \lstinline!Conventions!:
4949
The name of a valid set of CDS conventions, as documented in Section \ref{sss:cds_conventions}, to use in the bootstrap.

Docs/UserGuide/curve_configurations/yieldcurves.tex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ \subsubsection*{Direct Segment}
160160
or discount factor. The \lstinline!Conventions! node contains the ID of a node in the {\tt conventions.xml} file
161161
described in section \ref{sec:conventions}. The \lstinline!Conventions! node associates conventions with the quotes.
162162
163-
For \emph{Discount} type segments, the quotes can be given using a wildcard. Any valid and matching quotes will then be loaded from the provided market data. An example wildcard is:
163+
For both \emph{Zero} and \emph{Discount} type segments, the quotes can be given using a wildcard. Any valid and matching quotes will then be loaded from the provided market data. Example wildcards are:
164164
\begin{itemize}
165-
\item {DISCOUNT/RATE/EUR/EUR3M/*}
165+
\item {ZERO/RATE/EUR/*} - matches all EUR zero rate quotes
166+
\item {DISCOUNT/RATE/EUR/EUR3M/*} - matches all EUR discount factor quotes for the EUR3M curve
166167
\end{itemize}
167168
168169
\begin{listing}[H]

Docs/UserGuide/marketdata.tex

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ \section{Market Data}\label{sec:market_data}
3232
\hline
3333
Instrument Type & \emph{ZERO, DISCOUNT, MM, MM\_FUTURE, FRA, IMM\_FRA,
3434
IR\_SWAP, BASIS\_SWAP, CC\_BASIS\_SWAP, CDS, CDS\_INDEX, FX\_SPOT, FX\_FWD,
35-
SWAPTION, CAPFLOOR, FX\_OPTION, HAZARD\_RATE, RECOVERY\_RATE,
35+
SWAPTION, CAPFLOOR, FX\_OPTION, HAZARD\_RATE, RECOVERY\_RATE, ASSUMED\_RECOVERY\_RATE,
3636
ZC\_INFLATIONSWAP, YY\_INFLATIONSWAP, ZC\_INFLATIONCAPFLOOR,
3737
SEASONALITY, EQUITY\_SPOT, EQUITY\_FWD, EQUITY\_DIVIDEND,
3838
EQUITY\_OPTION, BOND, INDEX\_CDS\_OPTION, CPR, COMMODITY, COMMODITY\_FWD, COMMODITY\_OPTION} \\
3939
\hline
40-
Quote Type & \emph{BASIS\_SPREAD, CREDIT\_SPREAD, YIELD\_SPREAD, HAZARD\_RATE,
40+
Quote Type & \emph{BASIS\_SPREAD, CREDIT\_SPREAD, CONV\_CREDIT\_SPREAD, YIELD\_SPREAD, HAZARD\_RATE,
4141
RATE, RATIO, PRICE, RATE\_LNVOL, RATE\_NVOL, RATE\_SLNVOL,
4242
BASE\_CORRELATION, SHIFT} \\
4343
\hline
@@ -678,6 +678,14 @@ \subsection{CDS Spread}
678678
\item \lstinline!CDS/CREDIT_SPREAD/RBS/SUBLT2/EUR/MR14/10Y/500!
679679
\item \lstinline!CDS/CREDIT_SPREAD/RBS/SUBLT2/EUR/1Y!
680680
\item \lstinline!CDS/CREDIT_SPREAD/RBS/SUBLT2/EUR/1Y/500!
681+
\item \lstinline!CDS/CONV_CREDIT_SPREAD/JPM/SNRFOR/USD/5Y!
682+
\item \lstinline!CDS/CONV_CREDIT_SPREAD/JPM/SNRFOR/USD/5Y/100!
683+
\item \lstinline!CDS/CONV_CREDIT_SPREAD/JPM/SNRFOR/USD/XR14/5Y!
684+
\item \lstinline!CDS/CONV_CREDIT_SPREAD/JPM/SNRFOR/USD/XR14/5Y/100!
685+
\item \lstinline!CDS/CONV_CREDIT_SPREAD/RBS/SUBLT2/EUR/MR14/10Y!
686+
\item \lstinline!CDS/CONV_CREDIT_SPREAD/RBS/SUBLT2/EUR/MR14/10Y/500!
687+
\item \lstinline!CDS/CONV_CREDIT_SPREAD/RBS/SUBLT2/EUR/1Y!
688+
\item \lstinline!CDS/CONV_CREDIT_SPREAD/RBS/SUBLT2/EUR/1Y/500!
681689
\end{itemize}
682690

683691
\subsection{CDS Upfront Price}
@@ -721,7 +729,7 @@ \subsection{CDS Recovery Rate}
721729
\begin{tabular}{|p{3cm}|p{3.5cm}|p{7cm}|}
722730
\hline
723731
{\bf Property} & {\bf Allowable values} & {\bf Description} \\ \hline
724-
Instrument Type & \lstinline!RECOVERY_RATE! & \\ \hline
732+
Instrument Type & \lstinline!RECOVERY_RATE! or \lstinline!ASSUMED_RECOVERY_RATE! & \\ \hline
725733
Quote Type & \lstinline!RATE! & \\ \hline
726734
Entity & String & The CDS reference entity name \\ \hline
727735
Tier & String & The CDS tier \\ \hline
@@ -772,17 +780,20 @@ \subsection{Security Recovery Rate}\label{md:sec_rec_rates}
772780
\begin{tabular}{|p{3cm}|p{3.5cm}|p{7cm}|}
773781
\hline
774782
{\bf Property} & {\bf Allowable values} & {\bf Description} \\ \hline
775-
Instrument Type & \emph{RECOVERY\_RATE} & \\ \hline
783+
Instrument Type & \emph{RECOVERY\_RATE} or \emph{ASSUMED\_RECOVERY\_RATE} & \\ \hline
776784
Quote Type & \emph{RATE} & \\ \hline
777785
ID & String & Security ID \\ \hline
778786
\end{tabular}
779787
\caption{Security Recovery Rate}
780788
\label{tab:secrecrate_quote}
781789
\end{table}
782790

791+
Currently, only par (real) recovery rates (quote type \lstinline!RECOVERY_RATE!) are supported.
792+
783793
Example:
784794
\begin{itemize}
785795
\item {RECOVERY\_RATE/RATE/SECURITY\_1}
796+
\item {ASSUMED\_RECOVERY\_RATE/RATE/SECURITY\_1}
786797
\end{itemize}
787798

788799
% %- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Docs/UserGuide/parameterisation/ore.tex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ \subsubsection*{Setup}
2727
<Parameter name="fixingDataFile">../../Input/fixings_20160205.txt</Parameter>
2828
<Parameter name="dividendDataFile">../../Input/dividends_20160205.txt</Parameter> <!-- Optional -->
2929
<Parameter name="implyTodaysFixings">Y</Parameter>
30+
<Parameter name="useAtParCouponsCurves">Y</Parameter>
31+
<Parameter name="useAtParCouponsTrades">Y</Parameter>
3032
<Parameter name="curveConfigFile">../../Input/curveconfig.xml</Parameter>
3133
<Parameter name="conventionsFile">../../Input/conventions.xml</Parameter>
3234
<Parameter name="marketConfigFile">../../Input/todaysmarket.xml</Parameter>
@@ -73,6 +75,11 @@ \subsubsection*{Setup}
7375
conventions.xml}, the referenceDataFile {\tt referencedata.xml}, the iborFallbackConfig, the marketDataFile and the
7476
fixingDataFile are explained in the sections below.
7577

78+
\medskip The parameters {\tt useAtParCouponsCurves} and {\tt useAtParCouponsTrades} control whether to use par
79+
approximation or indexed ibor coupons when building curves or building ore trades, respectively. This goes back to the
80+
QuantLib flag \verb+QL_USE_INDEXED_COUPON+ and the associated runtime setting. The default is \verb+true+ for both flags
81+
which is also the default setting when building QuantLib.
82+
7683
\medskip Parameter {\tt calendarAdjustment} includes the {\tt calendarAdjustment.xml} which lists out additional holidays and
7784
business days to be added to specified calendars.
7885

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
\subsubsection{Extended Accumulator}
2+
\label{pricing:extendedaccumulator}
3+
4+
An ExtendedAccumulator requires the party that is long to periodically buy an underlying asset A (FX, Equity, or Commodity) at a pre-determined strike price K.
5+
A feature of the ExtendedAccumulator is knock-out, i.e. the contract terminates early if a Barrier observed on a single date (the Extension Decision Date) is hit.
6+
$$
7+
PayOff= \sum \omega \cdot FixingAmount \cdot (K - X_A(T))
8+
$$
9+
Where:
10+
\begin{itemize}
11+
\item $\omega \in \{-1,1\}$ is $1$ for a long and $-1$ for a short position
12+
\item $FixingAmount$: the fixing amount in currency/unit of A
13+
\item $K$: the strike. For Fx, the Fx strike rate is defined as amount in domestic currency (CCY2) for one unit of foreign currency (CCY1). For Equity and Commodity: The strike value for one unit/share/contract of the underlying equity or commodity, expressed in the domestic currency (CCY2).
14+
\item $X_A(T)$: the fixing value of the asset A at each observation date T
15+
\end{itemize}

Docs/UserGuide/pricing/extendedfxforwardswap.tex

Lines changed: 0 additions & 13 deletions
This file was deleted.

Docs/UserGuide/products.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ \section{Introduction}
143143
\input{tradedata/basketoption}
144144
\input{tradedata/worstofbasketswap}
145145
\input{tradedata/accumulator}
146+
\input{tradedata/extendedaccumulator}
146147
\input{tradedata/tarf}
147148
\input{tradedata/knockoutswap}
148149
\input{tradedata/strikeresettableoption}
@@ -292,6 +293,7 @@ \subsection{FX / Equity / Commodity / Rates / Inflation Exotics}
292293
\input{pricing/rainbow_option}
293294
\input{pricing/var_and_vol_derivatives}
294295
\input{pricing/accumulator}
296+
\input{pricing/extendedaccumulator}
295297
\input{pricing/tarf}
296298
\input{pricing/knockoutswap}
297299
\input{pricing/strikeresettableoption}
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
\subsubsection{Extended Accumulator}
2+
3+
Extended Accumulator are represented as scripted trades, refer to appendix A for an introduction. Below shows the structure of an example.
4+
5+
An Extended Accumulator is like an Accumulator with regular and conditional observation and settlement dates. After the regular observation dates a European barrier is applied on
6+
the Extension Decision Date. If the barrier is hit the trade terminates, otherwise the trade continues with cashflows generated on the conditional observation dates.
7+
8+
\begin{minted}[fontsize=\scriptsize]{xml}
9+
<Trade id="FxExtendedAccumulatorLong">
10+
<TradeType>ScriptedTrade</TradeType>
11+
<Envelope>
12+
<CounterParty>CPTY_A</CounterParty>
13+
<NettingSetId>CRIF_20191230</NettingSetId>
14+
<AdditionalFields/>
15+
</Envelope>
16+
<ExtendedAccumulatorData>
17+
<LongShort type="longShort">Long</LongShort>
18+
<FixingAmount type="number">840336</FixingAmount>
19+
<Strike type="number">1.19</Strike>
20+
<PayCurrency type="currency">USD</PayCurrency>
21+
<Underlying type="index">FX-ECB-EUR-USD</Underlying>
22+
<ObservationDates type="event">
23+
<ScheduleData>
24+
<Dates>
25+
<Dates>
26+
<Date>2019-09-30</Date>
27+
<Date>2019-10-31</Date>
28+
<Date>2019-11-28</Date>
29+
<Date>2019-12-31</Date>
30+
<Date>2020-01-30</Date>
31+
<Date>2020-02-27</Date>
32+
</Dates>
33+
</Dates>
34+
</ScheduleData>
35+
</ObservationDates>
36+
<ObservationSettlementDates type="event">
37+
<ScheduleData>
38+
<Dates>
39+
<Dates>
40+
<Date>2019-10-02</Date>
41+
<Date>2019-11-02</Date>
42+
<Date>2019-12-30</Date>
43+
<Date>2020-01-02</Date>
44+
<Date>2020-02-03</Date>
45+
<Date>2020-03-30</Date>
46+
</Dates>
47+
</Dates>
48+
</ScheduleData>
49+
</ObservationSettlementDates>
50+
<ExtensionDecisionDate type="event">2020-02-25</ExtensionDecisionDate>
51+
<ExtensionTrigger type="number">1.19</ExtensionTrigger>
52+
<ConditionalObservationDates type="event">
53+
<ScheduleData>
54+
<Dates>
55+
<Dates>
56+
<Date>2020-03-31</Date>
57+
<Date>2020-04-30</Date>
58+
<Date>2020-05-29</Date>
59+
<Date>2020-06-30</Date>
60+
<Date>2020-07-31</Date>
61+
<Date>2020-08-31</Date>
62+
</Dates>
63+
</Dates>
64+
</ScheduleData>
65+
</ConditionalObservationDates>
66+
<ConditionalSettlementDates type="event">
67+
<ScheduleData>
68+
<Dates>
69+
<Dates>
70+
<Date>2020-03-31</Date>
71+
<Date>2020-04-30</Date>
72+
<Date>2020-05-29</Date>
73+
<Date>2020-06-30</Date>
74+
<Date>2020-07-31</Date>
75+
<Date>2020-08-31</Date>
76+
</Dates>
77+
</Dates>
78+
</ScheduleData>
79+
</ConditionalSettlementDates>
80+
</ExtendedAccumulatorData>
81+
</Trade>
82+
\end{minted}
83+
84+
The meanings and allowable values of the elements in the \verb+Extended Accumulator+ representation follow below.
85+
86+
\begin{itemize}
87+
\item LongShort: Defines whether the trade is long or short, i.e long means one buys the underlying asset and short sells the underlying asset at each observation date. \\
88+
Allowable values: \emph{Long, Short}
89+
\item Strike: For Fx, the Fx strike rate is defined as amount in domestic currency (CCY2) for one unit of foreign currency (CCY1). For Equity and Commodity: The strike value for one unit/share/contract of the underlying equity or commodity, expressed in the domestic currency (CCY2).
90+
\item Underlying: Underlying index. For Fx: Value is a string of the form FX-SOURCE-CCY1-CCY2 where CCY1 is the foreign currency, CCY2 is the domestic currency, and SOURCE is the fixing source.\\
91+
Allowable values: See Section \ref{data_index} for allowable values.
92+
\item FixingAmount: The unleveraged notional amount accumulated at each fixing date. - For Fx: The FixingAmount is expressed in the foreign currency (CCY1). Note that the underlying is provided in the form \lstinline!FX-SOURCE-CCY1-CCY2! (see Table \ref{tab:fxindex_data}). For Equity: The FixingAmount is expressed as number of shares/units of the underlying equity or equity index. For Commodity: The FixingAmount is expressed as number of units of the underlying commodity. \\
93+
Allowable values: Any real number. Note that a negative amount causes a Long ExtendedAccumulator to be a Short, and vice-versa
94+
\item PayCurrency: The payout currency. The result of the payout formula is treated to be in this currency. Note that for (non-quanto) ExtendedAccumulators this should be the domestic (CCY2) currency.
95+
\item ExtensionDecisionDate: the date on which the Extension Condition is decided on
96+
\item ExtensionTrigger: the value of the index below which a Trigger Event occurs on Extension Decision Date. It is expressed in the same way as Strike outlined above. If the underlying on the extension decision date is above the barrier level, it triggers the extension on conditional observation dates. Else, the trade terminate at last observation date.
97+
\item SettlementDate: the settlement date of the option payoff
98+
\item ObservationDates: the dates on which the underlying index value is observed, define the exchange of notionals
99+
\item ObservationSettlementDates: observation settlement dates
100+
\item ConditionalObservationDates: the dates on which the underlying index value is observed, define the exchange of notionals
101+
\item ConditionalSettlementDates: conditional observation settlement dates
102+
\end{itemize}
103+
104+
The script `ExtendedAccumulator' referenced in the trade above is shown in Listing \ref{lst:extendedaccumulator_script}.\\
105+
PayOff Formula:
106+
107+
$$
108+
PayOff = \sum \omega \cdot FixingAmount \cdot (K - X_A(T))
109+
$$
110+
111+
Where:
112+
\begin{itemize}
113+
\item $\omega \in \{-1,1\}$ is $1$ for a long and $-1$ for a short position
114+
\item $FixingAmount$: the fixing amount in currency/unit of A
115+
\item $K$: the strike. For Fx, the Fx strike rate is defined as amount in domestic currency (CCY2) for one unit of foreign currency (CCY1). For Equity and Commodity: The strike value for one unit/share/contract of the underlying equity or commodity, expressed in the domestic currency (CCY2).
116+
\item $X_A(T)$: the fixing value of the asset A at each observation date T
117+
\end{itemize}
118+
119+
\begin{listing}[hbt]
120+
\begin{minted}[fontsize=\scriptsize]{Basic}
121+
REQUIRE {FixingAmount >= 0} AND {Strike >= 0};
122+
REQUIRE {SIZE(ConditionalObservationDates) == SIZE(ConditionalSettlementDates)};
123+
NUMBER d, Fixing;
124+
125+
FOR d IN (1, SIZE(ObservationDates), 1) DO
126+
Fixing = Underlying(ObservationDates[d]);
127+
Value = Value + PAY(LongShort * FixingAmount * (Strike-Fixing), ObservationDates[d], ObservationSettlementDates[d], PayCurrency);
128+
END;
129+
130+
IF Underlying(ExtensionDecisionDate)>ExtensionTrigger THEN
131+
FOR d IN (1, SIZE(ConditionalObservationDates), 1) DO
132+
Fixing = Underlying(ConditionalObservationDates[d]);
133+
Value = Value + PAY(LongShort * FixingAmount * (Strike-Fixing), ConditionalObservationDates[d], ConditionalSettlementDates[d], PayCurrency);
134+
END;
135+
END;
136+
currentNotional = FixingAmount * Strike;
137+
\end{minted}
138+
\caption{ExtendedAccumulator Script}
139+
\label{lst:extendedaccumulator_script}
140+
\end{listing}
141+

0 commit comments

Comments
 (0)