Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
MakeCreditDefaultSwap Class Reference

helper class More...

#include <qle/instruments/makecds.hpp>

+ Collaboration diagram for MakeCreditDefaultSwap:

Public Member Functions

 MakeCreditDefaultSwap (const Period &tenor, const Real couponRate)
 
 MakeCreditDefaultSwap (const Date &termDate, const Real couponRate)
 
 operator CreditDefaultSwap () const
 
 operator QuantLib::ext::shared_ptr< CreditDefaultSwap > () const
 
MakeCreditDefaultSwapwithUpfrontRate (Real)
 
MakeCreditDefaultSwapwithSide (Protection::Side)
 
MakeCreditDefaultSwapwithNominal (Real)
 
MakeCreditDefaultSwapwithCouponTenor (Period)
 
MakeCreditDefaultSwapwithDayCounter (const DayCounter &)
 
MakeCreditDefaultSwapwithLastPeriodDayCounter (const DayCounter &)
 
MakeCreditDefaultSwapwithDateGenerationRule (DateGeneration::Rule rule)
 
MakeCreditDefaultSwapwithCashSettlementDays (Natural cashSettlementDays)
 
MakeCreditDefaultSwapwithPricingEngine (const QuantLib::ext::shared_ptr< PricingEngine > &)
 
MakeCreditDefaultSwapwithSettlesAccrual (bool)
 
MakeCreditDefaultSwapwithPaysAtDefaultTime (bool)
 
MakeCreditDefaultSwapwithRebatesAccrual (bool)
 

Private Attributes

Protection::Side side_
 
Real nominal_
 
boost::optional< Period > tenor_
 
boost::optional< Date > termDate_
 
Period couponTenor_
 
Real couponRate_
 
Real upfrontRate_
 
DayCounter dayCounter_
 
DayCounter lastPeriodDayCounter_
 
DateGeneration::Rule rule_
 
Natural cashSettlementDays_
 
bool settlesAccrual_
 
bool paysAtDefaultTime_
 
bool rebatesAccrual_
 
QuantLib::ext::shared_ptr< PricingEngine > engine_
 

Detailed Description

helper class

This class provides a more comfortable way to instantiate standard cds.

Bug:
support last period dc

Definition at line 57 of file makecds.hpp.

Constructor & Destructor Documentation

◆ MakeCreditDefaultSwap() [1/2]

MakeCreditDefaultSwap ( const Period &  tenor,
const Real  couponRate 
)

Definition at line 45 of file makecds.cpp.

46 : side_(Protection::Buyer), nominal_(1.0), tenor_(tenor), termDate_(boost::none), couponTenor_(3 * Months),
47 couponRate_(couponRate), upfrontRate_(0.0),
48 dayCounter_(Actual360()), lastPeriodDayCounter_(Actual360(true)),
49 rule_(DateGeneration::CDS2015), cashSettlementDays_(3), settlesAccrual_(true),
DateGeneration::Rule rule_
Definition: makecds.hpp:88
boost::optional< Date > termDate_
Definition: makecds.hpp:82
boost::optional< Period > tenor_
Definition: makecds.hpp:81

◆ MakeCreditDefaultSwap() [2/2]

MakeCreditDefaultSwap ( const Date &  termDate,
const Real  couponRate 
)

Definition at line 52 of file makecds.cpp.

53 : side_(Protection::Buyer), nominal_(1.0), tenor_(boost::none), termDate_(termDate), couponTenor_(3 * Months),
54 couponRate_(couponRate), upfrontRate_(0.0),
55 dayCounter_(Actual360()), lastPeriodDayCounter_(Actual360(true)),
56 rule_(DateGeneration::CDS2015), cashSettlementDays_(3), settlesAccrual_(true),

Member Function Documentation

◆ operator CreditDefaultSwap()

operator CreditDefaultSwap ( ) const

Definition at line 59 of file makecds.cpp.

59 {
60 QuantLib::ext::shared_ptr<CreditDefaultSwap> swap = *this;
61 return *swap;
62}

◆ operator QuantLib::ext::shared_ptr< CreditDefaultSwap >()

operator QuantLib::ext::shared_ptr< CreditDefaultSwap > ( ) const

◆ withUpfrontRate()

MakeCreditDefaultSwap & withUpfrontRate ( Real  upfrontRate)

Definition at line 101 of file makecds.cpp.

101 {
102 upfrontRate_ = upfrontRate;
103 return *this;
104}

◆ withSide()

MakeCreditDefaultSwap & withSide ( Protection::Side  side)

