I'm beginning to use QuantLib with Python SWIG, and trying to build a EUR yield curve.
I face this error which frankly I don't understand; I looked at the code of bool IMM::isIMMdate in imm.cpp and that date shouldn't pose a problem. Other dates may cause trouble because some days are < to 15 and in imm.cpp apparently a future whose expiry date is < 15 isn't a IMM date - well, but still in that case 19th Dec 2016 it should be OK, it's a Euribor future.
this = _QuantLib.new_FuturesRateHelper(*args)
RuntimeError: December 19th, 2016 is not a valid IMM date
Here is my piece of code that triggers the error:
print('futures: {}'.format(futures))
It outputs:
futures: {Date(19,12,2016): 100.01, Date(13,6,2016): 100.04, Date(19,9,2016): 100.035, Date(14,3,2016): 100.045, Date(14,12,2015): 100.035, Date(18,9,2017): 99.905, Date(13,3,2017): 99.985, Date(19,6,2017): 99.95}
futuresHelpers = [ql.FuturesRateHelper(ql.QuoteHandle(futures[d]),
d, months,
calendar, ql.ModifiedFollowing,
True, dayCounter,
ql.QuoteHandle(ql.SimpleQuote(0.0)))
for d in futures.keys()]