Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
CBO Class Reference

#include <ored/portfolio/cbo.hpp>

+ Inheritance diagram for CBO:
+ Collaboration diagram for CBO:

Public Member Functions

 CBO ()
 
std::map< AssetClass, std::set< std::string > > underlyingIndices (const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager=nullptr) const override
 Add underlying Bond names. More...
 
void build (const QuantLib::ext::shared_ptr< EngineFactory > &) override
 
void fromXML (XMLNode *node) override
 
XMLNodetoXML (XMLDocument &doc) const override
 
QuantLib::Real notional () const override
 Return the current notional in npvCurrency. See individual sub-classes for the precise definition. More...
 
std::string notionalCurrency () const override
 
std::string investedTrancheName ()
 
const BondBasketbondBasketData ()
 
double underlyingMultiplier ()
 
- Public Member Functions inherited from Trade
 Trade ()
 Default constructor. More...
 
 Trade (const string &tradeType, const Envelope &env=Envelope(), const TradeActions &ta=TradeActions())
 Base class constructor. More...
 
virtual ~Trade ()
 Default destructor. More...
 
virtual void build (const QuantLib::ext::shared_ptr< EngineFactory > &)=0
 
virtual std::map< std::string, RequiredFixings::FixingDatesfixings (const QuantLib::Date &settlementDate=QuantLib::Date()) const
 
const RequiredFixingsrequiredFixings () const
 
virtual std::map< AssetClass, std::set< std::string > > underlyingIndices (const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager=nullptr) const
 
void reset ()
 Reset trade, clear all base class data. This does not reset accumulated timings for this trade. More...
 
void resetPricingStats (const std::size_t numberOfPricings=0, const boost::timer::nanosecond_type cumulativePricingTime=0)
 Reset accumulated timings to given values. More...
 
string & id ()
 Set the trade id. More...
 
void setEnvelope (const Envelope &envelope)
 Set the envelope with counterparty and portfolio info. More...
 
void setAdditionalData (const std::map< std::string, boost::any > &additionalData)
 
TradeActionstradeActions ()
 Set the trade actions. More...
 
const string & id () const
 
const string & tradeType () const
 
const Envelopeenvelope () const
 
const set< string > & portfolioIds () const
 
const TradeActionstradeActions () const
 
const QuantLib::ext::shared_ptr< InstrumentWrapper > & instrument () const
 
const std::vector< QuantLib::Leg > & legs () const
 
const std::vector< string > & legCurrencies () const
 
const std::vector< bool > & legPayers () const
 
const string & npvCurrency () const
 
const Date & maturity () const
 
virtual bool isExpired (const Date &d)
 
const string & issuer () const
 
template<typename T >
additionalDatum (const std::string &tag) const
 returns any additional datum. More...
 
virtual const std::map< std::string, boost::any > & additionalData () const
 returns all additional data returned by the trade once built More...
 
const std::string & sensitivityTemplate () const
 
void validate () const
 Utility to validate that everything that needs to be set in this base class is actually set. More...
 
virtual bool hasCashflows () const
 
boost::timer::nanosecond_type getCumulativePricingTime () const
 Get cumulative timing spent on pricing. More...
 
std::size_t getNumberOfPricings () const
 Get number of pricings. More...
 
- Public Member Functions inherited from XMLSerializable
virtual ~XMLSerializable ()
 
virtual void fromXML (XMLNode *node)=0
 
virtual XMLNodetoXML (XMLDocument &doc) const =0
 
void fromFile (const std::string &filename)
 
void toFile (const std::string &filename) const
 
void fromXMLString (const std::string &xml)
 Parse from XML string. More...
 
std::string toXMLString () const
 Parse from XML string. More...
 

Protected Attributes

std::map< std::string, std::set< Date > > fixings_
 
- Protected Attributes inherited from Trade
string tradeType_
 
QuantLib::ext::shared_ptr< InstrumentWrapperinstrument_
 
std::vector< QuantLib::Leg > legs_
 
std::vector< string > legCurrencies_
 
std::vector< boollegPayers_
 
string npvCurrency_
 
QuantLib::Real notional_
 
string notionalCurrency_
 
Date maturity_
 
string issuer_
 
string sensitivityTemplate_
 
bool sensitivityTemplateSet_ = false
 
std::size_t savedNumberOfPricings_ = 0
 
boost::timer::nanosecond_type savedCumulativePricingTime_ = 0
 
RequiredFixings requiredFixings_
 
std::map< std::string, boost::any > additionalData_
 

Private Member Functions

void populateFromCboReferenceData (const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager)
 
