Skip to content

Commit 4f1bc04

Browse files
author
jenkins
committed
git subrepo pull (merge) ore
subrepo: subdir: "ore" merged: "11c5c34e52" upstream: origin: "git@gitlab.acadiasoft.net:qs/ore.git" branch: "master" commit: "c7ca4f7bb9" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "73a0129"
2 parents 1c1799f + c7ca4f7 commit 4f1bc04

103 files changed

Lines changed: 8222 additions & 7793 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/tradecomponents/cmbleg.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ \subsubsection{Constant Maturity Bond Leg Data}
2222
...
2323
</ScheduleData>
2424
<CMBLegData>
25-
<Index>CMB-US-TBILL-13W</Index>
25+
<Index>CMB-US-TBILL-HD-13W</Index>
2626
<FixingDays>2</FixingDays>
2727
<Spreads>
2828
<Spread>0.0010</Spread>

Docs/UserGuide/tradedata/swaption.tex

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ \subsubsection{Swaption}
66
component sub-node. These trade components are outlined in section \ref{ss:option_data} and section
77
\ref{ss:leg_data}.\\
88
\vspace{5mm}
9-
Supported swaption exercise styles are \emph{European} and \emph{Bermudan}. Swaptions of both exercise styles can have an arbitrary number of legs, with
9+
Supported swaption exercise styles are \emph{European}, \emph{Bermudan}, \emph{American}. Swaptions of all exercise styles can have an arbitrary number of legs, with
1010
each leg represented by a \lstinline!LegData! sub-node. Cross currency swaptions are not supported for either exercise style, i.e. the Currency element must
1111
have the same value for all \lstinline!LegData! sub-nodes of a swaption. There must be at least one full coupon period after the exercise date for European
1212
Swaptions, and after the last exercise date for Bermudan Swaptions. See Table \ref{tab:swaption_requirements} for further details on requirements for
@@ -142,7 +142,79 @@ \subsubsection{Swaption}
142142
\item \lstinline!ExerciseFeeSettlementConvention![Optional]: The roll convention used to compute the exercise fee settlement date from
143143
the exercise date. Defaults to \emph{Unadjusted} if not given. Allowable values: See Table \ref{tab:convention} Roll Convention.
144144

145-
\item An \lstinline!ExerciseDates! node where exactly one \lstinline!ExerciseDate! date element must be given for \emph{European} style swaptions, and for \emph{Bermudan} style swaptions at least two \lstinline!ExerciseDate! date elements must be given. \\
145+
\item An \lstinline!ExerciseDates! node where for \emph{European} style swaptions exactly one \lstinline!ExerciseDate! date element must be given. \emph{Bermudan} style swaptions can have \lstinline!ExerciseDate! elements given directly (at least two \lstinline!ExerciseDate! elements must be given), or Rules or Dates based exercise dates. See Listings \ref{lst:bermudan_swaption_exercisedates}, \ref{lst:bermudan_swaption_rules} and \ref{lst:bermudan_swaption_dates}.
146+
147+
148+
\begin{listing}[H]
149+
\begin{minted}[fontsize=\footnotesize]{xml}
150+
<SwaptionData>
151+
<OptionData>
152+
<LongShort>Long</LongShort>
153+
<Style>Bermudan</Style>
154+
<Settlement>Physical</Settlement>
155+
<ExerciseDates>
156+
<ExerciseDate>2027-03-02</ExerciseDate>
157+
<ExerciseDate>2028-03-02</ExerciseDate>
158+
<ExerciseDate>2029-03-02</ExerciseDate>
159+
</ExerciseDates>
160+
...
161+
</OptionData>
162+
...
163+
\end{minted}
164+
\caption{Bermudan Swaption ExerciseDate:s}
165+
\label{lst:bermudan_swaption_exercisedates}
166+
\end{listing}
167+
168+
\begin{listing}[H]
169+
\begin{minted}[fontsize=\footnotesize]{xml}
170+
<SwaptionData>
171+
<OptionData>
172+
<LongShort>Long</LongShort>
173+
<Style>Bermudan</Style>
174+
<Settlement>Physical</Settlement>
175+
<ExerciseDates>
176+
<Rules>
177+
<StartDate>2027-03-02</StartDate>
178+
<EndDate>2029-03-02</EndDate>
179+
<Tenor>1Y</Tenor>
180+
<Calendar>US</Calendar>
181+
<Convention>MF</Convention>
182+
<Rules>
183+
</ExerciseDates>
184+
...
185+
</OptionData>
186+
...
187+
\end{minted}
188+
\caption{Bermudan Swaption Rules based}
189+
\label{lst:bermudan_swaption_rules}
190+
\end{listing}
191+
192+
\begin{listing}[H]
193+
\begin{minted}[fontsize=\footnotesize]{xml}
194+
<SwaptionData>
195+
<OptionData>
196+
<LongShort>Long</LongShort>
197+
<Style>Bermudan</Style>
198+
<Settlement>Physical</Settlement>
199+
<ExerciseDates>
200+
<Dates>
201+
<Calendar>NullCalendar</Calendar>
202+
<Convention>Unadjusted</Convention>
203+
<Dates>
204+
<Date>2027-03-02</Date>
205+
<Date>2028-03-02</Date>
206+
<Date>2029-03-02</Date>
207+
<Dates>
208+
<Dates>
209+
</ExerciseDates>
210+
...
211+
</OptionData>
212+
...
213+
\end{minted}
214+
\caption{Bermudan Swaption Dates based}
215+
\label{lst:bermudan_swaption_dates}
216+
\end{listing}
217+
146218

