23#ifndef quantext_index_credit_default_swap_hpp
24#define quantext_index_credit_default_swap_hpp
26#include <ql/instruments/creditdefaultswap.hpp>
28#include <ql/cashflow.hpp>
29#include <ql/default.hpp>
30#include <ql/instrument.hpp>
31#include <ql/termstructures/defaulttermstructure.hpp>
32#include <ql/time/schedule.hpp>
35class YieldTermStructure;
49 const Schedule& schedule, BusinessDayConvention paymentConvention,
50 const DayCounter& dayCounter,
bool settlesAccrual =
true,
51 ProtectionPaymentTime protectionPaymentTime = atDefault,
52 const Date& protectionStart = Date(),
53 const QuantLib::ext::shared_ptr<Claim>& claim = QuantLib::ext::shared_ptr<Claim>(),
54 const DayCounter& lastPeriodDayCounter = DayCounter(),
55 bool rebatesAccrual =
true,
56 const Date& tradeDate = Date(),
57 Natural cashSettlementDays = 3)
58 :
QuantLib::CreditDefaultSwap(side, notional, spread, schedule, paymentConvention, dayCounter, settlesAccrual,
59 protectionPaymentTime, protectionStart, claim, lastPeriodDayCounter, rebatesAccrual,
60 tradeDate, cashSettlementDays),
64 Rate spread,
const Schedule& schedule, BusinessDayConvention paymentConvention,
65 const DayCounter& dayCounter,
bool settlesAccrual =
true,
66 ProtectionPaymentTime protectionPaymentTime = atDefault,
67 const Date& protectionStart = Date(),
const Date& upfrontDate = Date(),
68 const QuantLib::ext::shared_ptr<Claim>& claim = QuantLib::ext::shared_ptr<Claim>(),
69 const DayCounter& lastPeriodDayCounter = DayCounter(),
70 bool rebatesAccrual =
true,
71 const Date& tradeDate = Date(),
72 Natural cashSettlementDays = 3)
73 :
QuantLib::CreditDefaultSwap(side, notional, upfront, spread, schedule, paymentConvention, dayCounter, settlesAccrual,
74 protectionPaymentTime, protectionStart, upfrontDate, claim, lastPeriodDayCounter,
75 rebatesAccrual, tradeDate, cashSettlementDays),
94 virtual QuantLib::ext::shared_ptr<PricingEngine>
buildPricingEngine(
const Handle<DefaultProbabilityTermStructure>& p,
95 Real r,
const Handle<YieldTermStructure>& d,
96 PricingModel model = Midpoint)
const override;
108 :
public GenericEngine<IndexCreditDefaultSwap::arguments, IndexCreditDefaultSwap::results> {};
std::vector< Real > underlyingNotionals
const std::vector< Real > & underlyingNotionals() const
IndexCreditDefaultSwap(Protection::Side side, Real notional, std::vector< Real > underlyingNotionals, Rate upfront, Rate spread, const Schedule &schedule, BusinessDayConvention paymentConvention, const DayCounter &dayCounter, bool settlesAccrual=true, ProtectionPaymentTime protectionPaymentTime=atDefault, const Date &protectionStart=Date(), const Date &upfrontDate=Date(), const QuantLib::ext::shared_ptr< Claim > &claim=QuantLib::ext::shared_ptr< Claim >(), const DayCounter &lastPeriodDayCounter=DayCounter(), bool rebatesAccrual=true, const Date &tradeDate=Date(), Natural cashSettlementDays=3)
void setupArguments(PricingEngine::arguments *) const override
std::vector< Real > underlyingNotionals_
virtual QuantLib::ext::shared_ptr< PricingEngine > buildPricingEngine(const Handle< DefaultProbabilityTermStructure > &p, Real r, const Handle< YieldTermStructure > &d, PricingModel model=Midpoint) const override
IndexCreditDefaultSwap(Protection::Side side, Real notional, std::vector< Real > underlyingNotionals, Rate spread, const Schedule &schedule, BusinessDayConvention paymentConvention, const DayCounter &dayCounter, bool settlesAccrual=true, ProtectionPaymentTime protectionPaymentTime=atDefault, const Date &protectionStart=Date(), const QuantLib::ext::shared_ptr< Claim > &claim=QuantLib::ext::shared_ptr< Claim >(), const DayCounter &lastPeriodDayCounter=DayCounter(), bool rebatesAccrual=true, const Date &tradeDate=Date(), Natural cashSettlementDays=3)