26#ifndef quantlib_credit_default_swap_hpp
27#define quantlib_credit_default_swap_hpp
38 class YieldTermStructure;
107 const Date& protectionStart =
Date(),
108 ext::shared_ptr<Claim> = ext::shared_ptr<Claim>(),
160 const Date& protectionStart =
Date(),
162 ext::shared_ptr<Claim> = ext::shared_ptr<Claim>(),
179 ext::optional<Rate>
upfront()
const;
189 const ext::shared_ptr<SimpleCashFlow>&
accrualRebate()
const;
237 Real recoveryRate = 0.4,
238 Real accuracy = 1.0e-8,
341 void reset()
override;
346 CreditDefaultSwap::results> {};
ext::shared_ptr< Claim > claim
ext::shared_ptr< SimpleCashFlow > accrualRebate
ext::optional< Rate > upfront
ext::shared_ptr< SimpleCashFlow > upfrontPayment
void validate() const override
Natural cashSettlementDays() const
const Date & protectionStartDate() const
The first date for which defaults will trigger the contract.
const ext::shared_ptr< SimpleCashFlow > & upfrontPayment() const
void init(const Schedule &schedule, BusinessDayConvention paymentConvention, const DayCounter &dayCounter, const DayCounter &lastPeriodDayCounter, bool rebatesAccrual, const Date &upfrontDate=Date())
Shared initialisation.
bool paysAtDefaultTime() const
void setupArguments(PricingEngine::arguments *) const override
bool isExpired() const override
returns whether the instrument might have value greater than zero.
const Date & tradeDate() const
const Leg & coupons() const
ext::shared_ptr< Claim > claim_
ext::shared_ptr< SimpleCashFlow > accrualRebate_
Real couponLegNPV() const
ext::optional< Rate > upfront() const
Natural cashSettlementDays_
Real defaultLegNPV() const
bool settlesAccrual() const
Real couponLegBPS() const
ext::optional< Rate > upfront_
Rate impliedHazardRate(Real targetNPV, const Handle< YieldTermStructure > &discountCurve, const DayCounter &dayCounter, Real recoveryRate=0.4, Real accuracy=1.0e-8, PricingModel model=Midpoint) const
Implied hazard rate calculation.
const ext::shared_ptr< SimpleCashFlow > & accrualRebate() const
void setupExpired() const override
const Date & protectionEndDate() const
The last date for which defaults will trigger the contract.
void fetchResults(const PricingEngine::results *) const override
Rate conventionalSpread(Real conventionalRecovery, const Handle< YieldTermStructure > &discountCurve, const DayCounter &dayCounter, PricingModel model=Midpoint) const
Conventional/standard upfront-to-spread conversion.
ext::shared_ptr< SimpleCashFlow > upfrontPayment_
Rate runningSpread() const
Real accrualRebateNPV() const
Protection::Side side() const
bool rebatesAccrual() const
template base class for option pricing engines
Shared handle to an observable.
Abstract instrument class.
Classes for default-event handling.
default-probability term structure
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
Abstract instrument class.
Date cdsMaturity(const Date &tradeDate, const Period &tenor, DateGeneration::Rule rule)
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
Maps optional to either the boost or std implementation.