Skip to content

Commit 0db03eb

Browse files
rolandlichtersjenkins
authored andcommitted
Merge remote-tracking branch 'origin/master' into QPR-11765
1 parent 70d9b70 commit 0db03eb

17 files changed

Lines changed: 786 additions & 189 deletions

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=12.0
3-
QL_TAG=1.29_e57914e13
3+
QL_TAG=1.30_9921a4d7
44
BOOST_TAG=1.78.0
55
BOOST_DIR=1_78_0
66
NUM_CORES=16

Docs/UserGuide/allowablevalues.tex

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,11 @@ \subsection{Allowable Values}
123123
\emph{OldCDS} & Same as TwentiethIMM with unrestricted date ends and long/short stub coupon period (old CDS convention).\\ \hline
124124
\emph{CDS} & \makecell[tl]{Credit derivatives standard rule defined in 'Big Bang' changes in 2009. \\ \\ For quarterly periods (\lstinline!Tenor! set to \emph{3M}): \\ (Assuming no \lstinline!FirstDate!/\lstinline!LastDate!) \\ Dates fall on 20th of March, June, September, December. A \emph{Following} \\ roll convention will be applied if the 20th falls on a non-business day. \\ If the \lstinline!EndDate! in the schedule is set to a date beyond the rolled \\ quarterly CDS date, the actual trade termination date will be on the \\ following quarterly CDS date. \\ The first coupon will be paid on the quarterly CDS date following the \\ \lstinline!StartDate!, and be for the period since the previous quarterly CDS \\ date. \\ \\ For monthly periods (\lstinline!Tenor! set to \emph{1M}): \\ (Assuming no \lstinline!FirstDate!/\lstinline!LastDate!)\\ Dates fall on 20th of each month, but the termination is still adjusted \\ to be in line with quarterly periods. \\ If the \lstinline!EndDate! in the schedule is set to a date beyond the rolled \\ quarterly CDS date (i.e. the 20th+roll Mar, Jun, Sep, Dec), \\ the actual termination date will be on the following quarterly CDS \\ date, causing a long final stub. \\ The first coupon will be paid on the next 20th monthly following the \\ \lstinline!StartDate!, and be for the period since the previous month's 20th.}\\ \hline
125125
\emph{CDS2015} & \makecell[tl]{Credit derivatives standard rule updated in 2015. \\ Same as \emph{CDS} but with termination dates adjusted to \\ 20th June and 20th December. \\ For schedule \lstinline!EndDates! from the 20th of March to the 19th September, \\ both included, the termination date will fall on the 20th June (with \\ \emph{Following} roll). \\ For schedule \lstinline!EndDates! from the 20th September to the 19th March, \\ both included, the termination date will fall on the 20th December \\ (with \emph{Following} roll).} \\ \hline
126-
\caption{Allowable Values for Rule}
127-
\label{tab:rule}
128-
\end{longtable}
126+
\emph{EveryThursday} & If FirstDate is not given, all thursdays between start and end date.
127+
If FirstDate is given, FirstDate plus all thursdays between FirstDate and end date. \\ \hline
128+
\caption{Allowable Values for Rule}
129+
\label{tab:rule}
130+
\end{longtable}
129131

130132
\begin{longtable}{| p{.30\textwidth} | p{.70\textwidth} |}
131133
\hline

Docs/UserGuide/tradecomponents/floatinglegdata.tex

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,4 +293,13 @@ \subsubsection{Floating Leg Data, Spreads, Gearings, Caps and Floors}
293293

294294
Allowable values: \emph{true}, \emph{false} . Defaults to \emph{false} if left blank or omitted.
295295

296+
\item \lstinline!FixingSchedule! [Optional]: This node allows for the specification of an explicit fixing schedule, see
297+
\ref{ss:schedule_data}. Supported for underlying IBOR / term rate index. A given fixing will become effective as
298+
specified by FixingDays relative to the fixing schedule or by an explicit ResetSchedule.
299+
300+
\item \lstinline!ResetSchedule! [Optional]: This node allows for the specification of an explicit reset schedule, see
301+
\ref{ss:schedule_data}, i.e. the dates on which fixings become effective. Supported for underlying IBOR / term rate
302+
index. Can be given together with FixingSchedule or FixingDays. In the latter case, the fixing dates are derived from
303+
the reset schedule.
304+
296305
\end{itemize}

Docs/UserGuide/tradecomponents/legdatanotionals.tex

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -190,26 +190,17 @@ \subsubsection{Leg Data and Notionals}
190190
\label{lst:notional_fxreset}
191191
\end{listing}
192192

193-
194-
After the \lstinline!Notional! sub-node the \lstinline!LegData! node includes a \lstinline!ScheduleData! sub-node, and a sub-node based on the choice of \lstinline!LegType! as per below:
195-
193+
\item StrictNotionalDates [Optional]: If given and set to true, notional changes specified by startDate will be
194+
interpreted as taking place on the exact given date, even if that date falls into a calculation (accrual)
195+
period. Otherwise the notional change is applied for the next calculation period. Supported only for fixed and
196+
floating legs with IBOR / RFR term rate coupons.
196197
\item ScheduleData: This is a trade component sub-node outlined in section \ref{ss:schedule_data} Schedule Data and
197-
Dates.
198-
\item \lstinline!PaymentDates! [Optional]: This node allows for the specification of a list of explicit payment dates that overrides the payment dates generated by the payment conventions. This is an optional node and is currently only used in commodity trades, fixed legs and floating legs with underlying OIS and IBOR indices.
199-
See Listing \ref{lst:paymentdates} for an example. \break
200-
201-
\begin{listing}[H]
202-
%\hrule\medskip
203-
\begin{minted}[fontsize=\footnotesize]{xml}
204-
<PaymentDates>
205-
<PaymentDate>2020-01-15</PaymentDate>
206-
<PaymentDate>2021-01-15</PaymentDate>
207-
<PaymentDate>2022-01-17</PaymentDate>
208-
</PaymentDates>
209-
\end{minted}
210-
\caption{Payment dates}
211-
\label{lst:paymentdates}
212-
\end{listing}
198+
Dates.
199+
\item \lstinline!PaymentSchedule! [Optional]: This node allows for the specification of an explicit payment schedule,
200+
see \ref{ss:schedule_data}. Supported in commodity trades, fixed legs and floating legs with underlying OIS and IBOR
201+
indices.
202+
\item \lstinline!PaymentDates! [Deprecated]: This node allows for the specification of a list of explicit payment
203+
dates. The usage is deprecated, use PaymentSchedule instead.
213204

214205
\item FixedLegData: This trade component sub-node is required if \lstinline!LegType! is set to \emph{Fixed} It is
215206
outlined in section \ref{ss:fixedleg_data}.

Docs/UserGuide/tradecomponents/scheduledata.tex

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ \subsubsection{Schedule Data (Rules, Dates and Derived)}\label{ss:schedule_data}
138138
overwrites the last date of the schedule that is otherwise built from IMM dates.
139139

140140
Allowable values: See \lstinline!Date! in Table \ref{tab:allow_stand_data}.
141+
142+
\item \lstinline!RemoveFirstDate! [Optional]: If true the first date will be removed from the schedule. Useful to define a payment schedule using the rules for a calculation schedule.
143+
144+
Allowable values: true, false
145+
146+
\item \lstinline!RemoveLastDate! [Optional]: If true the last date will be removed from the schedule. Useful to define a fixing or reset schedule using the rules for a calculation schedule.
147+
148+
Allowable values: true, false
149+
141150
\end{itemize}
142151

143152
\medskip
@@ -202,4 +211,12 @@ \subsubsection{Schedule Data (Rules, Dates and Derived)}\label{ss:schedule_data}
202211

203212
Allowable values: See Table \ref{tab:convention} Roll Convention. Defaults to \emph{Unadjusted} if left blank or omitted.
204213

205-
\end{itemize}
214+
\item \lstinline!RemoveFirstDate! [Optional]: If true the first date will be removed from the schedule. Useful to define a payment schedule based on a calculation schedule.
215+
216+
Allowable values: true, false
217+
218+
\item \lstinline!RemoveLastDate! [Optional]: If true the last date will be removed from the schedule. Useful to define a fixing or reset schedule based on a calculation schedule.
219+
220+
Allowable values: true, false
221+
222+
\end{itemize}

OREAnalytics/orea/app/reportwriter.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void ReportWriter::writeCashflow(ore::data::Report& report, const std::string& b
262262
boost::shared_ptr<QuantExt::EquityCoupon> ptrEqCp =
263263
boost::dynamic_pointer_cast<QuantExt::EquityCoupon>(ptrFlow);
264264
Date fixingDate;
265-
Real fixingValue;
265+
Real fixingValue = Null<Real>();
266266
if (ptrBMA) {
267267
// We return the last fixing inside the coupon period
268268
fixingDate = ptrBMA->fixingDates().end()[-2];
@@ -271,7 +271,12 @@ void ReportWriter::writeCashflow(ore::data::Report& report, const std::string& b
271271
flowType = "BMAaverage";
272272
} else if (ptrFloat) {
273273
fixingDate = ptrFloat->fixingDate();
274-
fixingValue = ptrFloat-> index()->fixing(fixingDate);
274+
try {
275+
fixingValue = ptrFloat->index()->fixing(fixingDate);
276+
} catch (...) {
277+
// catch invalid fixing date, missing fixing, etc. and fall through with
278+
// fixingValue = Null (which appears as NA in the report)
279+
}
275280
if (fixingDate > asof)
276281
flowType = "InterestProjected";
277282
if (auto c = boost::dynamic_pointer_cast<QuantLib::IborCoupon>(ptrFloat)) {
@@ -564,9 +569,8 @@ void ReportWriter::writeCashflow(ore::data::Report& report, const std::string& b
564569
}
565570

566571
} catch (std::exception& e) {
567-
ALOG("Exception writing cashflow report : " << e.what());
568-
} catch (...) {
569-
ALOG("Exception writing cashflow report : Unknown Exception");
572+
ALOG(StructuredTradeErrorMessage(trade->id(), trade->tradeType(), "Error during cashflow report generation",
573+
e.what()));
570574
}
571575
}
572576
report.end();

OREData/ored/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ portfolio/inflationswap.cpp
237237
portfolio/legbuilders.cpp
238238
portfolio/legdata.cpp
239239
portfolio/legdatafactory.cpp
240+
portfolio/makenonstandardlegs.cpp
240241
portfolio/multilegoption.cpp
241242
portfolio/nettingsetdefinition.cpp
242243
portfolio/nettingsetdetails.cpp
@@ -550,6 +551,7 @@ portfolio/instrumentwrapper.hpp
550551
portfolio/legbuilders.hpp
551552
portfolio/legdata.hpp
552553
portfolio/legdatafactory.hpp
554+
portfolio/makenonstandardlegs.hpp
553555
portfolio/multilegoption.hpp
554556
portfolio/nettingsetdefinition.hpp
555557
portfolio/nettingsetdetails.hpp

OREData/ored/ored.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@
259259
#include <ored/portfolio/legbuilders.hpp>
260260
#include <ored/portfolio/legdata.hpp>
261261
#include <ored/portfolio/legdatafactory.hpp>
262+
#include <ored/portfolio/makenonstandardlegs.hpp>
262263
#include <ored/portfolio/multilegoption.hpp>
263264
#include <ored/portfolio/nettingsetdefinition.hpp>
264265
#include <ored/portfolio/nettingsetdetails.hpp>

0 commit comments

Comments
 (0)