147219
\item \lstinline!Premiums! [Optional]: Option premium node with amounts paid by the option buyer to the option seller.
148220

Docs/UserGuide/userguide.tex

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5772,15 +5772,18 @@ \subsubsection{Market}\label{sec:sim_market}
57725772
It should be noted that equity volatilities are taken to be a curve by default. To simulate an equity volatility surface with smile the xml node {\tt <Surface> } must be supplied.
57735773
There are two methods in ORE for equity volatility simulation:
57745774
\begin{itemize}
5775-
\item Simulating ATM volatilities only (and shifting other strikes relative to this using the $T_{0}$ smile). In this case set {\tt <SimulateATMOnly>} to true.
5776-
\item Simulating the full volatility surface. The node {\tt <SimulateATMOnly>} should be omitted or set to false, and explicit moneyness levels for simulation should be provided.
5775+
\item Simulating ATM volatilities only (and shifting other strikes relative to this using the $T_{0}$ smile). In this
5776+
case set {\tt <SimulateATMOnly>} to true and no surface node is given.
5777+
\item Simulating the full volatility surface. The node {\tt <SimulateATMOnly>} should be omitted or set to false, and
5778+
explicit moneyness levels for simulation should be provided.
57775779
\end{itemize}
57785780

57795781
Swaption volatilities are taken to be a surface by default. To simulate a swaption volatility cube with smile the xml node {\tt <Cube> } must be supplied.
57805782
There are two methods in ORE for swaption volatility cube simulation:
57815783
\begin{itemize}
57825784
\item Simulating ATM volatilities only (and shifting other strikes relative to this using the $T_{0}$ smile). In this case set {\tt <SimulateATMOnly>} to true.
5783-
\item Simulating the full volatility cube. The node {\tt <SimulateATMOnly>} should be omitted or set to false, and explicit strike spreads for simulation should be provided.
5785+
\item Simulating the full volatility cube. The node {\tt <SimulateATMOnly>} should be omitted or set to false, and
5786+
explicit strike spreads for simulation should be provided.
57845787
\end{itemize}
57855788

57865789
FX volatilities are taken to be a curve by default. To simulate an FX volatility cube with smile the xml node {\tt <Surface> } must be supplied. The surface node contains the moneyness levels to be simulated.
@@ -5862,8 +5865,8 @@ \subsubsection{Market}\label{sec:sim_market}
58625865
</Currencies>
58635866
<Expiries>6M,1Y,2Y,3Y,5Y,10Y,12Y,15Y,20Y</Expiries>
58645867
<Terms>1Y,2Y,3Y,4Y,5Y,7Y,10Y,15Y,20Y,30Y</Terms>
5868+
<SimulateATMOnly>false</SimulateATMOnly>
58655869
<Cube>
5866-
<SimulateATMOnly>false</SimulateATMOnly>
58675870
<StrikeSpreads>-0.02,-0.01,0.0,0.01,0.02</StrikeSpreads>
58685871
</Cube>
58695872
<!-- Sets a new daycounter for just the EUR swaptionVolatility surface -->
@@ -5896,9 +5899,9 @@ \subsubsection{Market}\label{sec:sim_market}
58965899
<Name>Lufthansa</Name>
58975900
</Names>
58985901
<Expiries>6M,1Y,2Y,3Y,4Y,5Y,7Y,10Y</Expiries>
5902+
<SimulateATMOnly>false</SimulateATMOnly>
58995903
<Surface>
5900-
<SimulateATMOnly>false</SimulateATMOnly><!-- false -->
5901-
<Moneyness>0.1,0.5,1.0,1.5,2.0,3.0</Moneyness><!-- omitted if SimulateATMOnly true -->
5904+
<Moneyness>0.1,0.5,1.0,1.5,2.0,3.0</Moneyness>
59025905
</Surface>
59035906
<TimeExtrapolation>Flat</TimeExtrapolation>
59045907
<StrikeExtrapolation>Flat</StrikeExtrapolation>
@@ -6000,6 +6003,7 @@ \subsection{Sensitivity Analysis: {\tt sensitivity.xml}}\label{sec:sensitivity}
60006003
\item {\tt ShiftType:} Both absolute or relative shifts can be used to compute a sensitivity, specified by the key words
60016004
{\tt Absolute} resp. {\tt Relative}.
60026005
\item {\tt ShiftSize:} The size of the shift to apply.
6006+
\item {\tt ShiftScheme:} The finite difference scheme to use ({\tt Forward}, {\tt Backward}, {\tt Central}), if not given, this parameter defaults to {\tt Forward}
60036007
\item {\tt ShiftTenors:} For curves, the tenor buckets to apply shifts to, given as a comma separated list of periods.
60046008
\item {\tt ShiftExpiries:} For volatility surfaces, the option expiry buckets to apply shifts to, given as a comma
60056009
separated list of periods.
@@ -6012,6 +6016,53 @@ \subsection{Sensitivity Analysis: {\tt sensitivity.xml}}\label{sec:sensitivity}
60126016
\item {\tt CurveType:} In the context of Yield Curves used to identify an equity ``risk free'' rate forecasting curve; set to {\tt EquityForecast} in this case
60136017
\end{itemize}
60146018

