diff --git a/ql/termstructures/yield/oisratehelper.cpp b/ql/termstructures/yield/oisratehelper.cpp index 39a9575382..e14ebafac3 100644 --- a/ql/termstructures/yield/oisratehelper.cpp +++ b/ql/termstructures/yield/oisratehelper.cpp @@ -49,7 +49,8 @@ namespace QuantLib { Natural lookbackDays, Natural lockoutDays, bool applyObservationShift, - ext::shared_ptr pricer) + ext::shared_ptr pricer, + DateGeneration::Rule rule) : RelativeDateRateHelper(fixedRate), settlementDays_(settlementDays), tenor_(tenor), discountHandle_(std::move(discount)), telescopicValueDates_(telescopicValueDates), paymentLag_(paymentLag), paymentConvention_(paymentConvention), @@ -58,7 +59,7 @@ namespace QuantLib { averagingMethod_(averagingMethod), endOfMonth_(endOfMonth), fixedPaymentFrequency_(fixedPaymentFrequency), fixedCalendar_(std::move(fixedCalendar)), lookbackDays_(lookbackDays), lockoutDays_(lockoutDays), applyObservationShift_(applyObservationShift), - pricer_(std::move(pricer)) { + pricer_(std::move(pricer)), rule_(rule) { initialize(overnightIndex, customPillarDate); } @@ -82,7 +83,8 @@ namespace QuantLib { Natural lookbackDays, Natural lockoutDays, bool applyObservationShift, - ext::shared_ptr pricer) + ext::shared_ptr pricer, + DateGeneration::Rule rule) : RelativeDateRateHelper(fixedRate, false), startDate_(startDate), endDate_(endDate), discountHandle_(std::move(discount)), telescopicValueDates_(telescopicValueDates), paymentLag_(paymentLag), paymentConvention_(paymentConvention), @@ -91,7 +93,7 @@ namespace QuantLib { averagingMethod_(averagingMethod), endOfMonth_(endOfMonth), fixedPaymentFrequency_(fixedPaymentFrequency), fixedCalendar_(std::move(fixedCalendar)), lookbackDays_(lookbackDays), lockoutDays_(lockoutDays), applyObservationShift_(applyObservationShift), - pricer_(std::move(pricer)) { + pricer_(std::move(pricer)), rule_(rule) { initialize(overnightIndex, customPillarDate); } @@ -128,6 +130,7 @@ namespace QuantLib { .withAveragingMethod(averagingMethod_) .withLookbackDays(lookbackDays_) .withLockoutDays(lockoutDays_) + .withRule(rule_) .withObservationShift(applyObservationShift_); if (endOfMonth_) { tmp.withEndOfMonth(*endOfMonth_); diff --git a/ql/termstructures/yield/oisratehelper.hpp b/ql/termstructures/yield/oisratehelper.hpp index a65ff3ae53..77c4326933 100644 --- a/ql/termstructures/yield/oisratehelper.hpp +++ b/ql/termstructures/yield/oisratehelper.hpp @@ -58,7 +58,8 @@ namespace QuantLib { Natural lookbackDays = Null(), Natural lockoutDays = 0, bool applyObservationShift = false, - ext::shared_ptr pricer = {}); + ext::shared_ptr pricer = {}, + DateGeneration::Rule rule = DateGeneration::Backward); OISRateHelper(const Date& startDate, const Date& endDate, const Handle& fixedRate, @@ -80,7 +81,8 @@ namespace QuantLib { Natural lookbackDays = Null(), Natural lockoutDays = 0, bool applyObservationShift = false, - ext::shared_ptr pricer = {}); + ext::shared_ptr pricer = {}, + DateGeneration::Rule rule = DateGeneration::Backward); //! \name RateHelper interface //@{ Real impliedQuote() const override; @@ -127,6 +129,8 @@ namespace QuantLib { Natural lockoutDays_; bool applyObservationShift_; ext::shared_ptr pricer_; + DateGeneration::Rule rule_ = DateGeneration::Backward; + }; /*! \deprecated Use OISRateHelper instead.