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

#include <isdacdsengine.hpp>

+ Inheritance diagram for IsdaCdsEngine:
+ Collaboration diagram for IsdaCdsEngine:

Public Types

enum  NumericalFix { None , Taylor }
 
enum  AccrualBias { HalfDayBias , NoBias }
 
enum  ForwardsInCouponPeriod { Flat , Piecewise }
 
- Public Types inherited from Observer
typedef set_type::iterator iterator
 

Public Member Functions

 IsdaCdsEngine (Handle< DefaultProbabilityTermStructure > probability, Real recoveryRate, Handle< YieldTermStructure > discountCurve, const ext::optional< bool > &includeSettlementDateFlows=ext::nullopt, NumericalFix numericalFix=Taylor, AccrualBias accrualBias=HalfDayBias, ForwardsInCouponPeriod forwardsInCouponPeriod=Piecewise)
 
Handle< YieldTermStructureisdaRateCurve () const
 
Handle< DefaultProbabilityTermStructureisdaCreditCurve () const
 
void calculate () const override
 
- Public Member Functions inherited from GenericEngine< CreditDefaultSwap::arguments, CreditDefaultSwap::results >
PricingEngine::argumentsgetArguments () const override
 
const PricingEngine::resultsgetResults () const override
 
void reset () override
 
void update () override
 
- Public Member Functions inherited from PricingEngine
 ~PricingEngine () override=default
 
virtual argumentsgetArguments () const =0
 
virtual const resultsgetResults () const =0
 
virtual void reset ()=0
 
virtual void calculate () const =0
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- 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 ()
 

Private Attributes

Handle< DefaultProbabilityTermStructureprobability_
 
const Real recoveryRate_
 
Handle< YieldTermStructurediscountCurve_
 
const ext::optional< boolincludeSettlementDateFlows_
 
const NumericalFix numericalFix_
 
const AccrualBias accrualBias_
 
const ForwardsInCouponPeriod forwardsInCouponPeriod_
 

Additional Inherited Members

- Protected Attributes inherited from GenericEngine< CreditDefaultSwap::arguments, CreditDefaultSwap::results >
CreditDefaultSwap::arguments arguments_
 
CreditDefaultSwap::results results_
 

Detailed Description

References:

[1] The Pricing and Risk Management of Credit Default Swaps, with a Focus on the ISDA Model, OpenGamma Quantitative Research, Version as of 15-Oct-2013

[2] ISDA CDS Standard Model Proposed Numerical Fix \ Thursday, November 15, 2012, Markit

[3] Markit Interest Rate Curve XML Specifications, Version 1.16, Tuesday, 15 October 2013

Definition at line 49 of file isdacdsengine.hpp.

Member Enumeration Documentation

◆ NumericalFix

According to [1] the settings for the flags AccrualBias / ForwardsInCouponPeriod corresponding to the standard model implementation C code are

prior 1.8.2 HalfDayBias / Flat 1.8.2 NoBias / Flat

The theoretical correct setting would be NoBias / Piecewise

Todo: Clarify in which version of the standard model implementation C code the numerical problem of zero denominators is solved and how exactly.

Enumerator
None 
Taylor 

Definition at line 66 of file isdacdsengine.hpp.

◆ AccrualBias

Enumerator
HalfDayBias 
NoBias 

Definition at line 73 of file isdacdsengine.hpp.

◆ ForwardsInCouponPeriod

Enumerator
Flat 
Piecewise 

Definition at line 79 of file isdacdsengine.hpp.

Constructor & Destructor Documentation

◆ IsdaCdsEngine()

IsdaCdsEngine ( Handle< DefaultProbabilityTermStructure probability,
Real  recoveryRate,
Handle< YieldTermStructure discountCurve,
const ext::optional< bool > &  includeSettlementDateFlows = ext::nullopt,
NumericalFix  numericalFix = Taylor,
AccrualBias  accrualBias = HalfDayBias,
ForwardsInCouponPeriod  forwardsInCouponPeriod = Piecewise 
)

Constructor where the client code is responsible for providing a default curve and an interest rate curve compliant with the ISDA specifications.

To be precisely consistent with the ISDA specification bool IborCoupon::Settings::usingAtParCoupons(); must be true. This is not checked in order not to kill the engine completely in this case.

Furthermore, the ibor index in the swap rate helpers should not provide the evaluation date's fixing.

Definition at line 36 of file isdacdsengine.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ isdaRateCurve()

Handle< YieldTermStructure > isdaRateCurve ( ) const

Definition at line 106 of file isdacdsengine.hpp.

◆ isdaCreditCurve()

Handle< DefaultProbabilityTermStructure > isdaCreditCurve ( ) const

Definition at line 107 of file isdacdsengine.hpp.

◆ calculate()

void calculate ( ) const
overridevirtual

Implements PricingEngine.

Definition at line 52 of file isdacdsengine.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ probability_

Handle<DefaultProbabilityTermStructure> probability_
private

Definition at line 112 of file isdacdsengine.hpp.

◆ recoveryRate_

const Real recoveryRate_
private

Definition at line 113 of file isdacdsengine.hpp.

◆ discountCurve_

Handle<YieldTermStructure> discountCurve_
private

Definition at line 114 of file isdacdsengine.hpp.

◆ includeSettlementDateFlows_

const ext::optional<bool> includeSettlementDateFlows_
private

Definition at line 115 of file isdacdsengine.hpp.

◆ numericalFix_

const NumericalFix numericalFix_
private

Definition at line 116 of file isdacdsengine.hpp.

◆ accrualBias_

const AccrualBias accrualBias_
private

Definition at line 117 of file isdacdsengine.hpp.

◆ forwardsInCouponPeriod_

const ForwardsInCouponPeriod forwardsInCouponPeriod_
private

Definition at line 118 of file isdacdsengine.hpp.