Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
cbo.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
27
28using namespace QuantLib;
29using namespace QuantExt;
30using namespace std::placeholders;
31using namespace ore::data;
32
33namespace ore {
34namespace data {
35
36void CBO::build(const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory) {
37 DLOG("CBO::build() called for trade " << id());
38
39 // ISDA taxonomy: not a derivative, but define the asset class at least
40 // so that we can determine a TRS asset class that has CBO underlyings
41 additionalData_["isdaAssetClass"] = string("Credit");
42 additionalData_["isdaBaseProduct"] = string("");
43 additionalData_["isdaSubProduct"] = string("");
44 additionalData_["isdaTransaction"] = string("");
45
46 requiredFixings_.clear();
47
48 const QuantLib::ext::shared_ptr<Market> market = engineFactory->market();
49 QuantLib::ext::shared_ptr<EngineBuilder> builder = engineFactory->builder("CBO");
50
51 populateFromCboReferenceData(engineFactory->referenceData());
52 validateCbo();
53
54 Schedule schedule = makeSchedule(scheduleData_);
55
56 bondbasket_ = bondbasketdata_.build(engineFactory, parseCurrency(ccy_), reinvestmentEndDate_);
57 requiredFixings_.addData(bondbasketdata_.requiredFixings());
58
59 vector<QuantExt::Tranche> tranches;
60 size_t investCount = 0;
61 size_t idx = 0;
62 multiplier_ = 1.0;
63 for(size_t i = 0; i < trancheData_.size(); i++){
64
65 QuantExt::Tranche tranche;
66
67 tranche.name = trancheData_[i]->name();;
68 tranche.faceAmount = trancheData_[i]->faceAmount();
69 tranche.icRatio = trancheData_[i]->icRatio();
70 tranche.ocRatio = trancheData_[i]->ocRatio();
71
72 LegData legdata = LegData();
73 legdata.notionals() = {trancheData_[i]->faceAmount()};
74 legdata.schedule() = scheduleData_;
75 legdata.dayCounter() = daycounter_;
76 legdata.concreteLegData() = trancheData_[i]->concreteLegData();
77 legdata.paymentConvention() = paymentConvention_;
78
79 auto legBuilder = engineFactory->legBuilder(trancheData_[i]->concreteLegData()->legType());
80 RequiredFixings requiredFixingsLeg;
81 auto configuration = builder->configuration(MarketContext::pricing);
82 Leg leg = legBuilder->buildLeg(legdata, engineFactory, requiredFixingsLeg, configuration);
83 tranche.leg = leg;
84
85 requiredFixings_.addData(requiredFixingsLeg);
86 tranches.push_back(tranche);
87
88 //check if invested tranche
89 if(tranche.name == investedTrancheName_){
90 idx = i; //Set for leg output
91 multiplier_ = investedNotional_ / tranche.faceAmount;
92 if(multiplier_ > 1.0)
93 ALOG("Ratio bigger than 1 : investment=" << investedNotional_ << " vs. faceAmount=" << tranche.faceAmount);
94 investCount++;
95 }
96 }
97 //check if tranche name could be found...
98 QL_REQUIRE(investCount == 1, "Could not assign CBOInvestment TrancheName " << investedTrancheName_ << " to Names of CBOTranches.");
99
100 // CHECK DATES BONDS vs TRANCHES
101 Date longestBondDate = Settings::instance().evaluationDate();
102 for (const auto& bond : bondbasket_->bonds()) {
103 Date bondMat = bond.second->maturityDate();
104 if (bondMat > longestBondDate)
105 longestBondDate = bondMat;
106 }
107 QL_REQUIRE(schedule.endDate() > longestBondDate, " Tranche Maturity should be after Bond Maturity: Bond "
108 << longestBondDate << " vs. Tranche " << schedule.endDate());
109
110 // set QuantExt instrument
111 QuantLib::ext::shared_ptr<QuantExt::CBO> cbo =
112 QuantLib::ext::make_shared<QuantExt::CBO>(bondbasket_, schedule, parseReal(seniorFee_), parseDayCounter(feeDayCounter_),
115 // set pricing engine...
116 QuantLib::ext::shared_ptr<CboMCEngineBuilder> cboBuilder = QuantLib::ext::dynamic_pointer_cast<CboMCEngineBuilder>(builder);
117 QL_REQUIRE(cboBuilder, "No Builder found for CBO: " << id());
118 cbo->setPricingEngine(cboBuilder->engine(bondbasket_->pool()));
119 setSensitivityTemplate(*cboBuilder);
120 instrument_.reset(new VanillaInstrument(cbo, multiplier_));
121
122 maturity_ = schedule.endDate();
123 npvCurrency_ = ccy_;
124 notional_ = investedNotional_;
125 legs_ = vector<QuantLib::Leg>(1, tranches[idx].leg);
126 legCurrencies_ = vector<string>(1, ccy_);
127 legPayers_ = vector<bool>(1, false);
128
129 // sensitivity...
130 for (const auto& bond : bondBasketData().bonds()) {
131 cbo->registerWith(securitySpecificCreditCurve(market, bond->bondData().securityId(),
132 bond->bondData().creditCurveId()));
133 cbo->registerWith(bond->instrument()->qlInstrument());
134
135 // to capture floater...
136 Leg bondleg = bond->legs().front();
137 for (auto const& c : bondleg)
138 cbo->registerWith(c);
139 }
140
141 std::map<string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>> fxIndexMap = bondbasket_->fxIndexMap();
142 std::map<string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>::iterator it;
143 for (it = fxIndexMap.begin(); it != fxIndexMap.end(); ++it)
144 cbo->registerWith(it->second);
145}
146
147void CBO::populateFromCboReferenceData(const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager){
148
149 QL_REQUIRE(!structureId_.empty(), "CBO::populateFromCboReferenceDat(): no structure id given");
150 if (!referenceDataManager || !referenceDataManager->hasData(CboReferenceDatum::TYPE, structureId_)) {
151 DLOG("Could not get CboReferenceDatum for Id " << structureId_ << " leave data in trade unchanged");
152 } else {
153 auto cboRefData = QuantLib::ext::dynamic_pointer_cast<CboReferenceDatum>(
154 referenceDataManager->getData(CboReferenceDatum::TYPE, structureId_));
155 QL_REQUIRE(cboRefData, "could not cast to CboReferenceDatum, this is unexpected");
156 populateFromCboReferenceData(cboRefData);
157 }
158}
159
161
162 Trade::fromXML(node);
163 XMLNode* cboData = XMLUtils::getChildNode(node, "CBOData");
164 QL_REQUIRE(cboData, "expected node CBOData");
165
166 //investment
167 XMLNode* cboInvestment = XMLUtils::getChildNode(cboData, "CBOInvestment");
168 QL_REQUIRE(cboInvestment, "expected node CBOInvestment");
169
170 investedTrancheName_ = XMLUtils::getChildValue(cboInvestment, "TrancheName", true);
171 investedNotional_ = XMLUtils::getChildValueAsDouble(cboInvestment, "Notional", true);
172 structureId_ = XMLUtils::getChildValue(cboInvestment, "StructureId", true);
173
174 //structure
175 XMLNode* cboStructure = XMLUtils::getChildNode(cboData, "CBOStructure");
176 //QL_REQUIRE(cboStructure, "expected node CBOStructure");
177 if(cboStructure){
178 daycounter_ = XMLUtils::getChildValue(cboStructure, "DayCounter", false);
179 paymentConvention_ = XMLUtils::getChildValue(cboStructure, "PaymentConvention", false);
180 ccy_ = XMLUtils::getChildValue(cboStructure, "Currency", false);
181 seniorFee_ = XMLUtils::getChildValue(cboStructure, "SeniorFee", false);
182 subordinatedFee_ = XMLUtils::getChildValue(cboStructure, "SubordinatedFee", false);
183 equityKicker_ = XMLUtils::getChildValue(cboStructure, "EquityKicker", false);
184 feeDayCounter_ = XMLUtils::getChildValue(cboStructure, "FeeDayCounter", false);
185 reinvestmentEndDate_ = XMLUtils::getChildValue(cboStructure, "ReinvestmentEndDate", false, "");
186
187 scheduleData_ = ScheduleData();
188 XMLNode* scheduleData = XMLUtils::getChildNode(cboStructure, "ScheduleData");
189 if (scheduleData)
190 scheduleData_.fromXML(scheduleData);
191
192 bondbasketdata_.clear();
193 XMLNode* bondbasketNode = XMLUtils::getChildNode(cboStructure, "BondBasketData");
194 if(bondbasketNode)
195 bondbasketdata_.fromXML(bondbasketNode);
196
197 trancheData_.clear();
198 XMLNode* tranchesNode = XMLUtils::getChildNode(cboStructure, "CBOTranches");
199 if(tranchesNode){
200 for (XMLNode* child = XMLUtils::getChildNode(tranchesNode, "Tranche"); child; child = XMLUtils::getNextSibling(child)) {
201 auto data = QuantLib::ext::make_shared<ore::data::TrancheData>();
202 data->fromXML(child);
203 trancheData_.push_back(data);
204 }
205 }
206 }
207
208}
209
211
212 XMLNode* node = Trade::toXML(doc);
213 XMLNode* cboData = doc.allocNode("CBOData");
214 XMLUtils::appendNode(node, cboData);
215
216 XMLNode* cboInvestment = doc.allocNode("CBOInvestment");
217 XMLUtils::appendNode(cboData, cboInvestment);
218 XMLUtils::addChild(doc, cboInvestment, "TrancheName", investedTrancheName_);
219 XMLUtils::addChild(doc, cboInvestment, "Notional", investedNotional_);
220 XMLUtils::addChild(doc, cboInvestment, "StructureId", structureId_);
221
222 XMLNode* cboStructure = doc.allocNode("CBOStructure");
223 XMLUtils::appendNode(cboData, cboStructure);
224 XMLUtils::addChild(doc, cboStructure, "DayCounter", daycounter_);
225 XMLUtils::addChild(doc, cboStructure, "PaymentConvention", paymentConvention_);
226 XMLUtils::addChild(doc, cboStructure, "Currency", ccy_);
227 XMLUtils::addChild(doc, cboStructure, "SeniorFee", seniorFee_);
228 XMLUtils::addChild(doc, cboStructure, "SubordinatedFee", subordinatedFee_);
229 XMLUtils::addChild(doc, cboStructure, "EquityKicker", equityKicker_);
230 XMLUtils::addChild(doc, cboStructure, "FeeDayCounter", feeDayCounter_);
231 XMLUtils::addChild(doc, cboStructure, "ReinvestmentEndDate", reinvestmentEndDate_);
232
233 XMLUtils::appendNode(cboStructure, scheduleData_.toXML(doc));
234 XMLUtils::appendNode(cboStructure, bondbasketdata_.toXML(doc));
235
236 XMLNode* cboTranches = doc.allocNode("CBOTranches");
237 XMLUtils::appendNode(cboStructure, cboTranches);
238 for(size_t i = 0; i < trancheData_.size(); i++)
239 XMLUtils::appendNode(cboTranches, trancheData_[i]->toXML(doc));
240
241 return node;
242
243}
244
245std::map<AssetClass, std::set<std::string>>
246CBO::underlyingIndices(const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager) const {
247 return bondbasketdata_.underlyingIndices(referenceDataManager);
248}
249
251 const std::string& parentId, const QuantLib::ext::shared_ptr<Trade>& underlying, const std::vector<Date>& valuationDates,
252 const std::vector<Date>& paymentDates, const std::string& fundingCurrency,
253 const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory, QuantLib::ext::shared_ptr<QuantLib::Index>& underlyingIndex,
254 Real& underlyingMultiplier, std::map<std::string, double>& indexQuantities,
255 std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices, Real& initialPrice,
256 std::string& assetCurrency, std::string& creditRiskCurrency,
257 std::map<std::string, SimmCreditQualifierMapping>& creditQualifierMapping, Date& maturity,
258 const std::function<QuantLib::ext::shared_ptr<QuantExt::FxIndex>(
259 const QuantLib::ext::shared_ptr<Market> market, const std::string& configuration, const std::string& domestic,
260 const std::string& foreign, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices)>&
261 getFxIndex,
262 const std::string& underlyingDerivativeId, RequiredFixings& fixings, std::vector<Leg>& returnLegs) const {
263 auto t = QuantLib::ext::dynamic_pointer_cast<ore::data::CBO>(underlying);
264 QL_REQUIRE(t, "could not cast to ore::data::CBO, this is unexpected");
265 string indexName = "GENERIC-" + t->investedTrancheName();
266 IndexNameTranslator::instance().add(indexName, indexName);
267 indexQuantities[indexName] = t->underlyingMultiplier();
268 underlyingIndex = QuantLib::ext::make_shared<QuantExt::GenericIndex>(indexName);
269 underlyingMultiplier = t->underlyingMultiplier();
270 assetCurrency = t->npvCurrency();
271 creditRiskCurrency = t->npvCurrency();
272
273 auto fxIndex = getFxIndex(engineFactory->market(), engineFactory->configuration(MarketContext::pricing),
274 assetCurrency, fundingCurrency, fxIndices);
275 returnLegs.push_back(QuantExt::TRSLeg(valuationDates, paymentDates, underlyingMultiplier, underlyingIndex, fxIndex)
276 .withInitialPrice(initialPrice));
277
278 //fill the SimmCreditQualifierMapping
279 auto bonds = t->bondBasketData().bonds();
280 for (Size i = 0; i < bonds.size(); ++i) {
281 creditQualifierMapping[ore::data::securitySpecificCreditCurveName(bonds[i]->bondData().securityId(),
282 bonds[i]->bondData().creditCurveId())] =
283 SimmCreditQualifierMapping(bonds[i]->bondData().securityId(), bonds[i]->bondData().creditGroup());
284 creditQualifierMapping[bonds[i]->bondData().creditCurveId()] =
285 SimmCreditQualifierMapping(bonds[i]->bondData().securityId(), bonds[i]->bondData().creditGroup());
286 }
287}
288
289
291
292 QL_REQUIRE(node, "CboReferenceDatum::CboStructure::fromXML(): no node given");
293
294 daycounter = XMLUtils::getChildValue(node, "DayCounter", true);
295 paymentConvention = XMLUtils::getChildValue(node, "PaymentConvention", true);
296 ccy = XMLUtils::getChildValue(node, "Currency", true);
297 seniorFee = XMLUtils::getChildValue(node, "SeniorFee", true);
298 subordinatedFee = XMLUtils::getChildValue(node, "SubordinatedFee", true);
299 equityKicker = XMLUtils::getChildValue(node, "EquityKicker", true);
300 feeDayCounter = XMLUtils::getChildValue(node, "FeeDayCounter", true);
301 reinvestmentEndDate = XMLUtils::getChildValue(node, "ReinvestmentEndDate", false, "");
302
303 XMLNode* scheduleNode = XMLUtils::getChildNode(node, "ScheduleData");
304 QL_REQUIRE(scheduleNode, "No CBOTranches Node");
305 scheduleData.fromXML(scheduleNode);
306
307 bondbasketdata.clear();
308 XMLNode* bondbasketNode = XMLUtils::getChildNode(node, "BondBasketData");
309 QL_REQUIRE(bondbasketNode, "No BondBasketData Node");
310 bondbasketdata.fromXML(bondbasketNode);
311
312 trancheData.clear();
313 XMLNode* tranchesNode = XMLUtils::getChildNode(node, "CBOTranches");
314 QL_REQUIRE(tranchesNode, "No CBOTranches Node");
315 for (XMLNode* child = XMLUtils::getChildNode(tranchesNode, "Tranche"); child; child = XMLUtils::getNextSibling(child)) {
316 auto data = QuantLib::ext::make_shared<ore::data::TrancheData>();
317 data->fromXML(child);
318 trancheData.push_back(data);
319 }
320
321}
322
324
325 XMLNode* node = doc.allocNode("CboStructure");
326
327 XMLUtils::addChild(doc, node, "DayCounter", daycounter);
328 XMLUtils::addChild(doc, node, "PaymentConvention", paymentConvention);
329 XMLUtils::addChild(doc, node, "Currency", ccy);
330 XMLUtils::addChild(doc, node, "SeniorFee", seniorFee);
331 XMLUtils::addChild(doc, node, "SubordinatedFee", subordinatedFee);
332 XMLUtils::addChild(doc, node, "EquityKicker", equityKicker);
333 XMLUtils::addChild(doc, node, "FeeDayCounter", feeDayCounter);
334 XMLUtils::addChild(doc, node, "ReinvestmentEndDate", reinvestmentEndDate);
335
336 XMLUtils::appendNode(node, scheduleData.toXML(doc));
337 XMLUtils::appendNode(node, bondbasketdata.toXML(doc));
338
339 XMLNode* cboTranches = doc.allocNode("CBOTranches");
340 XMLUtils::appendNode(node, cboTranches);
341 for(size_t i = 0; i < trancheData.size(); i++)
342 XMLUtils::appendNode(cboTranches, trancheData[i]->toXML(doc));
343
344 return node;
345}
346
348
350 cboStructure_.fromXML(XMLUtils::getChildNode(node, "CboReferenceData"));
351
352}
353
355
356 XMLNode* node = ReferenceDatum::toXML(doc);
357 XMLNode* dataNode = cboStructure_.toXML(doc);
358 XMLUtils::setNodeName(doc, dataNode, "CboReferenceData");
359 XMLUtils::appendNode(node, dataNode);
360
361 return node;
362}
363
364
365void CBO::populateFromCboReferenceData(const QuantLib::ext::shared_ptr<CboReferenceDatum>& cboReferenceDatum){
366
367 DLOG("populating data cbo from reference data");
368 QL_REQUIRE(cboReferenceDatum, "populateFromCboReferenceData(): empty cbo reference datum given");
369
370 if (seniorFee_.empty()) {
371 seniorFee_ = cboReferenceDatum->cbostructure().seniorFee;
372 TLOG("overwrite SeniorFee with '" << seniorFee_ << "'");
373 }
374
375 if (subordinatedFee_.empty()) {
376 subordinatedFee_ = cboReferenceDatum->cbostructure().subordinatedFee;
377 TLOG("overwrite SubordinatedFee with '" << subordinatedFee_ << "'");
378 }
379
380 if (equityKicker_.empty()) {
381 equityKicker_ = cboReferenceDatum->cbostructure().equityKicker;
382 TLOG("overwrite EquityKicker with '" << equityKicker_ << "'");
383 }
384
385 if (feeDayCounter_.empty()) {
386 feeDayCounter_ = cboReferenceDatum->cbostructure().feeDayCounter;
387 TLOG("overwrite FeeDayCounter with '" << feeDayCounter_ << "'");
388 }
389
390 if (ccy_.empty()) {
391 ccy_ = cboReferenceDatum->cbostructure().ccy;
392 TLOG("overwrite currency with '" << ccy_ << "'");
393 }
394
395 if (reinvestmentEndDate_.empty()) {
396 reinvestmentEndDate_ = cboReferenceDatum->cbostructure().reinvestmentEndDate;
397 TLOG("overwrite ReinvestmentEndDate with '" << reinvestmentEndDate_ << "'");
398 }
399
400 if (daycounter_.empty()) {
401 daycounter_ = cboReferenceDatum->cbostructure().daycounter;
402 TLOG("overwrite DayCounter with '" << daycounter_ << "'");
403 }
404
405 if (paymentConvention_.empty()) {
406 paymentConvention_ = cboReferenceDatum->cbostructure().paymentConvention;
407 TLOG("overwrite PaymentConvention with '" << paymentConvention_ << "'");
408 }
409
410 if (!scheduleData_.hasData()) {
411 scheduleData_ = cboReferenceDatum->cbostructure().scheduleData;
412 TLOG("overwrite ScheduleData");
413 }
414
415 if (bondbasketdata_.empty()) {
416 bondbasketdata_ = cboReferenceDatum->cbostructure().bondbasketdata;
417 TLOG("overwrite BondBasketData");
418 }
419
420 if (trancheData_.empty()) {
421 trancheData_ = cboReferenceDatum->cbostructure().trancheData;
422 TLOG("overwrite TrancheData");
423 }
424
425}
426
428
429 //Check for mandatroy fields
430 //reinvestmentEndDate_ not required
431 //TrancheName, Notional, StructuredID already checked in fromXML
432
433 std::string missing = "";
434
435 if (seniorFee_.empty())
436 missing.append("SeniorFee ");
437
438 if (subordinatedFee_.empty())
439 missing.append("SubordinatedFee ");
440
441 if (equityKicker_.empty())
442 missing.append("EquityKicker ");
443
444 if (feeDayCounter_.empty())
445 missing.append("FeeDayCounter ");
446
447 if (ccy_.empty())
448 missing.append("Currency ");
449
450 if (daycounter_.empty())
451 missing.append("DayCounter ");
452
453 if (paymentConvention_.empty())
454 missing.append("PaymentConvention ");
455
456 if (!scheduleData_.hasData())
457 missing.append("ScheduleData ");
458
459 if (bondbasketdata_.empty())
460 missing.append("BondBasketData ");
461
462 if (trancheData_.empty())
463 missing.append("TrancheData ");
464
465 if(!missing.empty())
466 QL_FAIL("CBO " << structureId_ << " expects " + missing +"elements");
467
468}
469
470} // namespace data
471} // namespace ore
collateralized bond obligation data model
std::string investedTrancheName_
Currency ccy_
Rate subordinatedFee_
DayCounter feeDayCounter_
std::map< AssetClass, std::set< std::string > > underlyingIndices(const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager=nullptr) const override
Add underlying Bond names.
Definition: cbo.cpp:246
void fromXML(XMLNode *node) override
Definition: cbo.cpp:160
XMLNode * toXML(XMLDocument &doc) const override
Definition: cbo.cpp:210
void populateFromCboReferenceData(const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager)
Definition: cbo.cpp:147
void validateCbo()
Definition: cbo.cpp:427
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Definition: cbo.cpp:36
void fromXML(XMLNode *node) override
Definition: cbo.cpp:347
XMLNode * toXML(ore::data::XMLDocument &doc) const override
Definition: cbo.cpp:354
static constexpr const char * TYPE
Definition: cbo.hpp:38
Serializable object holding leg data.
Definition: legdata.hpp:844
const string & paymentConvention() const
Definition: legdata.hpp:878
const ScheduleData & schedule() const
Definition: legdata.hpp:874
const string & dayCounter() const
Definition: legdata.hpp:877
QuantLib::ext::shared_ptr< LegAdditionalData > concreteLegData() const
Definition: legdata.hpp:891
const vector< double > & notionals() const
Definition: legdata.hpp:875
void fromXML(XMLNode *node) override
XMLNode * toXML(ore::data::XMLDocument &doc) const override
Serializable schedule data.
Definition: schedule.hpp:202
virtual void fromXML(XMLNode *node) override
Definition: trade.cpp:34
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: trade.cpp:46
Vanilla Instrument Wrapper.
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
static Real getChildValueAsDouble(XMLNode *node, const string &name, bool mandatory=false, double defaultValue=0.0)
Definition: xmlutils.cpp:286
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
static XMLNode * getNextSibling(XMLNode *node, const string &name="")
Get a node's next sibling node.
Definition: xmlutils.cpp:484
static void setNodeName(XMLDocument &doc, XMLNode *node, const string &name)
Definition: xmlutils.cpp:478
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
static void appendNode(XMLNode *parent, XMLNode *child)
Definition: xmlutils.cpp:406
Pricing Engine Factory.
Currency parseCurrency(const string &s)
Convert text to QuantLib::Currency.
Definition: parsers.cpp:290
Real parseReal(const string &s)
Convert text to Real.
Definition: parsers.cpp:112
DayCounter parseDayCounter(const string &s)
Convert text to QuantLib::DayCounter.
Definition: parsers.cpp:209
translates between QuantLib::Index::name() and ORE names
Classes and functions for log message handling.
@ data
Definition: log.hpp:77
#define DLOG(text)
Logging Macro (Level = Debug)
Definition: log.hpp:554
#define ALOG(text)
Logging Macro (Level = Alert)
Definition: log.hpp:544
#define TLOG(text)
Logging Macro (Level = Data)
Definition: log.hpp:556
market data related utilties
Time maturity
Definition: utilities.cpp:66
QuantLib::Handle< QuantExt::CreditCurve > securitySpecificCreditCurve(const QuantLib::ext::shared_ptr< Market > &market, const std::string &securityId, const std::string &creditCurveId, const std::string &configuration)
Definition: marketdata.cpp:98
std::string securitySpecificCreditCurveName(const std::string &securityId, const std::string &creditCurveId)
Definition: marketdata.cpp:79
Schedule makeSchedule(const ScheduleDates &data)
Definition: schedule.cpp:263
Serializable Credit Default Swap.
Definition: namespaces.docs:23
QuantLib::Leg leg
std::string name
void build(const std::string &parentId, const QuantLib::ext::shared_ptr< Trade > &underlying, const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const std::string &fundingCurrency, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, QuantLib::ext::shared_ptr< QuantLib::Index > &underlyingIndex, Real &underlyingMultiplier, std::map< std::string, double > &indexQuantities, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices, Real &initialPrice, std::string &assetCurrency, std::string &creditRiskCurrency, std::map< std::string, SimmCreditQualifierMapping > &creditQualifierMapping, Date &maturity, const std::function< QuantLib::ext::shared_ptr< QuantExt::FxIndex >(const QuantLib::ext::shared_ptr< Market > market, const std::string &configuration, const std::string &domestic, const std::string &foreign, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices)> &getFxIndex, const std::string &underlyingDerivativeId, RequiredFixings &fixings, std::vector< Leg > &returnLegs) const override
Definition: cbo.cpp:250
void fromXML(XMLNode *node) override
Definition: cbo.cpp:290
XMLNode * toXML(ore::data::XMLDocument &doc) const override
Definition: cbo.cpp:323