From 5967cbbd638b80493533fef3835a71aec931c516 Mon Sep 17 00:00:00 2001
From: sophistis42 <136467220+sophistis42@users.noreply.github.com>
Date: Mon, 4 Nov 2024 11:05:16 +0100
Subject: [PATCH 1/2] Add rule kwarg to OISRateHelper constructor

---
 SWIG/ratehelpers.i | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/SWIG/ratehelpers.i b/SWIG/ratehelpers.i
index 09054706d..1db5db1b1 100644
--- a/SWIG/ratehelpers.i
+++ b/SWIG/ratehelpers.i
@@ -362,7 +362,8 @@ class OISRateHelper : public RateHelper {
             Natural lookbackDays = Null<Natural>(),
             Natural lockoutDays = 0,
             bool applyObservationShift = false,
-            const ext::shared_ptr<FloatingRateCouponPricer>& pricer = {});
+            const ext::shared_ptr<FloatingRateCouponPricer>& pricer = {},
+            DateGeneration::Rule rule = DateGeneration::Backward);
     %extend {
         static ext::shared_ptr<OISRateHelper> forDates(
                 const Date& startDate,

From f262fb76de159c8b1d7b056c79ab9e935b4ecc64 Mon Sep 17 00:00:00 2001
From: sophistis42 <136467220+sophistis42@users.noreply.github.com>
Date: Mon, 4 Nov 2024 11:50:39 +0100
Subject: [PATCH 2/2] Added date generation rule to forDates function,
 following Luigi's suggestion

---
 SWIG/ratehelpers.i | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/SWIG/ratehelpers.i b/SWIG/ratehelpers.i
index 1db5db1b1..dc7adc6bc 100644
--- a/SWIG/ratehelpers.i
+++ b/SWIG/ratehelpers.i
@@ -386,13 +386,14 @@ class OISRateHelper : public RateHelper {
                 Natural lookbackDays = Null<Natural>(),
                 Natural lockoutDays = 0,
                 bool applyObservationShift = false,
-                ext::shared_ptr<FloatingRateCouponPricer> pricer = {}) {
+                ext::shared_ptr<FloatingRateCouponPricer> pricer = {},
+                DateGeneration::Rule rule = DateGeneration::Backward) {
             return ext::make_shared<OISRateHelper>(
                 startDate, endDate, rate, index, discountingCurve,
                 telescopicValueDates, paymentLag, paymentConvention, paymentFrequency,
                 paymentCalendar, overnightSpread, pillar, customPillarDate, averagingMethod,
                 endOfMonth, fixedPaymentFrequency, fixedCalendar, lookbackDays, lockoutDays,
-                applyObservationShift, pricer);
+                applyObservationShift, pricer, rule);
         }
     }
     ext::shared_ptr<OvernightIndexedSwap> swap();