Skip to content

Commit 338a902

Browse files
pcaspersjenkins
authored andcommitted
Merge remote-tracking branch 'origin/QPR-11667'
1 parent d957359 commit 338a902

45 files changed

Lines changed: 3249 additions & 341 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Docs/UserGuide/tradedata/totalReturnSwap.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ \subsubsection{Generic Total Return Swap / Contract for Difference (CFD)}
6262
\item EquityOptionPosition: See \ref{ss:equity_option_position}, the trade data is given in a EquityOptionPositionData
6363
sub node.
6464
\item BondPosition: See \ref{ss:bond_position}, the trade data is given in a BondBasketData sub node.
65-
\item Derivative: An arbitrary underlying derivative trade (swaption, variance swap). The derivative subnode has
65+
\item Derivative: An arbitrary underlying derivative trade (of any type covered by ORE). The derivative subnode has
6666
exactly two subnodes
6767
\begin{itemize}
6868
\item Id: A unqiue identifier for the derivative position. Historical prices must be given under the fixing name

Docs/UserGuide/userguide.tex

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
%\title{Open Source Risk Engine \\ User Guide }
132132
\title{ORE User Guide}
133133
\author{Acadia Inc.}
134-
\date{31 March 2023}
134+
\date{16 June 2023}
135135
\maketitle
136136

137137
\newpage
@@ -153,6 +153,7 @@ \section*{Document History}
153153
16 September 2022 & Acadia & updates for release 7\\
154154
6 December 2022 & Acadia & updates for release 8\\
155155
31 March 2023 & Acadia & updates for release 9\\
156+
16 June 2023 & Acadia & updates for release 10\\
156157
\hline
157158
\end{supertabular}
158159
\end{center}
@@ -818,7 +819,7 @@ \subsubsection*{Building on Windows with CMake}
818819
\medskip {\tt ctest -j4}
819820
\end{enumerate}
820821

821-
For the best results, it is recommended, to compile ORE without the compiler flag \emph{QL_USE_INDEXED_COUPON}. Not all ORE classes (in particular coupons and rate helpers) support this functionality yet and the results might not always be what is expected.
822+
For the best results, it is recommended, to compile ORE without the compiler flag \emph{QL\_USE\_INDEXED\_COUPON}. Not all ORE classes (in particular coupons and rate helpers) support this functionality yet and the results might not always be what is expected.
822823

823824
\subsubsection*{ZLIB support}
824825

@@ -3259,11 +3260,17 @@ \subsection{ISDA SIMM Model}% Example 44
32593260

32603261
The market data input and todays's market configuration required here is minimal - limited to FX rates for conversions from base/calculation currency into USD and into the result currency.
32613262

3263+
\bigskip
3264+
If the ORE Python module is installed, as shown in Example 42, then you can also run the SIMM example using
3265+
3266+
\medskip
3267+
\centerline{\tt python ore.py}
3268+
32623269
%--------------------------------------------------------
3263-
\subsection{Collateral Bond Obligation}% Example 45
3270+
\subsection{Collateralized Bond Obligation}% Example 45
32643271
%--------------------------------------------------------
32653272

3266-
This example in folder {\tt Examples/Example\_45} demonstrates a Cashflow CDO or Collateral Bond Obligation (CBO) via ORE. Calling
3273+
This example in folder {\tt Examples/Example\_45} demonstrates a Cashflow CDO or Collateralized Bond Obligation (CBO) via ORE. Calling
32673274

32683275
\medskip
32693276
\centerline{\tt python run.py}
@@ -3274,10 +3281,11 @@ \subsection{Collateral Bond Obligation}% Example 45
32743281
NPV results are calculated for the investment in the junior tranche.
32753282

32763283
%--------------------------------------------------------
3277-
\subsection{TRS on CBO}% Example 46
3284+
\subsection{Generic Total Return Swap}% Example 46
32783285
%--------------------------------------------------------
32793286

