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

Base class for CDS helpers. More...

#include <ql/termstructures/credit/defaultprobabilityhelpers.hpp>

Inheritance diagram for CdsHelper:

Public Member Functions

 CdsHelper (const std::variant< Rate, Handle< Quote > > &quote, const Period &tenor, Integer settlementDays, Calendar calendar, Frequency frequency, BusinessDayConvention paymentConvention, DateGeneration::Rule rule, DayCounter dayCounter, Real recoveryRate, const Handle< YieldTermStructure > &discountCurve, bool settlesAccrual=true, bool paysAtDefaultTime=true, const Date &startDate=Date(), DayCounter lastPeriodDayCounter=DayCounter(), bool rebatesAccrual=true, CreditDefaultSwap::PricingModel model=CreditDefaultSwap::Midpoint)
void setTermStructure (DefaultProbabilityTermStructure *) override
 sets the term structure to be used for pricing
ext::shared_ptr< CreditDefaultSwapswap () const
void update () override
Public Member Functions inherited from RelativeDateBootstrapHelper< DefaultProbabilityTermStructure >
 RelativeDateBootstrapHelper (const std::variant< Spread, Handle< Quote > > &quote, bool updateDates=true)
void update () override
Public Member Functions inherited from BootstrapHelper< DefaultProbabilityTermStructure >
 BootstrapHelper (const std::variant< Spread, Handle< Quote > > &quote)
const Handle< Quote > & quote () const
virtual Real impliedQuote () const=0
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
virtual void accept (AcyclicVisitor &)
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 ()

Protected Member Functions

void initializeDates () override
virtual void resetEngine ()=0

Protected Attributes

Period tenor_
Integer settlementDays_
Calendar calendar_
Frequency frequency_
BusinessDayConvention paymentConvention_
DateGeneration::Rule rule_
DayCounter dayCounter_
Real recoveryRate_
Handle< YieldTermStructurediscountCurve_
bool settlesAccrual_
bool paysAtDefaultTime_
DayCounter lastPeriodDC_
bool rebatesAccrual_
CreditDefaultSwap::PricingModel model_
Schedule schedule_
ext::shared_ptr< CreditDefaultSwapswap_
RelinkableHandle< DefaultProbabilityTermStructureprobability_
Date protectionStart_
 protection effective date.
Date startDate_
Date evaluationDate_
bool updateDates_
Handle< Quotequote_
DefaultProbabilityTermStructuretermStructure_
Date earliestDate_
Date latestDate_
Date maturityDate_
Date latestRelevantDate_
Date pillarDate_

Additional Inherited Members

Public Types inherited from Observer
typedef set_type::iterator iterator

Detailed Description

Base class for CDS helpers.

Constructor & Destructor Documentation

◆ CdsHelper()

CdsHelper ( const std::variant< Rate, Handle< Quote > > & quote,
const Period & tenor,
Integer settlementDays,
Calendar calendar,
Frequency frequency,
BusinessDayConvention paymentConvention,
DateGeneration::Rule rule,
DayCounter dayCounter,
Real recoveryRate,
const Handle< YieldTermStructure > & discountCurve,
bool settlesAccrual = true,
bool paysAtDefaultTime = true,
const Date & startDate = Date(),
DayCounter lastPeriodDayCounter = DayCounter(),
bool rebatesAccrual = true,
CreditDefaultSwap::PricingModel model = CreditDefaultSwap::Midpoint )

Constructor taking CDS market quote

Parameters
quoteThe helper's market quote.
tenorCDS tenor.
settlementDaysThe number of days from evaluation date to the start of the protection period. Prior to the CDS Big Bang in 2009, this was typically 1 calendar day. After the CDS Big Bang, this is typically 0 calendar days i.e. protection starts immediately.
calendarCDS calendar. Typically weekends only for standard non-JPY CDS and TYO for JPY.
frequencyCoupon frequency. Typically 3 months for standard CDS.
paymentConventionThe convention applied to coupons schedules and settlement dates.
ruleThe date generation rule for generating the CDS schedule. Typically, for CDS prior to the Big Bang, OldCDS should be used. After the Big Bang, CDS was typical and since 2015 CDS2015 is standard.
dayCounterThe day counter for CDS fee leg coupons. Typically it is Actual/360, excluding accrual end, for all but the final coupon period with Actual/360, including accrual end, for the final coupon. The lastPeriodDayCounter below allows for this distinction.
recoveryRateThe recovery rate of the underlying reference entity.
discountCurveA handle to the relevant discount curve.
settlesAccrualSet to true if accrued fee is paid on the occurrence of a credit event and set to false if it is not. Typically this is true.
paysAtDefaultTimeSet to true if default payment is made at time of credit event or postponed to the end of the coupon period. Typically this is true.
startDateUsed to specify an explicit start date for the CDS schedule and the date from which the CDS maturity is calculated via the tenor. Useful for off-the-run index schedules.
lastPeriodDayCounterThe day counter for the last fee leg coupon. See comment on dayCounter.
rebatesAccrualSet to true if the fee leg accrual is rebated on the cash settlement date. For CDS after the Big Bang, this is typically true.
modelThe pricing model to use for the helper.

Member Function Documentation

◆ setTermStructure()

void setTermStructure ( DefaultProbabilityTermStructure * )
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< DefaultProbabilityTermStructure >.

◆ update()

void update ( )
overridevirtual

This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.

Reimplemented from BootstrapHelper< DefaultProbabilityTermStructure >.

◆ initializeDates()

void initializeDates ( )
overrideprotectedvirtual