Skip to content

Commit 08bc5c0

Browse files
committed
Merge branch 'github-208' into 'master'
PR-208 See merge request qs/ore-github!38
2 parents 4f9754d + f997dec commit 08bc5c0

13 files changed

Lines changed: 323 additions & 46 deletions

File tree

Docs/UserGuide/curve_configurations/yieldcurves.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ \subsubsection*{Fitted Bond Segment}
457457
</Quotes>
458458
<!-- mapping of Ibor curves used in the bonds from which the curve is built -->
459459
<IborIndexCurves>
460-
<IborIndexCurve iborIndex="EUR-EURIBOR-6M">EUR-EURIBOR-6M</IborIndexCurve>
460+
<IborIndexCurve iborIndex="EUR-EURIBOR-6M">EUR6M</IborIndexCurve>
461461
</IborIndexCurves>
462462
<!-- flat extrapolation before first and after last bond maturity -->
463463
<ExtrapolateFlat>true</ExtrapolateFlat>

Docs/UserGuide/marketdata.tex

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,31 @@ \subsection{Bond Yield Spreads}
14431443
\item BOND/YIELD\_SPREAD/SECURITY\_1
14441444
\end{itemize}
14451445

1446+
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1447+
\subsection{Bond Prices}
1448+
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1449+
1450+
\begin{table}[H]
1451+
\centering
1452+
\begin{tabular}{|p{3cm}|p{3.5cm}|p{7cm}|}
1453+
\hline
1454+
{\bf Property} & {\bf Allowable values} & {\bf Description} \\ \hline
1455+
Instrument Type & \emph{BOND} & \\ \hline
1456+
Quote Type & \emph{PRICE} & \\ \hline
1457+
Name & String & Identifying name of the bond \\ \hline
1458+
\end{tabular}
1459+
\caption{Bond Prices}
1460+
\label{tab:bondprice_quote}
1461+
\end{table}
1462+
1463+
This quote provides the clean price for a specified bond in units.
1464+
1465+
\medskip
1466+
Examples:
1467+
\begin{itemize}
1468+
\item BOND/PRICE/SECURITY\_1
1469+
\end{itemize}
1470+
14461471
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
14471472
\subsection{Base Correlations}
14481473
%- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Docs/UserGuide/tradedata/bond.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ \subsubsection{Bond}
6060
An alphanumeric string of the form [CCY]-[INDEX]-[TERM]. CCY, INDEX and TERM must be separated by dashes (-). CCY and INDEX must be among the supported currency and index combinations. TERM must be an integer followed by D, W, M or Y. See Table \ref{tab:indices}.
6161

6262
For currencies without available ibor indices: \\
63-
An alphanumeric string of the form [CCY]BENCHMARK-[CCY]-TERM, matching a benchmark curve set up in the market data configuration.
63+
An alphanumeric string, matching a benchmark curve set up in the market data configuration in {\tt todaysmarket.xml} Yield curves section.
6464

6565
Examples: IDRBENCHMARK-IDR-3M, EGPBENCHMARK-EGP-3M, UAHBENCHMARK-UAH-3M, NGNBENCHMARK-NGN-3M
6666

Docs/UserGuide/userguide.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2132,7 +2132,7 @@ \subsection{Bonds and Amortisation Structures}% Example 18
21322132
%--------------------------------------------------------
21332133

21342134
The example in folder {\tt Examples/Example\_18} computes NPVs and cash flow projections for a vanilla bond portfolio
2135-
consisting of a range of bond products, in particular demonstrating amortisation features:
2135+
consisting of a range of bond products, in particular demonstrating amortisation features. Also, pricing using a benchmark bond price curve (bond definitions in referencedata.xml) is demonstrated:
21362136
\begin{itemize}
21372137
\item fixed rate bond
21382138
\item floating rate bond linked to Euribor 6M
@@ -2143,6 +2143,7 @@ \subsection{Bonds and Amortisation Structures}% Example 18
21432143
\item bond with fixed annuity amortisation
21442144
\item bond with floating annuity amortisation (this example needs QuantLib 1.10 or higher to work, in particular the amount() method in the Coupon class needs to be virtual)
21452145
\item bond with fixed amount amortisation followed by percentage amortisation relative to previous notional
2146+
\item fixed rate bond using a benchmark bond price curve instead of the benchmark yield curve
21462147
\end{itemize}
21472148

