From 266a31679528d4dbe42658e7aeb815b4ec05194c Mon Sep 17 00:00:00 2001 From: Eugene Toder Date: Thu, 18 Apr 2024 17:51:13 -0400 Subject: [PATCH 1/2] Remove forwardStart from DatedOISRateHelper I added it recently, but this was a mistake: forwardStart has no effect when both start and end dates are specified. --- ql/termstructures/yield/oisratehelper.cpp | 3 +-- ql/termstructures/yield/oisratehelper.hpp | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ql/termstructures/yield/oisratehelper.cpp b/ql/termstructures/yield/oisratehelper.cpp index a20843d4dd8..2d65f0b83c5 100644 --- a/ql/termstructures/yield/oisratehelper.cpp +++ b/ql/termstructures/yield/oisratehelper.cpp @@ -168,7 +168,6 @@ namespace QuantLib { BusinessDayConvention paymentConvention, Frequency paymentFrequency, const Calendar& paymentCalendar, - const Period& forwardStart, Spread overnightSpread, ext::optional endOfMonth, ext::optional fixedPaymentFrequency, @@ -188,7 +187,7 @@ namespace QuantLib { // input discount curve Handle might be empty now but it could // be assigned a curve later; use a RelinkableHandle here - auto tmp = MakeOIS(Period(), clonedOvernightIndex, 0.0, forwardStart) + auto tmp = MakeOIS(Period(), clonedOvernightIndex, 0.0) .withDiscountingTermStructure(discountRelinkableHandle_) .withEffectiveDate(startDate) .withTerminationDate(endDate) diff --git a/ql/termstructures/yield/oisratehelper.hpp b/ql/termstructures/yield/oisratehelper.hpp index 4390421f931..75b08d1384a 100644 --- a/ql/termstructures/yield/oisratehelper.hpp +++ b/ql/termstructures/yield/oisratehelper.hpp @@ -109,7 +109,6 @@ namespace QuantLib { BusinessDayConvention paymentConvention = Following, Frequency paymentFrequency = Annual, const Calendar& paymentCalendar = Calendar(), - const Period& forwardStart = 0 * Days, Spread overnightSpread = 0.0, ext::optional endOfMonth = ext::nullopt, ext::optional fixedPaymentFrequency = ext::nullopt, From 852500caba9101c76c2901780256a1a4abc70b12 Mon Sep 17 00:00:00 2001 From: Luigi Ballabio Date: Fri, 3 May 2024 12:17:02 +0200 Subject: [PATCH 2/2] Deprecate and forward old constructor --- ql/termstructures/yield/oisratehelper.cpp | 20 ++++++++++++++++++++ ql/termstructures/yield/oisratehelper.hpp | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/ql/termstructures/yield/oisratehelper.cpp b/ql/termstructures/yield/oisratehelper.cpp index 2d65f0b83c5..4d8ff86f4c9 100644 --- a/ql/termstructures/yield/oisratehelper.cpp +++ b/ql/termstructures/yield/oisratehelper.cpp @@ -215,6 +215,26 @@ namespace QuantLib { latestDate_ = std::max(swap_->maturityDate(), lastPaymentDate); } + DatedOISRateHelper::DatedOISRateHelper(const Date& startDate, + const Date& endDate, + const Handle& fixedRate, + const ext::shared_ptr& overnightIndex, + Handle discount, + bool telescopicValueDates, + RateAveraging::Type averagingMethod, + Integer paymentLag, + BusinessDayConvention paymentConvention, + Frequency paymentFrequency, + const Calendar& paymentCalendar, + const Period&, + Spread overnightSpread, + ext::optional endOfMonth, + ext::optional fixedPaymentFrequency, + const Calendar& fixedCalendar) + : DatedOISRateHelper(startDate, endDate, fixedRate, overnightIndex, discount, telescopicValueDates, + averagingMethod, paymentLag, paymentConvention, paymentFrequency, paymentCalendar, + overnightSpread, endOfMonth, fixedPaymentFrequency, fixedCalendar) {} + void DatedOISRateHelper::setTermStructure(YieldTermStructure* t) { // do not set the relinkable handle as an observer - // force recalculation when needed diff --git a/ql/termstructures/yield/oisratehelper.hpp b/ql/termstructures/yield/oisratehelper.hpp index 75b08d1384a..605acfdf6b2 100644 --- a/ql/termstructures/yield/oisratehelper.hpp +++ b/ql/termstructures/yield/oisratehelper.hpp @@ -113,6 +113,29 @@ namespace QuantLib { ext::optional endOfMonth = ext::nullopt, ext::optional fixedPaymentFrequency = ext::nullopt, const Calendar& fixedCalendar = Calendar()); + + /*! \deprecated Use the overload without forward start. + Deprecated in version 1.35. + */ + QL_DEPRECATED + DatedOISRateHelper(const Date& startDate, + const Date& endDate, + const Handle& fixedRate, + const ext::shared_ptr& overnightIndex, + // exogenous discounting curve + Handle discountingCurve, + bool telescopicValueDates, + RateAveraging::Type averagingMethod, + Integer paymentLag, + BusinessDayConvention paymentConvention, + Frequency paymentFrequency, + const Calendar& paymentCalendar, + const Period& forwardStart, + Spread overnightSpread = 0.0, + ext::optional endOfMonth = ext::nullopt, + ext::optional fixedPaymentFrequency = ext::nullopt, + const Calendar& fixedCalendar = Calendar()); + //! \name RateHelper interface //@{ Real impliedQuote() const override;