void populateFromCboReferenceData (const QuantLib::ext::shared_ptr< CboReferenceDatum > &cboReferenceDatum)
 
void validateCbo ()
 

Private Attributes

QuantLib::ext::shared_ptr< QuantExt::BondBasketbondbasket_
 
BondBasket bondbasketdata_
 
std::string feeDayCounter_
 
std::string seniorFee_
 
std::string subordinatedFee_
 
std::string equityKicker_
 
std::string ccy_
 
std::string reinvestmentEndDate_
 
std::string investedTrancheName_
 
std::vector< QuantLib::ext::shared_ptr< TrancheData > > trancheData_
 
ScheduleData scheduleData_
 
std::string daycounter_
 
std::string paymentConvention_
 
double investedNotional_
 
std::string structureId_
 
double multiplier_
 

Additional Inherited Members

- Protected Member Functions inherited from Trade
Date addPremiums (std::vector< QuantLib::ext::shared_ptr< Instrument > > &instruments, std::vector< Real > &multipliers, const Real tradeMultiplier, const PremiumData &premiumData, const Real premiumMultiplier, const Currency &tradeCurrency, const QuantLib::ext::shared_ptr< EngineFactory > &factory, const string &configuration)
 
void setLegBasedAdditionalData (const Size legNo, Size resultLegId=Null< Size >()) const
 
void setSensitivityTemplate (const EngineBuilder &builder)
 
void setSensitivityTemplate (const std::string &id)
 

Detailed Description

Definition at line 71 of file cbo.hpp.

Constructor & Destructor Documentation

◆ CBO()

CBO ( )

Definition at line 73 of file cbo.hpp.

73: Trade("CBO") {}
Trade()
Default constructor.
Definition: trade.hpp:59

Member Function Documentation

◆ underlyingIndices()

std::map< AssetClass, std::set< std::string > > underlyingIndices ( const QuantLib::ext::shared_ptr< ReferenceDataManager > &  referenceDataManager = nullptr) const
overridevirtual

Add underlying Bond names.

Reimplemented from Trade.

Definition at line 246 of file cbo.cpp.

246 {
247 return bondbasketdata_.underlyingIndices(referenceDataManager);
248}
BondBasket bondbasketdata_
Definition: cbo.hpp:100

◆ build()

void build ( const QuantLib::ext::shared_ptr< EngineFactory > &  )
overridevirtual

Build QuantLib/QuantExt instrument, link pricing engine. If build() is called multiple times, reset() should be called between these calls.

Implements Trade.

Definition at line 36 of file cbo.cpp.

36 {
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
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());
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();
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
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();
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}
std::string investedTrancheName_
Currency ccy_
Rate subordinatedFee_
DayCounter feeDayCounter_
QuantLib::ext::shared_ptr< QuantExt::BondBasket > bondbasket_
Definition: cbo.hpp:99
const BondBasket & bondBasketData()
Definition: cbo.hpp:87
double investedNotional_
Definition: cbo.hpp:112
ScheduleData scheduleData_
Definition: cbo.hpp:109
std::string daycounter_
Definition: cbo.hpp:110
void populateFromCboReferenceData(const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager)
Definition: cbo.cpp:147
std::vector< QuantLib::ext::shared_ptr< TrancheData > > trancheData_
Definition: cbo.hpp:108
double multiplier_
Definition: cbo.hpp:114
void validateCbo()
Definition: cbo.cpp:427
std::string paymentConvention_
Definition: cbo.hpp:111
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 addData(const RequiredFixings &requiredFixings)
string npvCurrency_
Definition: trade.hpp:201
std::vector< bool > legPayers_
Definition: trade.hpp:200
std::vector< string > legCurrencies_
Definition: trade.hpp:199
std::vector< QuantLib::Leg > legs_
Definition: trade.hpp:198
QuantLib::Real notional_
Definition: trade.hpp:202
void setSensitivityTemplate(const EngineBuilder &builder)
Definition: trade.cpp:295
RequiredFixings requiredFixings_
Definition: trade.hpp:223
QuantLib::ext::shared_ptr< InstrumentWrapper > instrument_
Definition: trade.hpp:197
std::map< std::string, boost::any > additionalData_
Definition: trade.hpp:224
Vanilla Instrument Wrapper.
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
#define DLOG(text)
Logging Macro (Level = Debug)
Definition: log.hpp:554
#define ALOG(text)
Logging Macro (Level = Alert)
Definition: log.hpp:544
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
Schedule makeSchedule(const ScheduleDates &data)
Definition: schedule.cpp:263
QuantLib::Leg leg
std::string name
+ Here is the call graph for this function:

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Reimplemented from Trade.

