Complete the CME holiday calendars through 2029 - #9733
Open
AlexCatarino wants to merge 1 commit into
Open
Conversation
AlexCatarino
force-pushed
the
bug-cme-memorial-day-bank-holidays
branch
from
August 20, 2026 19:24
def3de6 to
62baa26
Compare
AlexCatarino
force-pushed
the
bug-cme-memorial-day-bank-holidays
branch
from
August 21, 2026 18:10
62baa26 to
eeed880
Compare
The CME, CBOT, NYMEX and COMEX calendars were complete only through 2026.
Past that the whole family carried nothing but New Year's Day 2027 and the
observed Juneteenth 2027, so every session and every expiry computed beyond
2026 treated the rest of the calendar as ordinary business days. Memorial Day
and Good Friday were missing outright, and the remaining thirteen holidays
were absent for 2027-2029.
All fifteen holidays are now filled in for 2027, 2028 and 2029 across the 186
per-ticker entries, plus Columbus Day and Veterans Day on the four market-wide
entries. Each entry keeps its own schedule: a shortened session closes at the
time that entry already uses, grains reopen at 19:00 where equity index reopens
at 18:00, and livestock stays shut for the whole date because it has no evening
session to reopen into.
Two details drive the differences between years:
* A holiday falling on a Friday closes the entire date, because there is no
evening session after it. Monday through Thursday it is a bank holiday with
a late open instead. Christmas 2027 is observed on Friday 24 December and
is a full close; Christmas 2028 falls on a Monday and is not.
* New Year's Day 2028 falls on a Saturday. CME trades Friday 31 December 2027
to its regular close, so that date is a bank holiday with no early close,
matching 31 December 2021. There is no Christmas Eve early close in 2028
either, since 24 December is a Sunday.
Memorial Day and Good Friday were verified live against Interactive Brokers.
Before the change IB rejected GC/SI May-2027 and May-2028 with error 200 "No
security definition has been found", because LEAN asked for 2027-05-27 and
2028-05-29 - the latter is Memorial Day itself; and it rejected NG28J29 and
HH28J29 at 2029-03-28, an isolated rejection inside an otherwise continuous
chain, which is the signature of a wrong date rather than a listing window.
After the change all of them resolve and stream. CME's published calendar
confirms the new dates: the 1-Ounce Gold JUN 2027 and JUN 2028 contracts, which
use the same third-last-business-day-of-the-prior-month rule, last trade on
26 May 2027 and 26 May 2028.
Good Friday is not unconditionally a full CME close. When it carries the
Employment Situation release, CME runs an abbreviated session for the financial
products and closes everything else. The data already said so for 7 April 2023
and 3 April 2026, where the early close is recorded per ticker and the date is
deliberately absent from the market-wide entry. The four earlier ones - 2 April
2010, 6 April 2012, 3 April 2015 and 2 April 2021 - were still listed as
holidays on Future-cbot-[*]. Every per-ticker entry is unioned with its market
entry, so that full close overrode the early close those same products record
for themselves: ZB, ZN, ZF, ZT, UB, TN, 10Y, 2YY, 30Y and 5YY each carry 10:15
on all six of those dates, and YM and MYM carry 09:15, yet all twelve were
reported shut for the whole day on four of them. They now trade the abbreviated
session, and the date counts as a business day for their expiries, as it already
did for 2023 and 2026. The dates move onto the eleven CBOT products that really
are closed - the grains, oilseeds and ethanol - so nothing changes for them.
This is the same holiday-versus-early-close mix-up QuantConnect#9205 fixed for the Dairy,
Livestock and Lumber calendars.
None of 26 March 2027, 14 April 2028 or 30 March 2029 carries an Employment
Situation release, so all three are full closes for every product. The next
Good Fridays that do are 7 April 2034 and 3 April 2037.
Also filled in the gaps the same comparison exposed:
* CME agricultural, livestock and dairy - CB, CSC, DC, DY, GDK, GNF, GF, HE
and LE - had no record at all for 2010 or 2012 and so were reported open,
though every later Good Friday closes them. LBR was likewise open on
7 April 2023.
* F1U had no calendar of its own, so removing the market-wide date would have
left it open. It is the 5-Year USD MAC Swap, so it takes the 10:15 close its
ten CBOT rate siblings use.
* M6C, M6J and M6S were missing 3 April 2026 that 6C, 6J and 6S record; MJY was
missing 3 April 2015; RX was missing 3 April 2026.
* GD, MIB and MRB recorded 2 April 2021 as "8:15:00", the only three values in
the file without the leading zero.
MTN, MWN and 1OZ, added by QuantConnect#9692 while this branch was open, were given the
calendars of the entries they were copied from: MTN and MWN take Future-cbot-TN,
which they matched date for date, and 1OZ takes Future-comex-MGC, likewise. That
keeps them on the same schedule after the change as before it, and gives the two
CBOT rate products the abbreviated Good Friday session their siblings get.
The dates for 2027 match CME's published holiday notes exactly. 2028 and 2029
are projected: for each entry and holiday the shape is taken from the most
recent year that fell on the same kind of weekday, and the early-close time from
the most recent year outright, since CME keeps moving those - energy went from
14:30 to 13:00 for Independence Day in 2025 and for Juneteenth in 2026.
Projecting 2026 from 2025 and earlier reproduces 91.4% of the recorded values
exactly, and the model abstains rather than guessing where it has no precedent.
Eight recorded rows in FuturesExpiryFunctionsTestData.xml encoded the old
behaviour and are corrected. Two of them, BK and CSX for the May-2027 contract,
expected trading to cease on 2027-05-31, which is Memorial Day - a date those
contracts cannot settle on. HH moves for its June-2027, June-2028 and April-2029
contracts. The last two are BK and CSX for December 2027, which cease trading on
the last business day of the contract month, now the 30th rather than the 31st,
and HH's January 2028 contract, which moves from the 29th to the 28th. December
2021 was the same situation and is already recorded that way.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
AlexCatarino
force-pushed
the
bug-cme-memorial-day-bank-holidays
branch
from
August 28, 2026 13:52
219583e to
bce60f9
Compare
This file contains hidden or 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
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.
Fill in the CME, CBOT, NYMEX and COMEX holiday calendars for 2027, 2028 and 2029, and correct how Good Friday is recorded on Employment Situation release days.
Description
The CME-family calendars were complete only through 2026. Everything past that was
1/1/2027, the observed Juneteenth6/18/2027, and nothing else, so every session and every expiry computed beyond 2026 counted the rest of the calendar as ordinary business days. Futures reach a lot further than that: Henry Hub Natural Gas is listed monthly for the next twelve years.All fifteen holidays are now filled in for 2027-2029 across the 183 per-ticker entries, plus Columbus Day and Veterans Day on the four market-wide entries. 12,384 dates in total. Each entry keeps its own schedule rather than being flattened onto the market entry: a shortened session closes at the time that entry already uses, grains reopen at 19:00 where equity index reopens at 18:00, and livestock stays shut for the whole date because it has no evening session to reopen into.
Two details drive the differences between years.
bankHolidays+ a 19:00 late open in 2023, 2024 and 2025, and a plain holiday in 2026 when it lands on a Friday.Good Friday
Good Friday is not unconditionally a full close. When it carries the Employment Situation release CME runs an abbreviated session for the financial products and closes everything else, which is why
Future-cme-[*]deliberately omits4/2/2010,4/6/2012,4/3/2015,4/2/2021,4/7/2023and4/3/2026.Future-cbot-[*]still listed the first four as full holidays. Since every per-ticker entry is unioned with its market entry, that overrode the early close those same products record for themselves: ZB, ZN, ZF, ZT, UB, TN, 10Y, 2YY, 30Y and 5YY each carry10:15on all six of those dates and YM and MYM carry09:15, yet all twelve were reported shut for the whole day on four of them. The dates now sit on the eleven CBOT products that really are closed, so nothing changes for the grains, oilseeds and ethanol. Same holiday-versus-early-close mix-up #9205 fixed for the Dairy, Livestock and Lumber calendars.The same comparison exposed further gaps, all fixed here:
4/7/2023.10:15close its ten CBOT rate siblings use.4/3/2026that 6C, 6J and 6S record; MJY was missing4/3/2015; RX was missing4/3/2026.4/2/2021as8:15:00, the only three values in the file without the leading zero.Every Good Friday is now consistent across all six Employment Situation years, and the non-release ones are a full close for all 187 tickers. None of 2027-2029 carries a release, so all three are full closes; the next that do are 7 April 2034 and 3 April 2037, which will need the 2026 treatment.
Notes
Future-cfe-[*]still stops at12/25/2026with an emptybankHolidays, so VX has the same cliff this removes for the CME family. Left for a separate change.Related Issue
n/a
Motivation and Context
Keeps LEAN's trading calendars and futures expiry dates correct past 2026 for the CME family, and stops twelve CBOT products being reported closed on days they actually traded.
Requires Documentation Change
N/A. The QuantConnect/Documentation repo regenerates MHDB-related docs on a weekly schedule.
How Has This Been Tested?
FuturesExpiryFunctionsTests,MarketHoursDatabaseTests,SecurityExchangeHoursTests,SymbolPropertiesDatabaseTests,SymbolRepresentationTests- 522/522 pass.Three recorded rows in
FuturesExpiryFunctionsTestData.xmlmove, all in December 2027 and all because 31 December is now a bank holiday. BK and CSX cease trading on the last business day of the contract month, so December 2027 goes from the 31st to the 30th, and HH's January 2028 contract goes from the 29th to the 28th. December 2021 was the same situation and is already recorded that way: BK and CSX on2021-12-30, HH's January 2022 contract on2021-12-28. No other recorded row moves, and the Good Friday correction moves none at all.The earlier Memorial Day work was also verified live against Interactive Brokers (paper) by subscribing to every enumerable contract of a set of roots and seeing which IB resolves, with SIL as a positive control. GC and SI May-2027 and May-2028 were rejected before the change and resolve after;
HH26M27andNG26M27stream on2027-05-26,HO28M27andRB28M27on2027-05-28.Types of changes
Checklist: