35 const ext::optional<bool>& includeSettlementDateFlows)
36 : integrationStep_(step), probability_(
std::move(probability)), recoveryRate_(recoveryRate),
47 "no discount term structure set");
49 "no probability term structure set");
80 ext::shared_ptr<FixedRateCoupon> coupon =
81 ext::dynamic_pointer_cast<FixedRateCoupon>(
arguments_.
leg[i]);
87 Date paymentDate = coupon->date(),
89 coupon->accrualStartDate()),
90 endDate = coupon->accrualEndDate();
91 Date effectiveStartDate =
92 (startDate <= today && today <= endDate) ? today : startDate;
93 Real couponAmount = coupon->amount();
106 Date d0 = effectiveStartDate;
107 Date d1 = std::min(d0 + step, endDate);
123 coupon->accruedAmount(d1) * B * dP;
126 couponAmount * B * dP;
138 d1 = std::min(d0 + step, endDate);
139 }
while (d0 < endDate);
142 Real upfrontSign = 1.0;
154 QL_FAIL(
"unknown protection side");
179 static const Rate basisPoint = 1.0e-4;
bool includeSettlementDateFlows_
const YieldTermStructure & discountCurve_
Classes for default-event claims.
ext::shared_ptr< Claim > claim
ext::shared_ptr< SimpleCashFlow > accrualRebate
ext::optional< Rate > upfront
ext::shared_ptr< SimpleCashFlow > upfrontPayment
CreditDefaultSwap::results results_
CreditDefaultSwap::arguments arguments_
Shared handle to an observable.
Handle< YieldTermStructure > discountCurve_
Handle< DefaultProbabilityTermStructure > probability_
ext::optional< bool > includeSettlementDateFlows_
void calculate() const override
IntegralCdsEngine(const Period &integrationStep, Handle< DefaultProbabilityTermStructure >, Real recoveryRate, Handle< YieldTermStructure > discountCurve, const ext::optional< bool > &includeSettlementDateFlows=ext::nullopt)
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
DateProxy & evaluationDate()
the date at which pricing is to be performed.
static Settings & instance()
access to the unique instance
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
Coupon paying a fixed annual rate.
Real DiscountFactor
discount factor between dates
Real Probability
probability
std::size_t Size
size of a container
Integral engine for credit default swaps.
Maps optional to either the boost or std implementation.
Interest-rate term structure.