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

Rate helper for bootstrapping over swap rates. More...

#include <ratehelpers.hpp>

+ Inheritance diagram for SwapRateHelper:
+ Collaboration diagram for SwapRateHelper:

Public Member Functions

 SwapRateHelper (const std::variant< Rate, Handle< Quote > > &rate, const ext::shared_ptr< SwapIndex > &swapIndex, Handle< Quote > spread={}, const Period &fwdStart=0 *Days, Handle< YieldTermStructure > discountingCurve={}, Pillar::Choice pillar=Pillar::LastRelevantDate, Date customPillarDate=Date(), bool endOfMonth=false, const ext::optional< bool > &useIndexedCoupons=ext::nullopt)
 
 SwapRateHelper (const std::variant< Rate, Handle< Quote > > &rate, const Period &tenor, Calendar calendar, Frequency fixedFrequency, BusinessDayConvention fixedConvention, DayCounter fixedDayCount, const ext::shared_ptr< IborIndex > &iborIndex, Handle< Quote > spread={}, const Period &fwdStart=0 *Days, Handle< YieldTermStructure > discountingCurve={}, Natural settlementDays=Null< Natural >(), Pillar::Choice pillar=Pillar::LastRelevantDate, Date customPillarDate=Date(), bool endOfMonth=false, const ext::optional< bool > &useIndexedCoupons=ext::nullopt)
 
 SwapRateHelper (const std::variant< Rate, Handle< Quote > > &rate, const Date &startDate, const Date &endDate, Calendar calendar, Frequency fixedFrequency, BusinessDayConvention fixedConvention, DayCounter fixedDayCount, const ext::shared_ptr< IborIndex > &iborIndex, Handle< Quote > spread={}, Handle< YieldTermStructure > discountingCurve={}, Pillar::Choice pillar=Pillar::LastRelevantDate, Date customPillarDate=Date(), bool endOfMonth=false, const ext::optional< bool > &useIndexedCoupons=ext::nullopt)
 
RateHelper interface
Real impliedQuote () const override
 
void setTermStructure (YieldTermStructure *) override
 
SwapRateHelper inspectors
Spread spread () const
 
ext::shared_ptr< VanillaSwapswap () const
 
const PeriodforwardStart () const
 
- Public Member Functions inherited from RelativeDateBootstrapHelper< TS >
 RelativeDateBootstrapHelper (const std::variant< Spread, Handle< Quote > > &quote, bool updateDates=true)
 
void update () override
 
