32 const ext::shared_ptr<Basket>& basket,
40 bool settlePremiumAccrual
42 : basket_(basket), n_(
n),
43 side_(side), nominal_(nominal),
44 premiumSchedule_(
std::move(premiumSchedule)), premiumRate_(premiumRate),
45 upfrontRate_(upfrontRate),
46 dayCounter_(dayCounter), settlePremiumAccrual_(settlePremiumAccrual)
49 "NTD order provided is larger than the basket size.");
54 "Basket did not exist before contract start.");
75 "fair premium not available");
82 "premium leg not available");
84 "upfront value not available");
91 "protection leg not available");
98 "error estimate not available");
basket of issuers and related notionals
Classes for default-event claims.
virtual bool hasOccurred(const Date &refDate=Date(), ext::optional< bool > includeRefDate=ext::nullopt) const
returns true if an event has already occurred before a date
helper class building a sequence of fixed rate coupons
FixedRateLeg & withNotionals(Real)
FixedRateLeg & withPaymentAdjustment(BusinessDayConvention)
FixedRateLeg & withCouponRates(Rate, const DayCounter &paymentDayCounter, Compounding comp=Simple, Frequency freq=Annual)
std::map< std::string, ext::any > additionalResults
void calculate() const override
virtual void fetchResults(const PricingEngine::results *) const
virtual void setupExpired() const
ext::shared_ptr< Basket > basket
void validate() const override
bool settlePremiumAccrual
Real upfrontPremiumValue_
ext::shared_ptr< Basket > basket_
void setupArguments(PricingEngine::arguments *) const override
const ext::shared_ptr< Basket > & basket() const
bool isExpired() const override
returns whether the instrument might have value greater than zero.
Real errorEstimate() const
bool settlePremiumAccrual_
Real protectionLegNPV() const
Real premiumLegNPV() const
void setupExpired() const override
void fetchResults(const PricingEngine::results *) const override
Schedule premiumSchedule_
DayCounter dayCounter() const
NthToDefault(const ext::shared_ptr< Basket > &basket, Size n, Protection::Side side, Schedule premiumSchedule, Rate upfrontRate, Rate premiumRate, const DayCounter &dayCounter, Real nominal, bool settlePremiumAccrual)
This product is 'digital'; the basket might be tranched but this is.
Protection::Side side() const
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
const Date & startDate() const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Base class for events associated with a given date.
Coupon paying a fixed annual rate.
std::size_t Size
size of a container
Loss distributions and probability of n defaults.
ext::shared_ptr< YieldTermStructure > r
Interest-rate term structure.