36 const ext::shared_ptr<IborIndex>& baseIndex,
37 const ext::shared_ptr<IborIndex>& otherIndex,
39 bool bootstrapBaseCurve)
41 calendar_(
std::move(calendar)), convention_(convention), endOfMonth_(endOfMonth),
42 discountHandle_(
std::move(discountHandle)), bootstrapBaseCurve_(bootstrapBaseCurve) {
76 auto lastBaseCoupon = ext::dynamic_pointer_cast<IborCoupon>(baseLeg.back());
86 auto lastOtherCoupon = ext::dynamic_pointer_cast<IborCoupon>(otherLeg.back());
89 std::max(lastBaseCoupon->fixingEndDate(),
90 lastOtherCoupon->fixingEndDate()));
93 swap_ = ext::make_shared<Swap>(baseLeg, otherLeg);
98 bool observer =
false;
108 return - (
swap_->NPV() /
swap_->legBPS(0)) * 1.0e-4;
128 const ext::shared_ptr<OvernightIndex>& baseIndex,
129 const ext::shared_ptr<IborIndex>& otherIndex,
132 calendar_(
std::move(calendar)), convention_(convention), endOfMonth_(endOfMonth),
133 discountHandle_(
std::move(discountHandle)) {
164 auto lastOtherCoupon = ext::dynamic_pointer_cast<IborCoupon>(otherLeg.back());
169 swap_ = ext::make_shared<Swap>(baseLeg, otherLeg);
170 swap_->setPricingEngine(ext::make_shared<DiscountingSwapEngine>(
177 bool observer =
false;
187 return - (
swap_->NPV() /
swap_->legBPS(0)) * 1.0e-4;
ibor-ibor and ois-ibor basis swap rate helpers
degenerate base class for the Acyclic Visitor pattern
virtual void accept(AcyclicVisitor &)
virtual void setTermStructure(TS *)
sets the term structure to be used for pricing
Date advance(const Date &, Integer n, TimeUnit unit, BusinessDayConvention convention=Following, bool endOfMonth=false) const
Shared handle to an observable.
void setTermStructure(YieldTermStructure *) override
IborIborBasisSwapRateHelper(const Handle< Quote > &basis, const Period &tenor, Natural settlementDays, Calendar calendar, BusinessDayConvention convention, bool endOfMonth, const ext::shared_ptr< IborIndex > &baseIndex, const ext::shared_ptr< IborIndex > &otherIndex, Handle< YieldTermStructure > discountHandle, bool bootstrapBaseCurve)
RelinkableHandle< YieldTermStructure > termStructureHandle_
Handle< YieldTermStructure > discountHandle_
void accept(AcyclicVisitor &) override
BusinessDayConvention convention_
ext::shared_ptr< IborIndex > otherIndex_
void initializeDates() override
Real impliedQuote() const override
ext::shared_ptr< Swap > swap_
ext::shared_ptr< IborIndex > baseIndex_
helper class building a sequence of capped/floored ibor-rate coupons
IborLeg & withNotionals(Real notional)
MakeSchedule & withConvention(BusinessDayConvention)
MakeSchedule & to(const Date &terminationDate)
MakeSchedule & withTenor(const Period &)
MakeSchedule & from(const Date &effectiveDate)
MakeSchedule & endOfMonth(bool flag=true)
MakeSchedule & forwards()
MakeSchedule & withCalendar(const Calendar &)
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
OvernightIborBasisSwapRateHelper(const Handle< Quote > &basis, const Period &tenor, Natural settlementDays, Calendar calendar, BusinessDayConvention convention, bool endOfMonth, const ext::shared_ptr< OvernightIndex > &baseIndex, const ext::shared_ptr< IborIndex > &otherIndex, Handle< YieldTermStructure > discountHandle=Handle< YieldTermStructure >())
void setTermStructure(YieldTermStructure *) override
RelinkableHandle< YieldTermStructure > termStructureHandle_
Handle< YieldTermStructure > discountHandle_
void accept(AcyclicVisitor &) override
BusinessDayConvention convention_
ext::shared_ptr< IborIndex > otherIndex_
void initializeDates() override
Real impliedQuote() const override
ext::shared_ptr< Swap > swap_
ext::shared_ptr< OvernightIndex > baseIndex_
helper class building a sequence of overnight coupons
OvernightLeg & withNotionals(Real notional)
Bootstrap helper with date schedule relative to global evaluation date.
DateProxy & evaluationDate()
the date at which pricing is to be performed.
static Settings & instance()
access to the unique instance
Visitor for a specific class
virtual void visit(T &)=0
Interest-rate term structure.
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
Coupon paying a Libor-type index.
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
empty deleter for shared_ptr
coupon paying the compounded daily overnight rate
ext::shared_ptr< BlackVolTermStructure > v