Definition at line 106 of file makecds.cpp.

106 {
107 side_ = side;
108 return *this;
109}

◆ withNominal()

MakeCreditDefaultSwap & withNominal ( Real  nominal)

Definition at line 111 of file makecds.cpp.

111 {
112 nominal_ = nominal;
113 return *this;
114}

◆ withCouponTenor()

MakeCreditDefaultSwap & withCouponTenor ( Period  couponTenor)

Definition at line 116 of file makecds.cpp.

116 {
117 couponTenor_ = couponTenor;
118 return *this;
119}

◆ withDayCounter()

MakeCreditDefaultSwap & withDayCounter ( const DayCounter &  dayCounter)

Definition at line 121 of file makecds.cpp.

121 {
122 dayCounter_ = dayCounter;
123 return *this;
124}

◆ withLastPeriodDayCounter()

MakeCreditDefaultSwap & withLastPeriodDayCounter ( const DayCounter &  lastPeriodDayCounter)

Definition at line 126 of file makecds.cpp.

126 {
127 lastPeriodDayCounter_ = lastPeriodDayCounter;
128 return *this;
129}

◆ withDateGenerationRule()

MakeCreditDefaultSwap & withDateGenerationRule ( DateGeneration::Rule  rule)

Definition at line 131 of file makecds.cpp.

131 {
132 rule_ = rule;
133 return *this;
134}

◆ withCashSettlementDays()

MakeCreditDefaultSwap & withCashSettlementDays ( Natural  cashSettlementDays)

Definition at line 136 of file makecds.cpp.

136 {
137 cashSettlementDays_ = cashSettlementDays;
138 return *this;
139}

◆ withPricingEngine()

MakeCreditDefaultSwap & withPricingEngine ( const QuantLib::ext::shared_ptr< PricingEngine > &  engine)

Definition at line 141 of file makecds.cpp.

141 {
142 engine_ = engine;
143 return *this;
144}
QuantLib::ext::shared_ptr< PricingEngine > engine_
Definition: makecds.hpp:93

◆ withSettlesAccrual()

MakeCreditDefaultSwap & withSettlesAccrual ( bool  settlesAccrual)

Definition at line 146 of file makecds.cpp.

146 {
147 settlesAccrual_ = settlesAccrual;
148 return *this;
149}

◆ withPaysAtDefaultTime()

MakeCreditDefaultSwap & withPaysAtDefaultTime ( bool  paysAtDefaultTime)

Definition at line 151 of file makecds.cpp.

151 {
152 paysAtDefaultTime_ = paysAtDefaultTime;
153 return *this;
154}

◆ withRebatesAccrual()

MakeCreditDefaultSwap & withRebatesAccrual ( bool  rebatesAccrual)

Definition at line 156 of file makecds.cpp.

156 {
157 rebatesAccrual_ = rebatesAccrual;
158 return *this;
159}

Member Data Documentation

◆ side_

Protection::Side side_
private

Definition at line 79 of file makecds.hpp.

◆ nominal_

Real nominal_
private

Definition at line 80 of file makecds.hpp.

◆ tenor_

boost::optional<Period> tenor_
private

Definition at line 81 of file makecds.hpp.

◆ termDate_

boost::optional<Date> termDate_
private

Definition at line 82 of file makecds.hpp.

◆ couponTenor_

Period couponTenor_
private

Definition at line 83 of file makecds.hpp.

◆ couponRate_

Real couponRate_
private

Definition at line 84 of file makecds.hpp.

◆ upfrontRate_

Real upfrontRate_
private

Definition at line 85 of file makecds.hpp.

◆ dayCounter_

DayCounter dayCounter_
private

Definition at line 86 of file makecds.hpp.

◆ lastPeriodDayCounter_

DayCounter lastPeriodDayCounter_
private

Definition at line 87 of file makecds.hpp.

◆ rule_

DateGeneration::Rule rule_
private

Definition at line 88 of file makecds.hpp.

◆ cashSettlementDays_

Natural cashSettlementDays_
private

Definition at line 89 of file makecds.hpp.

◆ settlesAccrual_

bool settlesAccrual_
private

Definition at line 90 of file makecds.hpp.

◆ paysAtDefaultTime_

bool paysAtDefaultTime_
private

Definition at line 91 of file makecds.hpp.

◆ rebatesAccrual_

bool rebatesAccrual_
private

Definition at line 92 of file makecds.hpp.

◆ engine_

QuantLib::ext::shared_ptr<PricingEngine> engine_
private

Definition at line 93 of file makecds.hpp.