21482149
After running the example, the results of the computation can be found in the output files {\tt npv.csv} and {\tt

Examples/Example_18/ExpectedOutput/flows.csv

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ Bond_Fixed_Then_Floating,Bond,13,0,2025-02-03,InterestProjected,147307.5573,EUR,
100100
Bond_Fixed_Then_Floating,Bond,14,0,2025-08-04,InterestProjected,147637.7985,EUR,0.0296086794,0.4986301370,2025-02-03,2025-08-04,0.0000,2025-01-30,0.0196086794,10000000.0000,0.8286266420,122336.6132292770,1.0000000000,122336.6132292770,EUR,#N/A,#N/A,#N/A,#N/A
101101
Bond_Fixed_Then_Floating,Bond,15,0,2026-02-03,InterestProjected,148451.6639,EUR,0.0296092117,0.5013698630,2025-08-04,2026-02-03,0.0000,2025-07-31,0.0196097440,10000000.0000,0.8204483993,121796.9300410371,1.0000000000,121796.9300410371,EUR,#N/A,#N/A,#N/A,#N/A
102102
Bond_Fixed_Then_Floating,Bond,16,0,2026-02-03,Notional,10000000.0000,EUR,#N/A,#N/A,#N/A,#N/A,#N/A,#N/A,#N/A,#N/A,0.8204483993,8204483.9926123777,1.0000000000,8204483.9926123777,EUR,#N/A,#N/A,#N/A,#N/A
103+
Bond_Fixed_using_BMBond_curve_Pricing,Bond,1,0,2017-02-03,Interest,500123.5122,EUR,0.0500000000,1.0002470245,2016-02-03,2017-02-03,2732.2404,#N/A,#N/A,10000000.0000,1.0036811234,501964.5286144280,1.0000000000,501964.5286144280,EUR,#N/A,#N/A,#N/A,#N/A
104+
Bond_Fixed_using_BMBond_curve_Pricing,Bond,2,0,2018-02-05,Interest,502739.7260,EUR,0.0500000000,1.0054794521,2017-02-03,2018-02-05,0.0000,#N/A,#N/A,10000000.0000,1.0074063046,506463.1695560819,1.0000000000,506463.1695560819,EUR,#N/A,#N/A,#N/A,#N/A
105+
Bond_Fixed_using_BMBond_curve_Pricing,Bond,3,0,2019-02-04,Interest,498630.1370,EUR,0.0500000000,0.9972602740,2018-02-05,2019-02-04,0.0000,#N/A,#N/A,10000000.0000,1.0111146915,504172.2571370929,1.0000000000,504172.2571370929,EUR,#N/A,#N/A,#N/A,#N/A
106+
Bond_Fixed_using_BMBond_curve_Pricing,Bond,4,0,2020-02-03,Interest,498506.6247,EUR,0.0500000000,0.9970132495,2019-02-04,2020-02-03,0.0000,#N/A,#N/A,10000000.0000,1.0388538629,517875.5327880877,1.0000000000,517875.5327880877,EUR,#N/A,#N/A,#N/A,#N/A
107+
Bond_Fixed_using_BMBond_curve_Pricing,Bond,5,0,2021-02-03,Interest,500123.5122,EUR,0.0500000000,1.0002470245,2020-02-03,2021-02-03,0.0000,#N/A,#N/A,10000000.0000,1.0482657535,524262.3503842037,1.0000000000,524262.3503842037,EUR,#N/A,#N/A,#N/A,#N/A
108+
Bond_Fixed_using_BMBond_curve_Pricing,Bond,6,0,2021-02-03,Notional,10000000.0000,EUR,#N/A,#N/A,#N/A,#N/A,#N/A,#N/A,#N/A,#N/A,1.0482657535,10482657.5346797928,1.0000000000,10482657.5346797928,EUR,#N/A,#N/A,#N/A,#N/A
103109
Bond_Floating,Bond,1,0,2016-08-03,Interest,50224.0437,EUR,0.0101000000,0.4972677596,2016-02-03,2016-08-03,551.9126,2016-02-01,0.0001000000,10000000.0000,0.9900995527,49726.8032160310,1.0000000000,49726.8032160310,EUR,#N/A,#N/A,#N/A,#N/A
104110
Bond_Floating,Bond,2,0,2017-02-03,InterestProjected,148293.6367,EUR,0.0294830517,0.5029792649,2016-08-03,2017-02-03,0.0000,2016-08-01,0.0194830517,10000000.0000,0.9803373492,145377.7907112182,1.0000000000,145377.7907112182,EUR,#N/A,#N/A,#N/A,#N/A
105111
Bond_Floating,Bond,3,0,2017-08-03,InterestProjected,146109.2400,EUR,0.0294640180,0.4958904110,2017-02-03,2017-08-03,0.0000,2017-02-01,0.0194640180,10000000.0000,0.9708366681,141848.2077635486,1.0000000000,141848.2077635486,EUR,#N/A,#N/A,#N/A,#N/A

Examples/Example_18/ExpectedOutput/npv.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ Bond_Amortizing_Floating_Annuity,Bond,2021-02-03,4.994783,10233214.908861,EUR,10
1717
FwdBond_Amortizing_Floating_Annuity,ForwardBond,2021-02-03,4.994783,21532.889785,EUR,21532.889785,EUR,10000000.00,EUR,10000000.00,,CPTY_C
1818
Bond_Amortizing_FixedAmount_PercentagePrevious,Bond,2026-02-03,9.994783,11884303.320039,EUR,11884303.320039,EUR,10000000.00,EUR,10000000.00,,CPTY_C
1919
FwdBond_Amortizing_FixedAmount_PercentagePrevious,ForwardBond,2026-02-03,9.994783,1986043.880658,EUR,1986043.880658,EUR,10000000.00,EUR,10000000.00,,CPTY_C
20+
Bond_Fixed_using_BMBond_curve_Pricing,Bond,2021-02-03,4.994783,13037395.373160,EUR,13037395.373160,EUR,10000000.00,EUR,10000000.00,,CPTY_C

Examples/Example_18/Input/ore.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<Parameter name="pricingEnginesFile">../../Input/pricingengine.xml</Parameter>
1616
<Parameter name="portfolioFile">portfolio.xml</Parameter>
1717
<Parameter name="observationModel">Disable</Parameter>
18+
<Parameter name="referenceDataFile">referencedata.xml</Parameter>
1819
</Setup>
1920
<Markets>
2021
<Parameter name="lgmcalibration">libor</Parameter>

Examples/Example_18/Input/portfolio.xml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,4 +1125,49 @@
11251125
<LongInForward>true</LongInForward>
11261126
</ForwardBondData>
11271127
</Trade>
1128+
<Trade id="Bond_Fixed_using_BMBond_curve_Pricing">
1129+
<TradeType>Bond</TradeType>
1130+
<Envelope>
1131+
<CounterParty>CPTY_C</CounterParty>
1132+
<NettingSetId/>
1133+
<AdditionalFields/>
1134+
</Envelope>
1135+
<BondData>
1136+
<IssuerId>CPTY_C</IssuerId>
1137+
<SecurityId>SECURITY_1</SecurityId>
1138+
<ReferenceCurveId>BENCHMARK-EUR-6M</ReferenceCurveId>
1139+
<SettlementDays>2</SettlementDays>
1140+
<Calendar>TARGET</Calendar>
1141+
<IssueDate>20160203</IssueDate>
1142+
<LegData>
1143+
<LegType>Fixed</LegType>
1144+
<Payer>false</Payer>
1145+
<Currency>EUR</Currency>
1146+
<Notionals>
1147+
<Notional>10000000.000000</Notional>
1148+
</Notionals>
1149+
<DayCounter>ACT/ACT</DayCounter>
1150+
<PaymentConvention>F</PaymentConvention>
1151+
<FixedLegData>
1152+
<Rates>
1153+
<Rate>0.05</Rate>
1154+
</Rates>
1155+
</FixedLegData>
1156+
<ScheduleData>
1157+
<Rules>
1158+
<StartDate>20160203</StartDate>
1159+
<EndDate>20210203</EndDate>
1160+
<Tenor>1Y</Tenor>
1161+
<Calendar>TARGET</Calendar>
1162+
<Convention>F</Convention>
1163+
<TermConvention>F</TermConvention>
1164+
<Rule>Forward</Rule>
1165+
<EndOfMonth/>
1166+
<FirstDate/>
1167+
<LastDate/>
1168+
</Rules>
1169+
</ScheduleData>
1170+
</LegData>
1171+
</BondData>
1172+
</Trade>
11281173
</Portfolio>
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<ReferenceData>
3+
<ReferenceDatum id="SECURITY_2">
4+
<Type>Bond</Type>
5+
<BondReferenceData>
6+
<IssuerId></IssuerId>
7+
<CreditCurveId></CreditCurveId>
8+
<ReferenceCurveId>EUR-EURIBOR-6M</ReferenceCurveId>
9+
<SettlementDays>2</SettlementDays>
10+
<Calendar>TARGET</Calendar>
11+
<IssueDate>07.10.2014</IssueDate>
12+
<LegData>
13+
<LegType>Fixed</LegType>
14+
<Payer>false</Payer>
15+
<Currency>EUR</Currency>
16+
<Notionals>
17+
<Notional>1.0</Notional>
18+
</Notionals>
19+
<DayCounter>30/360</DayCounter>
20+
<PaymentConvention>F</PaymentConvention>
21+
<FixedLegData>
22+
<Rates>
23+
<Rate>0.0025</Rate>
24+
</Rates>
25+
</FixedLegData>
26+
<ScheduleData>
27+
<Rules>
28+
<StartDate>07.10.2014</StartDate>
29+
<EndDate>18.10.2019</EndDate>
30+
<Rule>Backward</Rule>
31+
<Tenor>1Y</Tenor>
32+
<Calendar>TARGET</Calendar>
33+
<Convention>F</Convention>
34+
<TermConvention>F</TermConvention>
35+
</Rules>
36+
</ScheduleData>
37+
</LegData>
38+
</BondReferenceData>
39+
</ReferenceDatum>
40+
<ReferenceDatum id="SECURITY_3">
41+
<Type>Bond</Type>
42+
<BondReferenceData>
43+
<IssuerId></IssuerId>
44+
<CreditCurveId></CreditCurveId>
45+
<ReferenceCurveId>EUR-EURIBOR-6M</ReferenceCurveId>
46+
<IncomeCurveId/>
47+
<SettlementDays>2</SettlementDays>
48+
<Calendar>TARGET</Calendar>
49+
<IssueDate>23.06.2015</IssueDate>
50+
<LegData>
51+
<LegType>Fixed</LegType>
52+
<Payer>false</Payer>
53+
<Currency>EUR</Currency>
54+
<Notionals>
55+
<Notional>1.0</Notional>
56+
</Notionals>
57+
<DayCounter>30/360</DayCounter>
58+
<PaymentConvention>F</PaymentConvention>
59+
<FixedLegData>
60+
<Rates>
61+
<Rate>0.012</Rate>
62+
</Rates>
63+
</FixedLegData>
64+
<ScheduleData>
65+
<Rules>
66+
<StartDate>23.06.2015</StartDate>
67+
<EndDate>20.10.2025</EndDate>
68+
<Rule>Backward</Rule>
69+
<Tenor>1Y</Tenor>
70+
<Calendar>TARGET</Calendar>
71+
<Convention>F</Convention>
72+
<TermConvention>F</TermConvention>
73+
</Rules>
74+
</ScheduleData>
75+
</LegData>
76+
</BondReferenceData>
77+
</ReferenceDatum>
78+
<ReferenceDatum id="SECURITY_4">
79+
<Type>Bond</Type>
80+
<BondReferenceData>
81+
<IssuerId></IssuerId>
82+
<CreditCurveId></CreditCurveId>
83+
<ReferenceCurveId>EUR-EURIBOR-6M</ReferenceCurveId>
84+
<SettlementDays>2</SettlementDays>
85+
<Calendar>TARGET</Calendar>
86+
<IssueDate>23.02.2016</IssueDate>
87+
<LegData>
88+
<LegType>Fixed</LegType>
89+
<Payer>false</Payer>
90+
<Currency>EUR</Currency>
91+
<Notionals>
92+
<Notional>1.0</Notional>
93+
</Notionals>
94+
<DayCounter>30/360</DayCounter>
95+
<PaymentConvention>F</PaymentConvention>
96+
<FixedLegData>
97+
<Rates>
98+
<Rate>0.0075</Rate>
99+
</Rates>
100+
</FixedLegData>
101+
<ScheduleData>
102+
<Rules>
103+
<StartDate>23.02.2016</StartDate>
104+
<EndDate>20.10.2026</EndDate>
105+
<Rule>Backward</Rule>
106+
<Tenor>1Y</Tenor>
107+
<Calendar>TARGET</Calendar>
108+
<Convention>F</Convention>
109+
<TermConvention>F</TermConvention>
110+
</Rules>
111+
</ScheduleData>
112+
</LegData>
113+
</BondReferenceData>
114+
</ReferenceDatum>
115+
<ReferenceDatum id="SECURITY_5">
116+
<Type>Bond</Type>
117+
<BondReferenceData>
118+
<IssuerId></IssuerId>
119+
<CreditCurveId></CreditCurveId>
120+
<ReferenceCurveId>EUR-EURIBOR-6M</ReferenceCurveId>
121+
<IncomeCurveId/>
122+
<SettlementDays>2</SettlementDays>
123+
<Calendar>TARGET</Calendar>
124+
<IssueDate>23.02.2016</IssueDate>
125+
<LegData>
126+
<LegType>Fixed</LegType>
127+
<Payer>false</Payer>
128+
<Currency>EUR</Currency>
129+
<Notionals>
130+
<Notional>1.0</Notional>
131+
</Notionals>
132+
<DayCounter>30/360</DayCounter>
133+
<PaymentConvention>F</PaymentConvention>
134+
<FixedLegData>
135+
<Rates>
136+
<Rate>0.015</Rate>
137+
</Rates>
138+
</FixedLegData>
139+
<ScheduleData>
140+
<Rules>
141+
<StartDate>23.02.2016</StartDate>
142+
<EndDate>20.02.2047</EndDate>
143+
<Rule>Backward</Rule>
144+
<Tenor>1Y</Tenor>
145+
<Calendar>TARGET</Calendar>
146+
<Convention>F</Convention>
147+
<TermConvention>F</TermConvention>
148+
</Rules>
149+
</ScheduleData>
150+
</LegData>
151+
</BondReferenceData>
152+
</ReferenceDatum>
153+
</ReferenceData>

Examples/Example_18/Readme.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@
1111
(needs QuantLib 1.10, virtual amount() method the Coupon class)
1212
- bond with fixed amount amortisation followed by percentage
1313
amortisation relative to previous notional
14+
- fixed rate bond using a benchmark bond curve (consisting of 4 bonds) for pricing
1415

1516
2) Market
1617

1718
Flat 6m Euribor Swap curve at 2%
19+
Fake Benchmark Bond Prices as of analysis date
1820

1921
3) Pricing
2022

2123
Discounted cash flows with discounting risky bond engine taking
2224
a benchmark yield curve, a default term structure and an individual
23-
security spread into account
25+
security spread into account. Alternatively a benchmark bond curve containing 4 bonds is used
2426

2527
4) Analytics
2628

0 commit comments

Comments
 (0)