Skip to content

Commit e384b33

Browse files
author
jenkins
committed
git subrepo pull (merge) ore
subrepo: subdir: "ore" merged: "7fa47714f3" upstream: origin: "git@gitlab.acadiasoft.net:qs/ore.git" branch: "master" commit: "832d001ed1" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "73a0129"
2 parents 5a582a7 + 832d001 commit e384b33

18 files changed

Lines changed: 328 additions & 376 deletions

File tree

Docs/UserGuide/tradedata/indexcdsoption.tex

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ \subsubsection{Index Credit Default Swap Option}
33
An index CDS option, trade type \lstinline!IndexCreditDefaultSwapOption!, is an option to enter into an index CDS at a specified strike spread or strike price. The Index CDS Option is set up using an \lstinline!IndexCreditDefaultSwapOptionData! node as shown in Listing \ref{lst:indexcdsoptiondata}. Its child nodes have the following meanings:
44

55
\begin{itemize}
6-
\item
7-
\lstinline!KnockOut!: A boolean node that determines whether front end protection is included or not. When this node evaluates to \lstinline!false!, front end protection is included. When this node evaluates to \lstinline!true!, front end protection is not included.
8-
9-
Allowable values: Boolean node, allowing \emph{Y, N, 1, 0, true, false} etc. The full set of allowable values is given in Table \ref{tab:boolean_allowable}.
106

117
\item
128
\lstinline!IndexTerm! [Optional]: An optional node giving the term of the underlying index CDS e.g.\ 3Y, 5Y, 7Y, 10Y etc. The main function of this node is to allow for different index CDS option volatility structures for different terms of the same index series e.g.\ a CDX HY Series 34 5Y volatility structure and a CDX HY Series 34 10Y volatility structure. If this node is omitted, the market is searched for a CDS volatility surface with ID equal to the value of the \lstinline!CreditCurveId! node under \lstinline!IndexCreditDefaultSwapData!. There will generally be one \lstinline!CreditCurveId! for each index CDS series e.g.\ \lstinline!CDXHYS34V1! for CDX HY Series 34 Version 1. Consequently, there can only be one CDS volatility surface for this index CDS series. When \lstinline!IndexTerm! is populated with the underlying index term, the market is searched for a CDS volatility surface with ID equal to the value of the \lstinline!CreditCurveId! node with suffix \lstinline!-[IndexTerm]!. For example, if the \lstinline!CreditCurveId! node on an index CDS option trade is \lstinline!CDXHYS34V1! and the \lstinline!IndexTerm! node is populated with \lstinline!5Y!, the market will be searched for a CDS volatility surface with ID \lstinline!CDXHYS34V1-5Y! and this will be used in the trade valuation. In this way, different volatility surfaces can be used to value different terms of the same CDS index series.
@@ -83,7 +79,6 @@ \subsubsection{Index Credit Default Swap Option}
8379
\begin{listing}[H]
8480
\begin{minted}[fontsize=\footnotesize]{xml}
8581
<IndexCreditDefaultSwapOptionData>
86-
<KnockOut>N</KnockOut>
8782
<IndexTerm>5Y</IndexTerm>
8883
<OptionData>
8984
<LongShort>Long</LongShort>

Examples/Example_40/Input/portfolio.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@
267267
</Envelope>
268268
<IndexCreditDefaultSwapOptionData>
269269
<Strike>0.0060</Strike>
270-
<KnockOut>N</KnockOut>
271270
<OptionData>
272271
<LongShort>Long</LongShort>
273272
<OptionType>Call</OptionType>