3280-
This example in folder {\tt Examples/Example\_46} demonstrates a Total Return Swap (TRS) referencing a CBO pricing via ORE. Calling
3287+
This example in folder {\tt Examples/Example\_46} demonstrates ORE's generic Total Return Swap referencing a CBO.
3288+
Calling
32813289

32823290
\medskip
32833291
\centerline{\tt python run.py}
@@ -3287,11 +3295,43 @@ \subsection{TRS on CBO}% Example 46
32873295
As opposed to example 45, the CBO and its bondbasket are represented explicitly in the CBO node.
32883296

32893297
%--------------------------------------------------------
3290-
\subsection{Bond Yield Shifted}% Example 47
3291-
\label{example:47}
3298+
\subsection{Composite Trade}% Example 47
3299+
%--------------------------------------------------------
3300+
3301+
This example in folder {\tt Examples/Example\_47} demonstrates the input of ORE's Composite Trade that can consist on any number
3302+
and type of products covered by ORE. In this case the composite consists of two Equity Swaps.
3303+
Calling
3304+
3305+
\medskip
3306+
\centerline{\tt python run.py}
3307+
3308+
\medskip
3309+
runs ORE and generates an NPV report.
3310+
3311+
%--------------------------------------------------------
3312+
\subsection{Convertible Bond and ASCOT}% Example 48
3313+
%--------------------------------------------------------
3314+
3315+
This example in folder {\tt Examples/Example\_48} demonstrates the input of
3316+
\begin{itemize}
3317+
\item a ConvertibleBond trade
3318+
\item a related Asset Swapped Convertible Option Transaction (ASCOT)
3319+
\item a vanilla Swap that represents the package of Convertible Bond position and ASCOT
3320+
\end{itemize}
3321+
3322+
Calling
3323+
\medskip
3324+
\centerline{\tt python run.py}
3325+
3326+
\medskip
3327+
runs ORE and generates an NPV report.
3328+
3329+
%--------------------------------------------------------
3330+
\subsection{Bond Yield Shifted}% Example 49
3331+
\label{example:49}
32923332
%--------------------------------------------------------
32933333

3294-
The example in folder {\tt Examples/Example\_47} shows how to use a yield curve
3334+
The example in folder {\tt Examples/Example\_49} shows how to use a yield curve
32953335
built from a BondYieldShifted segment, as described in section \ref{sec:bond_yield_shifted}.
32963336

32973337
In particular, it builds the curve {\tt USD.BMK.GVN.CURVE\_SHIFTED} shifted by three liquid Bonds:

