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

#include <qle/termstructures/brlcdiratehelper.hpp>

+ Inheritance diagram for DatedBRLCdiRateHelper:
+ Collaboration diagram for DatedBRLCdiRateHelper:

Public Member Functions

 DatedBRLCdiRateHelper (const QuantLib::Date &startDate, const QuantLib::Date &endDate, const QuantLib::Handle< QuantLib::Quote > &fixedRate, const QuantLib::ext::shared_ptr< BRLCdi > &brlCdiIndex, const QuantLib::Handle< QuantLib::YieldTermStructure > &discountingCurve=QuantLib::Handle< QuantLib::YieldTermStructure >(), bool telescopicValueDates=false)
 
inspectors
QuantLib::ext::shared_ptr< BRLCdiSwapswap () const
 
RateHelper interface
QuantLib::Real impliedQuote () const override
 
void setTermStructure (QuantLib::YieldTermStructure *) override
 

Visitability

QuantLib::ext::shared_ptr< BRLCdibrlCdiIndex_
 
QuantLib::ext::shared_ptr< BRLCdiSwapswap_
 
bool telescopicValueDates_
 
QuantLib::RelinkableHandle< QuantLib::YieldTermStructure > termStructureHandle_
 
QuantLib::Handle< QuantLib::YieldTermStructure > discountHandle_
 
QuantLib::RelinkableHandle< QuantLib::YieldTermStructure > discountRelinkableHandle_
 
void accept (QuantLib::AcyclicVisitor &) override
 

Detailed Description

Absolute date based rate helper for bootstrapping using standard BRL CDI swaps

Definition at line 76 of file brlcdiratehelper.hpp.

Constructor & Destructor Documentation

◆ DatedBRLCdiRateHelper()

DatedBRLCdiRateHelper ( const QuantLib::Date &  startDate,
const QuantLib::Date &  endDate,
const QuantLib::Handle< QuantLib::Quote > &  fixedRate,
const QuantLib::ext::shared_ptr< BRLCdi > &  brlCdiIndex,
const QuantLib::Handle< QuantLib::YieldTermStructure > &  discountingCurve = QuantLib::Handle<QuantLib::YieldTermStructure>(),
bool  telescopicValueDates = false 
)

Definition at line 104 of file brlcdiratehelper.cpp.

108 : RateHelper(fixedRate), brlCdiIndex_(brlCdiIndex), telescopicValueDates_(telescopicValueDates),
109 discountHandle_(discountingCurve) {
110
111 bool onIndexHasCurve = !brlCdiIndex_->forwardingTermStructure().empty();
112 bool haveDiscountCurve = !discountHandle_.empty();
113 QL_REQUIRE(!(onIndexHasCurve && haveDiscountCurve), "Have both curves nothing to solve for.");
114
115 if (!onIndexHasCurve) {
116 QuantLib::ext::shared_ptr<IborIndex> clonedIborIndex(brlCdiIndex_->clone(termStructureHandle_));
117 brlCdiIndex_ = QuantLib::ext::dynamic_pointer_cast<BRLCdi>(clonedIborIndex);
118 brlCdiIndex_->unregisterWith(termStructureHandle_);
119 }
120
121 registerWith(brlCdiIndex_);
122 registerWith(discountHandle_);
123
124 swap_ = QuantLib::ext::make_shared<BRLCdiSwap>(OvernightIndexedSwap::Payer, 1.0, startDate, endDate, 0.01, brlCdiIndex_,
126
127 // Set the pricing engine
128 swap_->setPricingEngine(QuantLib::ext::make_shared<DiscountingSwapEngine>(discountRelinkableHandle_));
129
130 // Update earliest and latest dates
131 earliestDate_ = swap_->startDate();
132 latestDate_ = swap_->maturityDate();
133}
QuantLib::RelinkableHandle< QuantLib::YieldTermStructure > discountRelinkableHandle_
QuantLib::ext::shared_ptr< BRLCdiSwap > swap_
QuantLib::RelinkableHandle< QuantLib::YieldTermStructure > termStructureHandle_
QuantLib::ext::shared_ptr< BRLCdi > brlCdiIndex_
QuantLib::Handle< QuantLib::YieldTermStructure > discountHandle_

Member Function Documentation

◆ swap()

QuantLib::ext::shared_ptr< BRLCdiSwap > swap ( ) const

Definition at line 87 of file brlcdiratehelper.hpp.

87{ return swap_; }

◆ impliedQuote()

Real impliedQuote ( ) const
override

Definition at line 149 of file brlcdiratehelper.cpp.

149 {
150 QL_REQUIRE(termStructure_ != 0, "DatedBRLCdiRateHelper's term structure not set");
151 swap_->deepUpdate();
152 return swap_->fairRate();
153}

◆ setTermStructure()

void setTermStructure ( QuantLib::YieldTermStructure *  t)
override

Definition at line 135 of file brlcdiratehelper.cpp.

135 {
136
137 bool observer = false;
138 QuantLib::ext::shared_ptr<YieldTermStructure> temp(t, null_deleter());
139 termStructureHandle_.linkTo(temp, observer);
140
141 if (discountHandle_.empty())
142 discountRelinkableHandle_.linkTo(temp, observer);
143 else
145
146 RateHelper::setTermStructure(t);
147}

◆ accept()

void accept ( QuantLib::AcyclicVisitor &  )
override

Definition at line 155 of file brlcdiratehelper.cpp.

155 {
156 if (Visitor<DatedBRLCdiRateHelper>* v1 = dynamic_cast<Visitor<DatedBRLCdiRateHelper>*>(&v))
157 v1->visit(*this);
158 else
159 RateHelper::accept(v);
160}

Member Data Documentation

◆ brlCdiIndex_

QuantLib::ext::shared_ptr<BRLCdi> brlCdiIndex_
protected

Definition at line 102 of file brlcdiratehelper.hpp.

◆ swap_

QuantLib::ext::shared_ptr<BRLCdiSwap> swap_
protected

Definition at line 103 of file brlcdiratehelper.hpp.

◆ telescopicValueDates_

bool telescopicValueDates_
protected

Definition at line 104 of file brlcdiratehelper.hpp.

◆ termStructureHandle_

QuantLib::RelinkableHandle<QuantLib::YieldTermStructure> termStructureHandle_
protected

Definition at line 106 of file brlcdiratehelper.hpp.

◆ discountHandle_

QuantLib::Handle<QuantLib::YieldTermStructure> discountHandle_
protected

Definition at line 107 of file brlcdiratehelper.hpp.

◆ discountRelinkableHandle_

QuantLib::RelinkableHandle<QuantLib::YieldTermStructure> discountRelinkableHandle_
protected

Definition at line 108 of file brlcdiratehelper.hpp.