OREData/ored/portfolio/indexcreditdefaultswapoption.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ namespace ore {
4343
namespace data {
4444

4545
IndexCreditDefaultSwapOption::IndexCreditDefaultSwapOption()
46-
: Trade("IndexCreditDefaultSwapOption"), strike_(Null<Real>()), knockOut_(false) {}
46+
: Trade("IndexCreditDefaultSwapOption"), strike_(Null<Real>()) {}
4747

4848
IndexCreditDefaultSwapOption::IndexCreditDefaultSwapOption(const Envelope& env, const IndexCreditDefaultSwapData& swap,
49-
const OptionData& option, Real strike, bool knockOut,
49+
const OptionData& option, Real strike,
5050
const string& indexTerm, const string& strikeType,
5151
const Date& tradeDate, const Date& fepStartDate)
52-
: Trade("IndexCreditDefaultSwapOption", env), swap_(swap), option_(option), strike_(strike), knockOut_(knockOut),
52+
: Trade("IndexCreditDefaultSwapOption", env), swap_(swap), option_(option), strike_(strike),
5353
indexTerm_(indexTerm), strikeType_(strikeType), tradeDate_(tradeDate), fepStartDate_(fepStartDate) {}
5454

5555
void IndexCreditDefaultSwapOption::build(const boost::shared_ptr<EngineFactory>& engineFactory) {
@@ -308,7 +308,7 @@ void IndexCreditDefaultSwapOption::build(const boost::shared_ptr<EngineFactory>&
308308

309309
// Build the option
310310
auto option = boost::make_shared<QuantExt::IndexCdsOption>(cds, exercise, effectiveStrike_, strikeType, settleType,
311-
notionals_.tradeDate, notionals_.realisedFep, knockOut_,
311+
notionals_.tradeDate, notionals_.realisedFep,
312312
effectiveIndexTerm_);
313313
// the vol curve id is the credit curve id stripped by a term, if the credit curve id should contain one
314314
auto p = splitCurveIdWithTenor(swap_.creditCurveId());
@@ -372,7 +372,6 @@ void IndexCreditDefaultSwapOption::fromXML(XMLNode* node) {
372372
XMLNode* iCdsOptionData = XMLUtils::getChildNode(node, "IndexCreditDefaultSwapOptionData");
373373
QL_REQUIRE(iCdsOptionData, "Expected IndexCreditDefaultSwapOptionData node on trade " << id() << ".");
374374
strike_ = XMLUtils::getChildValueAsDouble(iCdsOptionData, "Strike", false, Null<Real>());
375-
knockOut_ = XMLUtils::getChildValueAsBool(iCdsOptionData, "KnockOut", false, false);
376375
indexTerm_ = XMLUtils::getChildValue(iCdsOptionData, "IndexTerm", false);
377376
strikeType_ = XMLUtils::getChildValue(iCdsOptionData, "StrikeType", false);
378377
tradeDate_ = Date();
@@ -402,7 +401,6 @@ XMLNode* IndexCreditDefaultSwapOption::toXML(XMLDocument& doc) const {
402401
XMLNode* iCdsOptionData = doc.allocNode("IndexCreditDefaultSwapOptionData");
403402
if (strike_ != Null<Real>())
404403
XMLUtils::addChild(doc, iCdsOptionData, "Strike", strike_);
405-
XMLUtils::addChild(doc, iCdsOptionData, "KnockOut", knockOut_);
406404
if (!indexTerm_.empty())
407405
XMLUtils::addChild(doc, iCdsOptionData, "IndexTerm", indexTerm_);
408406
if (strikeType_ != "")
@@ -427,8 +425,6 @@ const OptionData& IndexCreditDefaultSwapOption::option() const { return option_;
427425

428426
const std::string& IndexCreditDefaultSwapOption::indexTerm() const { return indexTerm_; }
429427

430-
bool IndexCreditDefaultSwapOption::knockOut() const { return knockOut_; }
431-
432428
Real IndexCreditDefaultSwapOption::strike() const { return strike_; }
433429

434430
const string& IndexCreditDefaultSwapOption::strikeType() const { return strikeType_; }

OREData/ored/portfolio/indexcreditdefaultswapoption.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class IndexCreditDefaultSwapOption : public Trade {
3434

3535
//! Detailed constructor
3636
IndexCreditDefaultSwapOption(const ore::data::Envelope& env, const IndexCreditDefaultSwapData& swap,
37-
const ore::data::OptionData& option, QuantLib::Real strike, bool knockOut = false,
37+
const ore::data::OptionData& option, QuantLib::Real strike,
3838
const std::string& indexTerm = "", const std::string& strikeType = "Spread",
3939
const QuantLib::Date& tradeDate = Date(), const QuantLib::Date& fepStartDate = Date());
4040

@@ -55,7 +55,6 @@ class IndexCreditDefaultSwapOption : public Trade {
5555
const IndexCreditDefaultSwapData& swap() const;
5656
const ore::data::OptionData& option() const;
5757
const std::string& indexTerm() const;
58-
bool knockOut() const;
5958
QuantLib::Real strike() const;
6059
const std::string& strikeType() const;
6160
const QuantLib::Date& tradeDate() const;
@@ -74,7 +73,6 @@ class IndexCreditDefaultSwapOption : public Trade {
7473
IndexCreditDefaultSwapData swap_;
7574
ore::data::OptionData option_;
7675
QuantLib::Real strike_;
77-
bool knockOut_;
7876
std::string indexTerm_;
7977
std::string strikeType_;
8078
QuantLib::Date tradeDate_;

OREData/ored/portfolio/legdata.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,7 @@ Leg makeYoYLeg(const LegData& data, const boost::shared_ptr<InflationIndex>& ind
18401840
boost::dynamic_pointer_cast<CapFlooredYoYLegEngineBuilder>(builder);
18411841
string indexname = yoyLegData->index();
18421842
boost::shared_ptr<InflationCouponPricer> couponPricer =
1843-
cappedFlooredYoYBuilder->engine(indexname.replace(indexname.find(" ", 0), 1, ""));
1843+
cappedFlooredYoYBuilder->engine(IndexNameTranslator::instance().oreName(indexname));
18441844

18451845
// set coupon pricer for the leg
18461846

@@ -1893,7 +1893,7 @@ Leg makeYoYLeg(const LegData& data, const boost::shared_ptr<InflationIndex>& ind
18931893
boost::dynamic_pointer_cast<CapFlooredNonStandardYoYLegEngineBuilder>(builder);
18941894
string indexname = zcIndex->name();
18951895
boost::shared_ptr<InflationCouponPricer> couponPricer =
1896-
cappedFlooredYoYBuilder->engine(indexname.replace(indexname.find(" ", 0), 1, ""));
1896+
cappedFlooredYoYBuilder->engine(IndexNameTranslator::instance().oreName(indexname));
18971897

18981898
// set coupon pricer for the leg
18991899

0 commit comments

Comments
 (0)