Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Classes | List of all members
CBO Class Reference

#include <qle/instruments/cbo.hpp>

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

Classes

class  arguments
 
class  engine
 CBO base engine. More...
 
class  results
 

Public Member Functions

Constructors
 CBO (const QuantLib::ext::shared_ptr< BondBasket > &basket, const QuantLib::Schedule &schedule, Rate seniorFee, const DayCounter &feeDayCounter, const std::vector< Tranche > &tranches, Rate subordinatedFee, Rate equityKicker, const Currency &ccy, const std::string &investedTrancheName)
 
Inspectors
QuantLib::ext::shared_ptr< BondBasketbasket () const
 
Instrument interface
bool isExpired () const override
 
void setupArguments (PricingEngine::arguments *) const override
 
void fetchResults (const PricingEngine::results *) const override
 

Results

QuantLib::ext::shared_ptr< BondBasketbasket_
 
Schedule schedule_
 
Rate seniorFee_
 
DayCounter feeDayCounter_
 
std::vector< Tranchetranches_
 
Rate subordinatedFee_
 
Rate equityKicker_
 
Currency ccy_
 
std::string investedTrancheName_
 
Real basketValue_
 
std::vector< Real > trancheValue_
 
Real feeValue_
 
Real subfeeValue_
 
Real basketValueStd_
 
std::vector< Real > trancheValueStd_
 
Real feeValueStd_
 
Real subfeeValueStd_
 
std::vector< CashflowTabletrancheCashflows_
 
Real basketValue () const
 
std::vector< Real > trancheValue () const
 
Rate feeValue () const
 
Rate subfeeValue () const
 
Real basketValueStd () const
 
std::vector< Real > trancheValueStd () const
 
Rate feeValueStd () const
 
Rate subfeeValueStd () const
 
const std::vector< CashflowTable > & trancheCashflows () const
 
void setupExpired () const override
 

Detailed Description

Definition at line 51 of file cbo.hpp.

Constructor & Destructor Documentation

◆ CBO()

CBO ( const QuantLib::ext::shared_ptr< BondBasket > &  basket,
const QuantLib::Schedule &  schedule,
Rate  seniorFee,
const DayCounter &  feeDayCounter,
const std::vector< Tranche > &  tranches,
Rate  subordinatedFee,
Rate  equityKicker,
const Currency &  ccy,
const std::string &  investedTrancheName 
)
Parameters
basketUnderlying bond basket
scheduleCBO schedule
seniorFeeSenior fee rate to be paid before any cash flow goes to the tranches
feeDayCounterFee day counter
tranchesTranche description
subordinatedFeeSubordinated fee rate to be paid late in the waterfal
equityKickerEquity kicker
ccyCBOs currency
investedTrancheNameinvested trancheName

Definition at line 27 of file cbo.cpp.

31 : basket_(basket), schedule_(schedule), seniorFee_(seniorFee), feeDayCounter_(feeDayCounter),
32 tranches_(tranches), subordinatedFee_(subordinatedFee), equityKicker_(equityKicker), ccy_(ccy),
33 investedTrancheName_(investedTrancheName) {
34 QL_REQUIRE(basket->bonds().size() > 0, "basket is empty");
35 QL_REQUIRE(tranches.size() > 0, "no tranches specified");
36}
Rate seniorFee_
Definition: cbo.hpp:107
std::string investedTrancheName_
Definition: cbo.hpp:113
Schedule schedule_
Definition: cbo.hpp:106
QuantLib::ext::shared_ptr< BondBasket > basket_
Definition: cbo.hpp:105
QuantLib::ext::shared_ptr< BondBasket > basket() const
Definition: cbo.hpp:79
Currency ccy_
Definition: cbo.hpp:112
Rate subordinatedFee_
Definition: cbo.hpp:110
std::vector< Tranche > tranches_
Definition: cbo.hpp:109
DayCounter feeDayCounter_
Definition: cbo.hpp:108
Rate equityKicker_
Definition: cbo.hpp:111
+ Here is the call graph for this function:

Member Function Documentation

◆ basket()

QuantLib::ext::shared_ptr< BondBasket > basket ( ) const

Definition at line 79 of file cbo.hpp.

79{ return basket_; }
+ Here is the caller graph for this function:

◆ isExpired()

bool isExpired ( ) const
override

Definition at line 81 of file cbo.cpp.

81 {
82 if (schedule_.dates().back() <= Settings::instance().evaluationDate())
83 return true;
84 else
85 return false;
86}

◆ setupArguments()

void setupArguments ( PricingEngine::arguments *  args) const
override

Definition at line 88 of file cbo.cpp.

88 {
89 CBO::arguments* arguments = dynamic_cast<CBO::arguments*>(args);
90 QL_REQUIRE(arguments != 0, "wrong argument type");
91 arguments->basket = basket_;
92 arguments->schedule = schedule_;
93 arguments->seniorFee = seniorFee_;
94 arguments->feeDayCounter = feeDayCounter_;
95 arguments->tranches = tranches_;
96 arguments->equityKicker = equityKicker_;
97 arguments->subordinatedFee = subordinatedFee_;
98 arguments->ccy = ccy_;
99 arguments->investedTrancheName = investedTrancheName_;
100
101}

◆ fetchResults()

void fetchResults ( const PricingEngine::results *  r) const
override