6019+
The ShiftType, ShiftSize, ShiftScheme nodes take an optional attribute key that allows to configure different values for
6020+
different sensitivity templates. The sensitivity templates are defined in the pricing engine configuration. This is best
6021+
explained by an example: In Example 15 the product type BermudanSwaption has a sensitivity template \verb+IR_FD+
6022+
attached, see \ref{lst:sensi_template}. This can be used to specify different shifts for trades that were built against
6023+
this engine configuration, see \ref{lst:sensi_config_template}: For Bermudan swaptions a larger shift size of 10bp and a
6024+
central difference scheme is used to compute discount curve sensitivities in EUR. Since no separate shift type is
6025+
specified, the default shift type {\tt Absolute} is used. Note regarding the reports:
6026+
6027+
\begin{itemize}
6028+
\item the sensi scenario report contains scenario NPVs related to the possibly product specific configured shift sizes
6029+
\item the sensi report contains renormalized sensitivities, i.e. sensitivities are always expressed w.r.t. the default shift sizes
6030+
\item the sensi config report only contains the default configuration
6031+
\end{itemize}
6032+
6033+
\begin{longlisting}
6034+
\begin{minted}[fontsize=\scriptsize]{xml}
6035+
<Product type="BermudanSwaption">
6036+
<Model>LGM</Model>
6037+
<ModelParameters>
6038+
...
6039+
</ModelParameters>
6040+
<Engine>Grid</Engine>
6041+
<EngineParameters>
6042+
...
6043+
<Parameter name="SensitivityTemplate">IR_FD</Parameter>
6044+
</EngineParameters>
6045+
</Product>
6046+
\end{minted}
6047+
\caption{Sensitivity template definition}
6048+
\label{lst:sensi_template}
6049+
\end{longlisting}
6050+
6051+
\begin{longlisting}
6052+
\begin{minted}[fontsize=\scriptsize]{xml}
6053+
<DiscountCurve ccy="EUR">
6054+
<ShiftType>Absolute</ShiftType>
6055+
<ShiftSize>0.0001</ShiftSize>
6056+
<ShiftScheme>Forward</ShiftScheme>
6057+
<ShiftSize key="IR_FD">0.001</ShiftSize>
6058+
<ShiftScheme key="IR_FD">Central</ShiftScheme>
6059+
<ShiftTenors>6M,1Y,2Y,3Y,5Y,7Y,10Y,15Y,20Y</ShiftTenors>
6060+
</DiscountCurve>
6061+
\end{minted}
6062+
\caption{Sensitivity template definition}
6063+
\label{lst:lst:sensi_config_template}
6064+
\end{longlisting}
6065+
60156066
The cross gamma filter section contains a list of pairs of sensitivity keys. For each possible pair of sensitivity keys
60166067
matching the given strings, a cross gamma sensitivity is computed. The given pair of keys can be (and usually are)
60176068
shorter than the actual sensitivity keys. In this case only the prefix of the actual key is matched. For example, the

Examples/Example_15/ExpectedOutput/npv.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#TradeId,TradeType,Maturity,MaturityTime,NPV,NpvCurrency,NPV(Base),BaseCurrency,Notional,NotionalCurrency,Notional(Base),NettingSet,CounterParty
2-
BERMUDAN_SWAPTION,Swaption,2038-10-01,22.652317,-3115851.065563,EUR,-3115851.065563,EUR,10000000.00,EUR,10000000.00,CPTY_A,CPTY_A
2+
BERMUDAN_SWAPTION,Swaption,2038-10-01,22.652317,-3115844.394193,EUR,-3115844.394193,EUR,10000000.00,EUR,10000000.00,CPTY_A,CPTY_A
33
BOND,Bond,2021-02-03,4.994783,12902649.282760,EUR,12902649.282760,EUR,10000000.00,EUR,10000000.00,CPTY_A,CPTY_A
44
Bond_Floating,Bond,2021-02-03,4.994783,10765048.489931,EUR,10765048.489931,EUR,10000000.00,EUR,10000000.00,,CPTY_C
55
CAP_EUR,CapFloor,2026-02-09,10.011221,-6881.951398,EUR,-6881.951398,EUR,1000000.00,EUR,1000000.00,CPTY_A,CPTY_A

0 commit comments

Comments
 (0)