- Public Member Functions inherited from BootstrapHelper< TS >
 BootstrapHelper (const std::variant< Spread, Handle< Quote > > &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...
 
- 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 ()=default
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 

Visitability

Natural settlementDays_
 
Period tenor_
 
Date startDate_
 
Date endDate_
 
Pillar::Choice pillarChoice_
 
Calendar calendar_
 
BusinessDayConvention fixedConvention_
 
Frequency fixedFrequency_
 
DayCounter fixedDayCount_
 
ext::shared_ptr< IborIndexiborIndex_
 
ext::shared_ptr< VanillaSwapswap_
 
RelinkableHandle< YieldTermStructuretermStructureHandle_
 
Handle< Quotespread_
 
bool endOfMonth_
 
Period fwdStart_
 
Handle< YieldTermStructurediscountHandle_
 
RelinkableHandle< YieldTermStructurediscountRelinkableHandle_
 
ext::optional< booluseIndexedCoupons_
 
void accept (AcyclicVisitor &) override
 
void initialize (const ext::shared_ptr< IborIndex > &iborIndex, Date customPillarDate)
 
void initializeDates () override
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Member Functions inherited from RelativeDateBootstrapHelper< TS >
- Protected Attributes inherited from RelativeDateBootstrapHelper< TS >
Date evaluationDate_
 
bool updateDates_
 
- Protected Attributes inherited from BootstrapHelper< TS >
Handle< Quotequote_
 
TS * termStructure_
 
Date earliestDate_
 
Date latestDate_
 
Date maturityDate_
 
Date latestRelevantDate_
 
Date pillarDate_
 

Detailed Description

Rate helper for bootstrapping over swap rates.

Definition at line 198 of file ratehelpers.hpp.

Constructor & Destructor Documentation

◆ SwapRateHelper() [1/3]

SwapRateHelper ( const std::variant< Rate, Handle< Quote > > &  rate,
const ext::shared_ptr< SwapIndex > &  swapIndex,
Handle< Quote spread = {},
const Period fwdStart = 0 * Days,
Handle< YieldTermStructure discountingCurve = {},
Pillar::Choice  pillar = Pillar::LastRelevantDate,
Date  customPillarDate = Date(),
bool  endOfMonth = false,
const ext::optional< bool > &  useIndexedCoupons = ext::nullopt 
)

Definition at line 461 of file ratehelpers.cpp.

◆ SwapRateHelper() [2/3]

SwapRateHelper ( const std::variant< Rate, Handle< Quote > > &  rate,
const Period tenor,
Calendar  calendar,
Frequency  fixedFrequency,
BusinessDayConvention  fixedConvention,
DayCounter  fixedDayCount,
const ext::shared_ptr< IborIndex > &  iborIndex,
Handle< Quote spread = {},
const Period fwdStart = 0 * Days,
Handle< YieldTermStructure discountingCurve = {},
Natural  settlementDays = Null<Natural>(),
Pillar::Choice  pillar = Pillar::LastRelevantDate,
Date  customPillarDate = Date(),
bool  endOfMonth = false,
const ext::optional< bool > &  useIndexedCoupons = ext::nullopt 
)

Definition at line 476 of file ratehelpers.cpp.

+ Here is the call graph for this function:

◆ SwapRateHelper() [3/3]

SwapRateHelper ( const std::variant< Rate, Handle< Quote > > &  rate,
const Date startDate,
const Date endDate,
Calendar  calendar,
Frequency  fixedFrequency,
BusinessDayConvention  fixedConvention,
DayCounter  fixedDayCount,
const ext::shared_ptr< IborIndex > &  iborIndex,
Handle< Quote spread = {},
Handle< YieldTermStructure discountingCurve = {},
Pillar::Choice  pillar = Pillar::LastRelevantDate,
Date  customPillarDate = Date(),
bool  endOfMonth = false,
const ext::optional< bool > &  useIndexedCoupons = ext::nullopt 
)

Definition at line 500 of file ratehelpers.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ impliedQuote()

Real impliedQuote ( ) const
overridevirtual

Implements BootstrapHelper< TS >.

Definition at line 614 of file ratehelpers.cpp.

+ Here is the call graph for this function:

◆ setTermStructure()

void setTermStructure ( YieldTermStructure t)
override

Definition at line 598 of file ratehelpers.cpp.

+ Here is the call graph for this function:

◆ spread()

Spread spread ( ) const

Definition at line 413 of file ratehelpers.hpp.

+ Here is the caller graph for this function:

◆ swap()

ext::shared_ptr< VanillaSwap > swap ( ) const

Definition at line 418 of file ratehelpers.hpp.

◆ forwardStart()

const Period & forwardStart ( ) const

Definition at line 422 of file ratehelpers.hpp.

◆ accept()

void accept ( AcyclicVisitor v)
overridevirtual

Reimplemented from BootstrapHelper< TS >.

Definition at line 628 of file ratehelpers.cpp.

+ Here is the call graph for this function:

◆ initialize()

void initialize ( const ext::shared_ptr< IborIndex > &  iborIndex,
Date  customPillarDate 
)
protected

Definition at line 525 of file ratehelpers.cpp.

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

◆ initializeDates()

void initializeDates ( )
overrideprotectedvirtual

Implements RelativeDateBootstrapHelper< TS >.

Definition at line 542 of file ratehelpers.cpp.

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

Member Data Documentation

◆ settlementDays_

Natural settlementDays_
protected

Definition at line 265 of file ratehelpers.hpp.

◆ tenor_

Period tenor_
protected

Definition at line 266 of file ratehelpers.hpp.

◆ startDate_

Date startDate_
protected

Definition at line 267 of file ratehelpers.hpp.

◆ endDate_

Date endDate_
protected

Definition at line 267 of file ratehelpers.hpp.

◆ pillarChoice_

Pillar::Choice pillarChoice_
protected

Definition at line 268 of file ratehelpers.hpp.

◆ calendar_

Calendar calendar_
protected

Definition at line 269 of file ratehelpers.hpp.

◆ fixedConvention_

BusinessDayConvention fixedConvention_
protected

Definition at line 270 of file ratehelpers.hpp.

◆ fixedFrequency_

Frequency fixedFrequency_
protected

Definition at line 271 of file ratehelpers.hpp.

◆ fixedDayCount_

DayCounter fixedDayCount_
protected

Definition at line 272 of file ratehelpers.hpp.

◆ iborIndex_

ext::shared_ptr<IborIndex> iborIndex_
protected

Definition at line 273 of file ratehelpers.hpp.

◆ swap_

ext::shared_ptr<VanillaSwap> swap_
protected

Definition at line 274 of file ratehelpers.hpp.

◆ termStructureHandle_

RelinkableHandle<YieldTermStructure> termStructureHandle_
protected

Definition at line 275 of file ratehelpers.hpp.

◆ spread_

Handle<Quote> spread_
protected

Definition at line 276 of file ratehelpers.hpp.

◆ endOfMonth_

bool endOfMonth_
protected

Definition at line 277 of file ratehelpers.hpp.

◆ fwdStart_

Period fwdStart_
protected

Definition at line 278 of file ratehelpers.hpp.

◆ discountHandle_

Handle<YieldTermStructure> discountHandle_
protected

Definition at line 279 of file ratehelpers.hpp.

◆ discountRelinkableHandle_

RelinkableHandle<YieldTermStructure> discountRelinkableHandle_
protected

Definition at line 280 of file ratehelpers.hpp.

◆ useIndexedCoupons_

ext::optional<bool> useIndexedCoupons_
protected

Definition at line 281 of file ratehelpers.hpp.