-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update cme futures holidays and early closes #7524
Closed
Marinovsky
wants to merge
17
commits into
QuantConnect:master
from
Marinovsky:bug-7501-UpdateCMEFuturesHolidaysAndEarlyCloses
Closed
Update cme futures holidays and early closes #7524
Marinovsky
wants to merge
17
commits into
QuantConnect:master
from
Marinovsky:bug-7501-UpdateCMEFuturesHolidaysAndEarlyCloses
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Acoording to `pandas_market_calendars` there were some dates in Future-cme-[*] who wasn't early_closes, so they needed to be removed from there. On the other hand, the early closes list of Future-cme-ES were shifted by 1 hour according to CME webpage. Besides, there were some missing dates.
After debugging the tests it was found they were failing due to the last change on SecurityExchangeHours.IsOpen(). That method wasn't taking into account that even if there is a late open after an early close if the timespan is after the early close but before the late open, the market is still close.
Marinovsky
force-pushed
the
bug-7501-UpdateCMEFuturesHolidaysAndEarlyCloses
branch
from
November 20, 2023 16:12
7e94f68
to
1693b4f
Compare
Martin-Molinero
approved these changes
Nov 21, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 🙌
11 tasks
Included by #7605 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As pointed out here (#7501 (comment)) the general CME Future entry (
Future-cme-[*]
) contained dates that were not holidays and therefore needed to be removed, at least from the general entry. Some of those dates were actually early closes for futures of class Equity, FX and Interest Rate, others were in fact holidays, as defined in the officials CME Holiday Calendars (https://www.cmegroup.com/tools-information/holiday-calendar.html). For these reason, most of the CME group assets needed an update in its early closes and holidays entries in MHDB.In order to update the MHDB, we used a Python notebook since there was a library called
pandas_market_calendars
(https://pypi.org/project/pandas-market-calendars/) that claimed to contain holiday and early closes dates for most of the markets. After, manually checking these dates were correct, we removed the ones that were not holidays from the general CME Future entry in MHDB and searched for which futures they were indeed holidays. We found that some of them were holidays for CME asset classes such as Energy, Metals, Grains, Livestock and Dairy, so we add those dates in their respective entries in MHDB.On the other hand, another bug it was found that was for some CME Future assets, though the timezone was America/New York their early closes were in America/Chicago timezone (the CME Futures class of all of those found assets was Equity). Therefore, the early-closes entry of them were also updated.
In the beginning it was wanted a script that given one CME Group asset( or more), could return a new MHDB with its holidays and its early closes updated. However, due to uncertainty of the library veracity, the purpose of the script was changed so that it could be useful verifying the veracity of the holidays and early-closes dates. Still, that script realized to fix the underlying GH issue can be modified to fulfill its initial purpose (see https://colab.research.google.com/drive/1YhzVAeJnhRCujruuhu9jlOaoWldrS3tt?usp=sharing).
To sum up:
Futures-cme-[*]
in MHDB were removed. The dates that were holidays for other CME Group Futures classes were added in the entries of the products of that class.This changes were made using the following collaborative notebook: https://colab.research.google.com/drive/1YhzVAeJnhRCujruuhu9jlOaoWldrS3tt?usp=sharing
Related Issue
Closes #7501
Motivation and Context
With this change users will have more accurate data about the early closes and holidays of CME Group Futures
Requires Documentation Change
N/A
How Has This Been Tested?
The holidays and early-closes dates given by
pandas_market_calendars
library were manually asserted to be holidays or early closes using the files from CME Group Holiday Calendars (https://www.cmegroup.com/tools-information/holiday-calendar.html)Types of changes
Checklist:
bug-<issue#>-<description>
orfeature-<issue#>-<description>