33 const ext::shared_ptr<OvernightIndex>& overnightIndex,
35 bool telescopicValueDates,
40 const Period& forwardStart,
41 const Spread overnightSpread,
43 Date customPillarDate,
45 ext::optional<bool> endOfMonth,
46 ext::optional<Frequency> fixedPaymentFrequency,
48 :
RelativeDateRateHelper(fixedRate), pillarChoice_(pillar), settlementDays_(settlementDays), tenor_(tenor),
49 discountHandle_(
std::move(discount)), telescopicValueDates_(telescopicValueDates),
50 paymentLag_(paymentLag), paymentConvention_(paymentConvention),
51 paymentFrequency_(paymentFrequency), paymentCalendar_(
std::move(paymentCalendar)),
52 forwardStart_(forwardStart), overnightSpread_(overnightSpread),
53 averagingMethod_(averagingMethod), endOfMonth_(endOfMonth),
54 fixedPaymentFrequency_(fixedPaymentFrequency), fixedCalendar_(
std::move(fixedCalendar)) {
100 Date lastPaymentDate = std::max(
swap_->overnightLeg().back()->date(),
101 swap_->fixedLeg().back()->date());
114 "pillar date (" <<
pillarDate_ <<
") must be later "
115 "than or equal to the instrument's earliest date (" <<
118 "pillar date (" <<
pillarDate_ <<
") must be before "
119 "or equal to the instrument's latest relevant date (" <<
132 bool observer =
false;
149 return swap_->fairRate();
163 const ext::shared_ptr<OvernightIndex>& overnightIndex,
165 bool telescopicValueDates,
172 ext::optional<bool> endOfMonth,
173 ext::optional<Frequency> fixedPaymentFrequency,
175 :
RateHelper(fixedRate), discountHandle_(
std::move(discount)),
176 telescopicValueDates_(telescopicValueDates), averagingMethod_(averagingMethod) {
178 auto clonedOvernightIndex =
204 if (fixedPaymentFrequency) {
207 if (!fixedCalendar.
empty()) {
213 Date lastPaymentDate = std::max(
swap_->overnightLeg().back()->date(),
214 swap_->fixedLeg().back()->date());
221 const ext::shared_ptr<OvernightIndex>& overnightIndex,
223 bool telescopicValueDates,
231 ext::optional<bool> endOfMonth,
232 ext::optional<Frequency> fixedPaymentFrequency,
234 :
DatedOISRateHelper(startDate, endDate, fixedRate, overnightIndex,
std::move(discount), telescopicValueDates,
235 averagingMethod, paymentLag, paymentConvention, paymentFrequency, paymentCalendar,
236 overnightSpread, endOfMonth, fixedPaymentFrequency, fixedCalendar) {}
241 bool observer =
false;
258 return swap_->fairRate();
degenerate base class for the Acyclic Visitor pattern
Base helper class for bootstrapping.
virtual void accept(AcyclicVisitor &)
virtual void setTermStructure(TS *)
sets the term structure to be used for pricing
bool empty() const
Returns whether or not the calendar is initialized.
Rate helper for bootstrapping over Overnight Indexed Swap rates.
RelinkableHandle< YieldTermStructure > discountRelinkableHandle_
void setTermStructure(YieldTermStructure *) override
bool telescopicValueDates_
RelinkableHandle< YieldTermStructure > termStructureHandle_
Handle< YieldTermStructure > discountHandle_
void accept(AcyclicVisitor &) override
RateAveraging::Type averagingMethod_
ext::shared_ptr< OvernightIndexedSwap > swap_
Real impliedQuote() const override
DatedOISRateHelper(const Date &startDate, const Date &endDate, const Handle< Quote > &fixedRate, const ext::shared_ptr< OvernightIndex > &overnightIndex, Handle< YieldTermStructure > discountingCurve={}, bool telescopicValueDates=false, RateAveraging::Type averagingMethod=RateAveraging::Compound, Integer paymentLag=0, BusinessDayConvention paymentConvention=Following, Frequency paymentFrequency=Annual, const Calendar &paymentCalendar=Calendar(), Spread overnightSpread=0.0, ext::optional< bool > endOfMonth=ext::nullopt, ext::optional< Frequency > fixedPaymentFrequency=ext::nullopt, const Calendar &fixedCalendar=Calendar())
Shared handle to an observable.
MakeOIS & withPaymentAdjustment(BusinessDayConvention convention)
MakeOIS & withPaymentLag(Integer lag)
MakeOIS & withDiscountingTermStructure(const Handle< YieldTermStructure > &discountingTermStructure)
MakeOIS & withSettlementDays(Natural settlementDays)
MakeOIS & withPaymentFrequency(Frequency f)
MakeOIS & withFixedLegCalendar(const Calendar &cal)
MakeOIS & withPaymentCalendar(const Calendar &cal)
MakeOIS & withTerminationDate(const Date &)
MakeOIS & withEffectiveDate(const Date &)
MakeOIS & withOvernightLegSpread(Spread sp)
MakeOIS & withEndOfMonth(bool flag=true)
MakeOIS & withFixedLegPaymentFrequency(Frequency f)
MakeOIS & withAveragingMethod(RateAveraging::Type averagingMethod)
MakeOIS & withTelescopicValueDates(bool telescopicValueDates)
ext::shared_ptr< OvernightIndex > overnightIndex_
RelinkableHandle< YieldTermStructure > discountRelinkableHandle_
void setTermStructure(YieldTermStructure *) override
bool telescopicValueDates_
RelinkableHandle< YieldTermStructure > termStructureHandle_
Calendar paymentCalendar_
Pillar::Choice pillarChoice_
Handle< YieldTermStructure > discountHandle_
void accept(AcyclicVisitor &) override
ext::optional< bool > endOfMonth_
RateAveraging::Type averagingMethod_
void initializeDates() override
ext::shared_ptr< OvernightIndexedSwap > swap_
BusinessDayConvention paymentConvention_
Real impliedQuote() const override
Frequency paymentFrequency_
OISRateHelper(Natural settlementDays, const Period &tenor, const Handle< Quote > &fixedRate, const ext::shared_ptr< OvernightIndex > &overnightIndex, Handle< YieldTermStructure > discountingCurve={}, bool telescopicValueDates=false, Integer paymentLag=0, BusinessDayConvention paymentConvention=Following, Frequency paymentFrequency=Annual, Calendar paymentCalendar=Calendar(), const Period &forwardStart=0 *Days, Spread overnightSpread=0.0, Pillar::Choice pillar=Pillar::LastRelevantDate, Date customPillarDate=Date(), RateAveraging::Type averagingMethod=RateAveraging::Compound, ext::optional< bool > endOfMonth=ext::nullopt, ext::optional< Frequency > fixedPaymentFrequency=ext::nullopt, Calendar fixedCalendar=Calendar())
ext::optional< Frequency > fixedPaymentFrequency_
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Bootstrap helper with date schedule relative to global evaluation date.
Visitor for a specific class
virtual void visit(T &)=0
Interest-rate term structure.
#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)
Frequency
Frequency of events.
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
QL_INTEGER Integer
integer number
Real Spread
spreads on interest rates
Helper class to instantiate overnight indexed swaps.
void simplifyNotificationGraph(Instrument &instrument, const Leg &leg, bool unregisterCoupons)
Utility function to optimize the observability graph of an instrument.
empty deleter for shared_ptr
Overnight Indexed Swap (aka OIS) rate helpers.
ext::shared_ptr< BlackVolTermStructure > v
utility functions to reduce number of notifications sent by observables
Choice
Enumeration for pillar determination alternatives.
@ CustomDate
last date relevant for instrument pricing
@ LastRelevantDate
instruments maturity date