|
From: Emily B. <Emi...@ch...> - 2025-01-17 12:36:29
|
Hello,
I am trying to use QuantLib to build a yield curve using the OvernightIndexFutureRateHelper and FedFunds future prices, but am getting some unexpected results. When the evaluation date is the last day of the month (say, October 31, 2024) the future price for that month (in this case, October) does not affect the rate produced.
Here is a minimal example in Python:
reference_date = ql.Date(31,10,2024)
im = ql.IndexManager.instance()
day_counter = ql.Actual360()
ql.Settings.instance().evaluationDate = reference_date
ff_index = ql.FedFunds()
im.clearHistory(ff_index.name())
fixing_price = 0.05
date = ql.Date(1,10,2024)
while date < reference_date:
ff_index.addFixing(date, fixing_price)
date = ff_index.fixingCalendar().advance(date, 1, ql.Days)
ff_helpers = []
quoted_rates = [
(ql.QuoteHandle(ql.SimpleQuote(94)), ql.Date(31, 10, 2024)),
(ql.QuoteHandle(ql.SimpleQuote(95)), ql.Date(30, 11, 2024)),
]
for rate, date in quoted_rates:
ff_helpers.append(ql.OvernightIndexFutureRateHelper(rate, reference_date, date, ff_index))
ff_yield_curve = ql.PiecewiseFlatForward(reference_date, ff_helpers, day_counter, [], [])
curve_dates = [min(ff_yield_curve.dates()) + x for x in range(max(ff_yield_curve.dates()) - min(ff_yield_curve.dates()))]
zero_rates = [round(ff_yield_curve.zeroRate(d, day_counter, ql.Compounded).rate() * 100, 6) for d in curve_dates]
pd.DataFrame(data={'Date': curve_dates, 'ZeroRate': zero_rates})
No matter what price is set for the October 31, 2024 FedFunds future, the resulting rate does not change.
Is this a bug, or is there a more recommended way of setting this up?
Thanks,
Emily
This electronic mail message and any attached files contain information intended for the exclusive use of the individual or entity to whom it is addressed and may contain information that is proprietary, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any viewing, copying, disclosure or distribution of this information may be subject to legal restriction or sanction. Please notify the sender, by electronic mail or telephone, of any unintended recipients and delete the original message without making any copies. CTC London Limited is authorized and regulated by the Financial Conduct Authority.
|