QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | List of all members
BondHelper Class Reference

Bond helper for curve bootstrap. More...

#include <bondhelpers.hpp>

+ Inheritance diagram for BondHelper:
+ Collaboration 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
 
Additional inspectors
ext::shared_ptr< Bondbond () const
 
Bond::Price::Type priceType () const
 
- Public Member Functions inherited from BootstrapHelper< TS >
 BootstrapHelper (Handle< Quote > quote)
 
 BootstrapHelper (Real quote)
 
 ~BootstrapHelper () override=default
 
const Handle< Quote > & quote () const
 
Real quoteError () const
 
virtual void setTermStructure (TS *)
 sets the term structure to be used for pricing More...
 
virtual Date earliestDate () const
 earliest relevant date More...
 
virtual Date maturityDate () const
 instrument's maturity date More...
 
virtual Date latestRelevantDate () const
 latest relevant date More...
 
virtual Date pillarDate () const
 pillar date More...
 
virtual Date latestDate () const
 latest date More...
 
void update () override
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
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
 
- Protected Attributes inherited from BootstrapHelper< TS >
Handle< Quotequote_
 
TS * termStructure_
 
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().

Definition at line 40 of file bondhelpers.hpp.

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.

Definition at line 30 of file bondhelpers.cpp.

Member Function Documentation

◆ impliedQuote()

Real impliedQuote ( ) const
overridevirtual

Implements BootstrapHelper< TS >.

Definition at line 53 of file bondhelpers.cpp.

◆ setTermStructure()

void setTermStructure ( YieldTermStructure t)
override

Definition at line 44 of file bondhelpers.cpp.

+ Here is the call graph for this function:

◆ bond()

ext::shared_ptr< Bond > bond ( ) const

Definition at line 176 of file bondhelpers.hpp.

◆ priceType()

Bond::Price::Type priceType ( ) const

Definition at line 180 of file bondhelpers.hpp.

◆ accept()

void accept ( AcyclicVisitor v)
overridevirtual

Reimplemented from BootstrapHelper< TS >.

Reimplemented in FixedRateBondHelper, and CPIBondHelper.

Definition at line 72 of file bondhelpers.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ bond_

ext::shared_ptr<Bond> bond_
protected

Definition at line 68 of file bondhelpers.hpp.

◆ termStructureHandle_

RelinkableHandle<YieldTermStructure> termStructureHandle_
protected

Definition at line 69 of file bondhelpers.hpp.

◆ priceType_

Bond::Price::Type priceType_
protected

Definition at line 70 of file bondhelpers.hpp.