I would like to know if I can use maturity dates from my rates dataframe to generate OISratehelpers. In the following code the OIS rate helper use 'tenors' and I want to replace those tenors with maturity dates. For 'if' conditions, it is ok to use tenors but inside calculation I want to use maturity dates. I need help in this part (ql.OISRateHelper(0, ql.Period(tenor), ql.QuoteHandle(ql.SimpleQuote(rate)), index). How can I do work with maturity dates ?
rates_df = [Curve date maturity tenor rates
FEDFUNDS 1/10/2022 1/11/2022 1D -0.07
FEDFUNDS 1/10/2022 1/12/2022 2D -0.75
FEDFUNDS 1/10/2022 1/19/2022 1W -0.654
FEDFUNDS 1/10/2022 1/26/2022 2W -0.675
FEDFUNDS 1/10/2022 2/2/2022 3W -0.432
FEDFUNDS 1/10/2022 2/14/2022 1M -0.564]
index = 'FEDFUNDS'
helpers = []
for idx, row in rates_df.iterrows():
rate = row["rates"] / 100
tenor = row.tenor
if tenor == "1D":
helpers.append(ql.DepositRateHelper(rate, index))
elif tenor == '2D':
print("2D")
else:
helpers.append(
ql.OISRateHelper(
0, ql.Period(tenor), ql.QuoteHandle(ql.SimpleQuote(rate)), index
)
)