QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
Loading...
Searching...
No Matches
BondHelper Class Reference

Bond helper for curve bootstrap. More...

#include <ql/termstructures/yield/bondhelpers.hpp>

Inheritance diagram for BondHelper:

Public Member Functions

 BondHelper (const Handle< Quote > &price, const ext::shared_ptr< Bond > &bond, Bond::Price::Type priceType=Bond::Price::Clean)
RateHelper interface
Real impliedQuote () const override
void setTermStructure (YieldTermStructure *) override
 sets the term structure to be used for pricing
Additional inspectors
ext::shared_ptr< Bondbond () const
Bond::Price::Type priceType () const
Public Member Functions inherited from BootstrapHelper< YieldTermStructure >
 BootstrapHelper (const std::variant< Spread, Handle< Quote > > &quote)
const Handle< Quote > & quote () const
Real quoteError () const
virtual Date earliestDate () const
 earliest relevant date
virtual Date maturityDate () const
 instrument's maturity date
virtual Date latestRelevantDate () const
 latest relevant date
virtual Date pillarDate () const
 pillar date
virtual Date latestDate () const
 latest date
void update () override
Public Member Functions inherited from Observer
 Observer (const Observer &)
Observeroperator= (const Observer &)
std::pair< iterator, bool > registerWith (const ext::shared_ptr< Observable > &)
void registerWithObservables (const ext::shared_ptr< Observer > &)
Size unregisterWith (const ext::shared_ptr< Observable > &)
void unregisterWithAll ()
virtual void deepUpdate ()
Public Member Functions inherited from Observable
 Observable (const Observable &)
Observableoperator= (const Observable &)
 Observable (Observable &&)=delete
Observableoperator= (Observable &&)=delete
void notifyObservers ()

Visitability

ext::shared_ptr< Bondbond_
RelinkableHandle< YieldTermStructuretermStructureHandle_
Bond::Price::Type priceType_
void accept (AcyclicVisitor &) override

Additional Inherited Members

Public Types inherited from Observer
typedef set_type::iterator iterator
Handle< Quotequote_
YieldTermStructuretermStructure_
Date earliestDate_
Date latestDate_
Date maturityDate_
Date latestRelevantDate_
Date pillarDate_

Detailed Description

Bond helper for curve bootstrap.

Warning
This class assumes that the reference date does not change between calls of setTermStructure().

Constructor & Destructor Documentation

◆ BondHelper()

BondHelper ( const Handle< Quote > & price,
const ext::shared_ptr< Bond > & bond,
Bond::Price::Type priceType = Bond::Price::Clean )
Warning
Setting a pricing engine to the passed bond from external code will cause the bootstrap to fail or to give wrong results. It is advised to discard the bond after creating the helper, so that the helper has sole ownership of it.

Member Function Documentation

◆ impliedQuote()

Real impliedQuote ( ) const
overridevirtual

◆ setTermStructure()

void setTermStructure ( YieldTermStructure * )
overridevirtual

sets the term structure to be used for pricing

Warning
Being a pointer and not a shared_ptr, the term structure is not guaranteed to remain allocated for the whole life of the rate helper. It is responsibility of the programmer to ensure that the pointer remains valid. It is advised that this method is called only inside the term structure being bootstrapped, setting the pointer to this, i.e., the term structure itself.

Reimplemented from BootstrapHelper< YieldTermStructure >.

◆ accept()

void accept ( AcyclicVisitor & )
overridevirtual