38 : fixedPayer_(fixedPayer), nominal_(nominal), fixedSchedule_(
std::move(fixedSchedule)),
39 floatSchedule_(
std::move(floatSchedule)), fixedDayCounter_(
std::move(fixedDayCounter)),
40 floatDayCounter_(
std::move(floatDayCounter)), spread_(spread), recoveryRate_(recoveryRate),
41 yieldTS_(
std::move(yieldTS)), defaultTS_(
std::move(defaultTS)),
coupon_(coupon) {
185 const Period& fixedPeriod,
188 const Period& floatPeriod,
193 const Period& integrationStepSize)
195 calendar_(
std::move(calendar)), fixedConvention_(fixedConvention), fixedPeriod_(fixedPeriod),
196 fixedDayCount_(
std::move(fixedDayCount)), floatConvention_(floatConvention),
197 floatPeriod_(floatPeriod), floatDayCount_(
std::move(floatDayCount)),
198 recoveryRate_(recoveryRate), yieldTS_(yieldTS), integrationStepSize_(integrationStepSize) {
208 "default term structure not set");
211 return asw_->fairSpread();
219 ext::shared_ptr<DefaultProbabilityTermStructure>(ts,
null_deleter()),
251 asw_ = ext::make_shared<RiskyAssetSwap>(
true,
const AverageBMACoupon * coupon_
BusinessDayConvention fixedConvention_
RelinkableHandle< DefaultProbabilityTermStructure > probability_
RelinkableHandle< YieldTermStructure > yieldTS_
DayCounter fixedDayCount_
void setTermStructure(DefaultProbabilityTermStructure *) override
DayCounter floatDayCount_
Real impliedQuote() const override
ext::shared_ptr< RiskyAssetSwap > asw_
BusinessDayConvention floatConvention_
AssetSwapHelper(const Handle< Quote > &spread, const Period &tenor, Natural settlementDays, Calendar calendar, const Period &fixedPeriod, BusinessDayConvention fixedConvention, DayCounter fixedDayCount, const Period &floatPeriod, BusinessDayConvention floatConvention, DayCounter floatDayCount, Real recoveryRate, const RelinkableHandle< YieldTermStructure > &yieldTS, const Period &integrationStepSize=Period())
Base helper class for bootstrapping.
virtual void setTermStructure(TS *)
sets the term structure to be used for pricing
Date adjust(const Date &, BusinessDayConvention convention=Following) const
Date advance(const Date &, Integer n, TimeUnit unit, BusinessDayConvention convention=Following, bool endOfMonth=false) const
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
Default probability term structure.
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
Shared handle to an observable.
void calculate() const override
virtual void setupExpired() const
Calendar for reproducing theoretical calculations.
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Relinkable handle to an observable.
Real riskyBondPrice() const
void performCalculations() const override
DayCounter fixedDayCounter_
bool isExpired() const override
returns whether the instrument might have value greater than zero.
Real floatAnnuity() const
Handle< DefaultProbabilityTermStructure > defaultTS_
DayCounter floatDayCounter_
Real fixedAnnuity() const
void setupExpired() const override
Real recoveryValue() const
RiskyAssetSwap(bool fixedPayer, Real nominal, Schedule fixedSchedule, Schedule floatSchedule, DayCounter fixedDayCounter, DayCounter floatDayCounter, Rate spread, Rate recoveryRate_, Handle< YieldTermStructure > yieldTS, Handle< DefaultProbabilityTermStructure > defaultTS, Rate coupon=Null< Rate >())
Handle< YieldTermStructure > yieldTS_
const std::vector< Date > & dates() const
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
Base class for events associated with a given date.
TimeUnit
Units used to describe time periods.
BusinessDayConvention
Business Day conventions.
Real Time
continuous quantity with 1-year units
unsigned QL_INTEGER Natural
positive integer
std::size_t Size
size of a container
empty deleter for shared_ptr
Risky asset-swap instrument.