Definition at line 160 of file cbo.cpp.

160 {
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
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}
std::string reinvestmentEndDate_
Definition: cbo.hpp:106
std::string structureId_
Definition: cbo.hpp:113
Serializable schedule data.
Definition: schedule.hpp:202
virtual void fromXML(XMLNode *node) override
Definition: schedule.cpp:179
virtual void fromXML(XMLNode *node) override
Definition: trade.cpp:34
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
@ data
Definition: log.hpp:77
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Reimplemented from Trade.

Definition at line 210 of file cbo.cpp.

210 {
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}
XMLNode * toXML(XMLDocument &doc) const override
Definition: cbo.cpp:210
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: schedule.cpp:198
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: trade.cpp:46
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
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
+ Here is the call graph for this function:

◆ notional()

QuantLib::Real notional ( ) const
overridevirtual

Return the current notional in npvCurrency. See individual sub-classes for the precise definition.

Reimplemented from Trade.

Definition at line 83 of file cbo.hpp.

83{ return notional_; }

◆ notionalCurrency()

std::string notionalCurrency ( ) const
overridevirtual

Reimplemented from Trade.

Definition at line 84 of file cbo.hpp.

84{ return ccy_; }

◆ investedTrancheName()

std::string investedTrancheName ( )

Definition at line 86 of file cbo.hpp.

86{ return investedTrancheName_; };

◆ bondBasketData()

const BondBasket & bondBasketData ( )

Definition at line 87 of file cbo.hpp.

87{ return bondbasketdata_; }

◆ underlyingMultiplier()

double underlyingMultiplier ( )

Definition at line 88 of file cbo.hpp.

88{ return multiplier_; }

◆ populateFromCboReferenceData() [1/2]

void populateFromCboReferenceData ( const QuantLib::ext::shared_ptr< ReferenceDataManager > &  referenceDataManager)
private

Definition at line 147 of file cbo.cpp.

147 {
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");
157 }
158}
static constexpr const char * TYPE
Definition: cbo.hpp:38

◆ populateFromCboReferenceData() [2/2]

void populateFromCboReferenceData ( const QuantLib::ext::shared_ptr< CboReferenceDatum > &  cboReferenceDatum)
private

Definition at line 365 of file cbo.cpp.

365 {
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}
bool hasData() const
Check if has any dates/rules/derived schedules.
Definition: schedule.hpp:223
#define TLOG(text)
Logging Macro (Level = Data)
Definition: log.hpp:556

◆ validateCbo()

void validateCbo ( )
private

Definition at line 427 of file cbo.cpp.

427 {
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}

Member Data Documentation

◆ fixings_

std::map<std::string, std::set<Date> > fixings_
protected

Definition at line 91 of file cbo.hpp.

◆ bondbasket_

QuantLib::ext::shared_ptr<QuantExt::BondBasket> bondbasket_
private

Definition at line 99 of file cbo.hpp.

◆ bondbasketdata_

BondBasket bondbasketdata_
private

Definition at line 100 of file cbo.hpp.

◆ feeDayCounter_

std::string feeDayCounter_
private

Definition at line 101 of file cbo.hpp.

◆ seniorFee_

std::string seniorFee_
private

Definition at line 102 of file cbo.hpp.

◆ subordinatedFee_

std::string subordinatedFee_
private

Definition at line 103 of file cbo.hpp.

◆ equityKicker_

std::string equityKicker_
private

Definition at line 104 of file cbo.hpp.

◆ ccy_

std::string ccy_
private

Definition at line 105 of file cbo.hpp.

◆ reinvestmentEndDate_

std::string reinvestmentEndDate_
private

Definition at line 106 of file cbo.hpp.

◆ investedTrancheName_

std::string investedTrancheName_
private

Definition at line 107 of file cbo.hpp.

◆ trancheData_

std::vector<QuantLib::ext::shared_ptr<TrancheData> > trancheData_
private

Definition at line 108 of file cbo.hpp.

◆ scheduleData_

ScheduleData scheduleData_
private

Definition at line 109 of file cbo.hpp.

◆ daycounter_

std::string daycounter_
private

Definition at line 110 of file cbo.hpp.

◆ paymentConvention_

std::string paymentConvention_
private

Definition at line 111 of file cbo.hpp.

◆ investedNotional_

double investedNotional_
private

Definition at line 112 of file cbo.hpp.

◆ structureId_

std::string structureId_
private

Definition at line 113 of file cbo.hpp.

◆ multiplier_

double multiplier_
private

Definition at line 114 of file cbo.hpp.