Examples/Example_44/ore.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
'''
2+
Copyright (C) 2018-2023 Quaternion Risk Management Ltd
3+
4+
This file is part of ORE, a free-software/open-source library
5+
for transparent pricing and risk analysis - http://opensourcerisk.org
6+
ORE is free software: you can redistribute it and/or modify it
7+
under the terms of the Modified BSD License. You should have received a
8+
copy of the license along with this program.
9+
The license is also available online at <http://opensourcerisk.org>
10+
This program is distributed on the basis that it will form a useful
11+
contribution to risk analytics and model standardisation, but WITHOUT
12+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
14+
'''
15+
16+
#import sys, time
17+
from ORE import *
18+
19+
print ("Loading parameters...")
20+
params = Parameters()
21+
params.fromFile("Input/ore.xml")
22+
23+
print ("Creating OREApp...")
24+
ore = OREApp(params, True)
25+
26+
print ("Running ORE process...");
27+
ore.run()
28+
29+
print ("Running ORE process done");
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#TradeId,TradeType,Maturity,MaturityTime,NPV,NpvCurrency,NPV(Base),BaseCurrency,Notional,NotionalCurrency,Notional(Base),NettingSet,CounterParty
2-
ZeroBond_long,Bond,2052-06-03,30.007066,2022230.174819,USD,2022230.174819,USD,10000000.00,USD,10000000.00,,CPTY
3-
ZeroBond_short,Bond,2032-06-01,10.001602,5754510.641522,USD,5754510.641522,USD,10000000.00,USD,10000000.00,,CPTY
2+
Composite_Equity_Swap,CompositeTrade,2021-04-20,0.147945,4093277.401115,USD,4093277.401115,USD,538080000.00,USD,538080000.00,CPTY,CPTY
Lines changed: 138 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,142 @@
1-
<?xml version="1.0" encoding="utf-8"?>
21
<Conventions>
3-
<Zero>
4-
<Id>CCY-ZERO-CONVENTIONS-TENOR-BASED</Id>
5-
<TenorBased>true</TenorBased>
6-
<DayCounter>A365</DayCounter>
7-
<Compounding>Continuous</Compounding>
8-
<CompoundingFrequency>Daily</CompoundingFrequency>
9-
<TenorCalendar>TARGET</TenorCalendar>
2+
<FRA>
3+
<Id>JPY-3M-FRA</Id>
4+
<Index>JPY-LIBOR-3M</Index>
5+
</FRA>
6+
<FRA>
7+
<Id>JPY-6M-FRA</Id>
8+
<Index>JPY-LIBOR-6M</Index>
9+
</FRA>
10+
<Deposit>
11+
<Id>JPY-DEPOSIT</Id>
12+
<IndexBased>true</IndexBased>
13+
<Index>JPY-LIBOR</Index>
14+
</Deposit>
15+
<TenorBasisSwap>
16+
<Id>JPY-LIBOR-3M-6M-BASIS</Id>
17+
<LongIndex>JPY-LIBOR-6M</LongIndex>
18+
<ShortIndex>JPY-LIBOR-3M</ShortIndex>
19+
<ShortPayTenor/>
20+
<SpreadOnShort/>
21+
<IncludeSpread/>
22+
</TenorBasisSwap>
23+
<Swap>
24+
<Id>JPY-LIBOR-3M-SWAP</Id>
25+
<FixedCalendar>JP,UK</FixedCalendar>
26+
<FixedFrequency>Semiannual</FixedFrequency>
27+
<FixedConvention>MF</FixedConvention>
28+
<FixedDayCounter>A365</FixedDayCounter>
29+
<Index>JPY-LIBOR-3M</Index>
30+
</Swap>
31+
<Swap>
32+
<Id>JPY-LIBOR-6M-SWAP</Id>
33+
<FixedCalendar>JP,UK</FixedCalendar>
34+
<FixedFrequency>Semiannual</FixedFrequency>
35+
<FixedConvention>MF</FixedConvention>
36+
<FixedDayCounter>A365</FixedDayCounter>
37+
<Index>JPY-LIBOR-6M</Index>
38+
</Swap>
39+
<OIS>
40+
<Id>JPY-OIS</Id>
1041
<SpotLag>2</SpotLag>
11-
<SpotCalendar>TARGET</SpotCalendar>
12-
<RollConvention>Following</RollConvention>
42+
<Index>JPY-TONAR</Index>
43+
<FixedDayCounter>A360</FixedDayCounter>
44+
<PaymentLag>1</PaymentLag>
1345
<EOM>false</EOM>
14-
</Zero>
46+
<FixedFrequency>Annual</FixedFrequency>
47+
<FixedConvention>Following</FixedConvention>
48+
<FixedPaymentConvention>Following</FixedPaymentConvention>
49+
<Rule>Backward</Rule>
50+
<PaymentCalendar/>
51+
</OIS>
52+
<Deposit>
53+
<Id>JPY-ON-DEPOSIT</Id>
54+
<IndexBased>true</IndexBased>
55+
<Index>JPY-TONAR</Index>
56+
</Deposit>
57+
<Swap>
58+
<Id>JPY-SWAP</Id>
59+
<FixedCalendar>JP,UK</FixedCalendar>
60+
<FixedFrequency>Semiannual</FixedFrequency>
61+
<FixedConvention>MF</FixedConvention>
62+
<FixedDayCounter>A365</FixedDayCounter>
63+
<Index>JPY-LIBOR-6M</Index>
64+
</Swap>
65+
<FRA>
66+
<Id>USD-3M-FRA</Id>
67+
<Index>USD-LIBOR-3M</Index>
68+
</FRA>
69+
<AverageOIS>
70+
<Id>USD-AVERAGE-OIS</Id>
71+
<SpotLag>2</SpotLag>
72+
<FixedTenor>6M</FixedTenor>
73+
<FixedDayCounter>30/360</FixedDayCounter>
74+
<FixedCalendar>US</FixedCalendar>
75+
<FixedConvention>MF</FixedConvention>
76+
<FixedPaymentConvention>MF</FixedPaymentConvention>
77+
<Index>USD-FedFunds</Index>
78+
<OnTenor>3M</OnTenor>
79+
<RateCutoff>2</RateCutoff>
80+
</AverageOIS>
81+
<Deposit>
82+
<Id>USD-DEPOSIT</Id>
83+
<IndexBased>true</IndexBased>
84+
<Index>USD-LIBOR</Index>
85+
</Deposit>
86+
<FX>
87+
<Id>USD-JPY-FX</Id>
88+
<SpotDays>2</SpotDays>
89+
<SourceCurrency>USD</SourceCurrency>
90+
<TargetCurrency>JPY</TargetCurrency>
91+
<PointsFactor>100</PointsFactor>
92+
<AdvanceCalendar>US,JP</AdvanceCalendar>
93+
<SpotRelative>true</SpotRelative>
94+
</FX>
95+
<CrossCurrencyBasis>
96+
<Id>USD-JPY-XCCY-BASIS</Id>
97+
<SettlementDays>2</SettlementDays>
98+
<SettlementCalendar>JP,US,UK</SettlementCalendar>
99+
<RollConvention>MF</RollConvention>
100+
<FlatIndex>USD-LIBOR-3M</FlatIndex>
101+
<SpreadIndex>JPY-LIBOR-3M</SpreadIndex>
102+
<EOM/>
103+
<IsResettable/>
104+
<FlatIndexIsResettable/>
105+
<FlatTenor/>
106+
<SpreadTenor/>
107+
</CrossCurrencyBasis>
108+
<Swap>
109+
<Id>USD-LIBOR-3M-SWAP</Id>
110+
<FixedCalendar>US,UK</FixedCalendar>
111+
<FixedFrequency>Semiannual</FixedFrequency>
112+
<FixedConvention>MF</FixedConvention>
113+
<FixedDayCounter>30/360</FixedDayCounter>
114+
<Index>USD-LIBOR-3M</Index>
115+
</Swap>
116+
<OIS>
117+
<Id>USD-OIS</Id>
118+
<SpotLag>2</SpotLag>
119+
<Index>USD-FedFunds</Index>
120+
<FixedDayCounter>A360</FixedDayCounter>
121+
<PaymentLag>2</PaymentLag>
122+
<EOM>false</EOM>
123+
<FixedFrequency>Annual</FixedFrequency>
124+
<FixedConvention>Following</FixedConvention>
125+
<FixedPaymentConvention>Following</FixedPaymentConvention>
126+
<Rule>Backward</Rule>
127+
<PaymentCalendar/>
128+
</OIS>
129+
<Deposit>
130+
<Id>USD-ON-DEPOSIT</Id>
131+
<IndexBased>true</IndexBased>
132+
<Index>USD-FedFunds</Index>
133+
</Deposit>
134+
<Swap>
135+
<Id>USD-SWAP</Id>
136+
<FixedCalendar>US,UK</FixedCalendar>
137+
<FixedFrequency>Semiannual</FixedFrequency>
138+
<FixedConvention>MF</FixedConvention>
139+
<FixedDayCounter>30/360</FixedDayCounter>
140+
<Index>USD-LIBOR-3M</Index>
141+
</Swap>
15142
</Conventions>

0 commit comments

Comments
 (0)