@@ -83,27 +83,83 @@ cdef class OISRateHelper(RelativeDateRateHelper):
8383 # pricer._thisptr
8484 )
8585 )
86-
87- cdef class DatedOISRateHelper(RateHelper):
88-
89- def __init__ (self ,
90- Date start_date not None ,
86+ @classmethod
87+ def from_dates (cls , Date start_date not None ,
9188 Date end_date not None ,
9289 Quote fixed_rate not None ,
9390 OvernightIndex overnight_index not None ,
9491 # exogenous discounting curve
9592 HandleYieldTermStructure discounting_curve not None = HandleYieldTermStructure(),
9693 bool telescopic_value_dates = False ,
94+ Integer payment_lag = 0 ,
95+ BusinessDayConvention payment_convention = Following,
96+ Frequency payment_frequency = Frequency.Annual,
97+ Calendar payment_calendar = Calendar(),
98+ Spread overnight_spread = 0.0 ,
99+ Pillar pillar = Pillar.LastRelevantDate,
100+ Date custom_pillar_date = Date(),
97101 RateAveraging averaging_method = RateAveraging.Compound,
98- ):
99- self ._thisptr = shared_ptr[_rh.RateHelper](
100- new _orh.DatedOISRateHelper(
102+ end_of_month = None ,
103+ fixed_payment_frequency = None ,
104+ Calendar fixed_calendar = Calendar(),
105+ Natural lookback_days = Null[Natural](),
106+ Natural lockout_days = 0 ,
107+ bool apply_observation_shift = False ):
108+ cdef OISRateHelper instance = OISRateHelper.__new__ (OISRateHelper)
109+ cdef:
110+ optional[bool ] end_of_month_opt
111+ optional[Frequency] fixed_payment_frequency_opt
112+ if end_of_month is not None :
113+ end_of_month_opt = < bool > end_of_month
114+ if fixed_payment_frequency is not None :
115+ fixed_payment_frequency_opt = < Frequency> fixed_payment_frequency
116+ instance._thisptr.reset(
117+ _orh.OISRateHelper_(
101118 start_date._thisptr,
102119 end_date._thisptr,
103120 fixed_rate.handle(),
104121 static_pointer_cast[_ib.OvernightIndex](overnight_index._thisptr),
105122 discounting_curve.handle,
106123 telescopic_value_dates,
107- averaging_method
124+ payment_lag,
125+ < _rh.BusinessDayConvention> payment_convention,
126+ < Frequency> payment_frequency,
127+ payment_calendar._thisptr,
128+ overnight_spread,
129+ pillar,
130+ custom_pillar_date._thisptr,
131+ averaging_method,
132+ end_of_month_opt,
133+ fixed_payment_frequency_opt,
134+ fixed_calendar._thisptr,
135+ lookback_days,
136+ lockout_days,
137+ apply_observation_shift,
138+ # pricer._thisptr
108139 )
109140 )
141+ return instance
142+
143+ # cdef class DatedOISRateHelper(RateHelper):
144+
145+ # def __init__(self,
146+ # Date start_date not None,
147+ # Date end_date not None,
148+ # Quote fixed_rate not None,
149+ # OvernightIndex overnight_index not None,
150+ # # exogenous discounting curve
151+ # HandleYieldTermStructure discounting_curve not None=HandleYieldTermStructure(),
152+ # bool telescopic_value_dates = False,
153+ # RateAveraging averaging_method=RateAveraging.Compound,
154+ # ):
155+ # self._thisptr = shared_ptr[_rh.RateHelper](
156+ # new _orh.DatedOISRateHelper(
157+ # start_date._thisptr,
158+ # end_date._thisptr,
159+ # fixed_rate.handle(),
160+ # static_pointer_cast[_ib.OvernightIndex](overnight_index._thisptr),
161+ # discounting_curve.handle,
162+ # telescopic_value_dates,
163+ # averaging_method
164+ # )
165+ # )
0 commit comments