Closed githubbla closed 6 months ago
@dougransom could you please look into issue?
seems to be related to the url generated to download VX_M4
vu.download_vix_futures.generate_monthly_url_date(2024,6)
is returning https://cdn.cboe.com/data/us/futures/market_statistics/historical_data/VX/VX_2024-06-19.csv which is invalid
the valid url is https://cdn.cboe.com/data/us/futures/market_statistics/historical_data/VX/VX_2024-06-18.csv
So VX_M4 is missing from vix_utils.async_load_vix_term_structure()
somehow the expiration date is set to 2024-06-18 which is a Tuesday. pandas_market_calendars
is not listing 2024-06-19 as valid day. but vix_futures_dates.vix_futures_expiry_date_monthly
somehow is missing it
interestingly the weekly expiration is working fine, and the file 2024-06-18.w*
is downloaded
hope this helps @dougransom
@dougransom, @gnzsnz
https://en.wikipedia.org/wiki/Juneteenth 19-Jun US public holiday from 2021!! 🤯
I think i found the bug,
it should be
futures_expiry_date = option_expiry_date - dt.timedelta(days=30)
# also check for a holiday on the 30 days before the 3d friday
if friday_expiration and not any(_valid_cfe_days.isin([futures_expiry_date])):
futures_expiry_date = futures_expiry_date - dt.timedelta(days=1)
current code is checking for an exchange holiday using the options expiration date, and should use the futures expiry date. by changing this the if statement will be true and take one day before. which will solve the issue (I think)
@dougransom, @gnzsnz
https://en.wikipedia.org/wiki/Juneteenth 19-Jun US public holiday from 2021!! 🤯
https://github.com/rsheftel/pandas_market_calendars/issues/261
@gnzsnz Thanks for fixing it, I have merged it in, along with a unit test and a requirement for latest pandas market calendars.
Though this error was mine, we get similar errors when the Pandas market calendars miss a holiday.
Fixed in release 0.1.6 on PyPi.