Definition at line 103 of file cbo.cpp.

103 {
104 Instrument::fetchResults(r);
105
106 const CBO::results* results = dynamic_cast<const CBO::results*>(r);
107 QL_REQUIRE(results != 0, "wrong result type");
108
109 basketValue_ = results->basketValue;
110 trancheValue_ = results->trancheValue;
111 feeValue_ = results->feeValue;
112 basketValueStd_ = results->basketValueStd;
113 trancheValueStd_ = results->trancheValueStd;
114 feeValueStd_ = results->feeValueStd;
115 trancheCashflows_ = results->trancheCashflows;
116}
std::vector< Real > trancheValue_
Definition: cbo.hpp:116
Real basketValue_
Definition: cbo.hpp:115
Real feeValueStd_
Definition: cbo.hpp:121
Real basketValueStd_
Definition: cbo.hpp:119
std::vector< Real > trancheValueStd_
Definition: cbo.hpp:120
std::vector< CashflowTable > trancheCashflows_
Definition: cbo.hpp:123
Real feeValue_
Definition: cbo.hpp:117

◆ basketValue()

Real basketValue ( ) const

Definition at line 46 of file cbo.cpp.

46 {
47 calculate();
48 return basketValue_;
49}
+ Here is the caller graph for this function:

◆ trancheValue()

std::vector< Real > trancheValue ( ) const

Definition at line 51 of file cbo.cpp.

51 {
52 calculate();
53 return trancheValue_;
54}
+ Here is the caller graph for this function:

◆ feeValue()

Real feeValue ( ) const

Definition at line 56 of file cbo.cpp.

56 {
57 calculate();
58 return feeValue_;
59}
+ Here is the caller graph for this function:

◆ subfeeValue()

Rate subfeeValue ( ) const
+ Here is the caller graph for this function:

◆ basketValueStd()

Real basketValueStd ( ) const

Definition at line 61 of file cbo.cpp.

61 {
62 calculate();
63 return basketValueStd_;
64}
+ Here is the caller graph for this function:

◆ trancheValueStd()

std::vector< Real > trancheValueStd ( ) const

Definition at line 66 of file cbo.cpp.

66 {
67 calculate();
68 return trancheValueStd_;
69}
+ Here is the caller graph for this function:

◆ feeValueStd()

Real feeValueStd ( ) const

Definition at line 71 of file cbo.cpp.

71 {
72 calculate();
73 return feeValueStd_;
74}

◆ subfeeValueStd()

Rate subfeeValueStd ( ) const

◆ trancheCashflows()

const std::vector< CashflowTable > & trancheCashflows ( ) const

Definition at line 76 of file cbo.cpp.

76 {
77 calculate();
78 return trancheCashflows_;
79}
+ Here is the caller graph for this function:

◆ setupExpired()

void setupExpired ( ) const
overrideprivate

Definition at line 118 of file cbo.cpp.

118 {
119 Instrument::setupExpired();
120 basketValue_ = 0.0;
121 trancheValue_.clear();
122 feeValue_ = 0.0;
123
124 basketValueStd_ = 0.0;
125 trancheValueStd_.clear();
126 feeValueStd_ = 0.0;
127 trancheCashflows_.clear();
128}

Member Data Documentation

◆ basket_

QuantLib::ext::shared_ptr<BondBasket> basket_
private

Definition at line 105 of file cbo.hpp.

◆ schedule_

Schedule schedule_
private

Definition at line 106 of file cbo.hpp.

◆ seniorFee_

Rate seniorFee_
private

Definition at line 107 of file cbo.hpp.

◆ feeDayCounter_

DayCounter feeDayCounter_
private

Definition at line 108 of file cbo.hpp.

◆ tranches_

std::vector<Tranche> tranches_
private

Definition at line 109 of file cbo.hpp.

◆ subordinatedFee_

Rate subordinatedFee_
private

Definition at line 110 of file cbo.hpp.

◆ equityKicker_

Rate equityKicker_
private

Definition at line 111 of file cbo.hpp.

◆ ccy_

Currency ccy_
private

Definition at line 112 of file cbo.hpp.

◆ investedTrancheName_

std::string investedTrancheName_
private

Definition at line 113 of file cbo.hpp.

◆ basketValue_

Real basketValue_
mutableprivate

Definition at line 115 of file cbo.hpp.

◆ trancheValue_

std::vector<Real> trancheValue_
mutableprivate

Definition at line 116 of file cbo.hpp.

◆ feeValue_

Real feeValue_
mutableprivate

Definition at line 117 of file cbo.hpp.

◆ subfeeValue_

Real subfeeValue_
mutableprivate

Definition at line 118 of file cbo.hpp.

◆ basketValueStd_

Real basketValueStd_
mutableprivate

Definition at line 119 of file cbo.hpp.

◆ trancheValueStd_

std::vector<Real> trancheValueStd_
mutableprivate

Definition at line 120 of file cbo.hpp.

◆ feeValueStd_

Real feeValueStd_
mutableprivate

Definition at line 121 of file cbo.hpp.

◆ subfeeValueStd_

Real subfeeValueStd_
mutableprivate

Definition at line 122 of file cbo.hpp.

◆ trancheCashflows_

std::vector<CashflowTable> trancheCashflows_
mutableprivate

Definition at line 123 of file cbo.hpp.