Skip to content

Add the published 2027 CME holiday dates and hours - #9733

Open
AlexCatarino wants to merge 4 commits into
QuantConnect:masterfrom
AlexCatarino:bug-cme-memorial-day-bank-holidays
Open

Add the published 2027 CME holiday dates and hours#9733
AlexCatarino wants to merge 4 commits into
QuantConnect:masterfrom
AlexCatarino:bug-cme-memorial-day-bank-holidays

Conversation

@AlexCatarino

@AlexCatarino AlexCatarino commented Aug 20, 2026

Copy link
Copy Markdown
Member

Fill in the 2027 holiday calendar for the CME, CBOT, NYMEX and COMEX entries, from CME's published schedule.

Description

The CME-family calendars carried nothing for 2027 beyond New Year's Day and the observed Juneteenth, so every session and every expiry computed into 2027 counted the rest of the year as ordinary business days.

Every 2026 record is carried to its 2027 counterpart - the same offset from the same named holiday, written into the same field - and the times come from the per-product schedule CME publishes through the endpoint behind its trading-hours page:

/services/trading-hours-by-product?fromEventDate=&toEventDate=

which serves 2026 and 2027 and no other years - exactly CME's publication window. The layout follows 2026: every holiday sits on the per-ticker entries, and the four market-wide entries carry only Good Friday, Columbus Day and Veterans Day.

Dates are confirmed twice over: each appears in OPM's published 2027 federal holiday schedule, and CME's 2027 holiday notes state the trade dates around it. Good Friday reads "No trading for Friday March 26th trade date"; Christmas gives Thursday the 23rd as the last trade date; the 2028 New Year note confirms Friday 31 December 2027 trades to its regular close and enters bankHolidays only, matching 31 December 2021.

Three rules the data has to respect, each learned from a wrong first draft:

  • Full closes are mirrored from 2026, never inferred. The feed publishes no events for products it has no schedule for, and reading that as "does not trade" invents closures - it put Columbus Day holidays on TPY and TPD, which no entry carries in any year.
  • A holiday that changes weekday changes shape. Independence Day moves from a Friday observance to a Monday one, so it moves from holidays to bankHolidays for dairy, gains the evening reopens a Friday cannot have, and takes the published Monday times - crude oil closes 14:30, not the 13:00 it used in 2026.
  • The calendar day before a holiday carries the early close that cancels the evening session. 102 entries hold one on Holy Thursday, and the grain, dairy and lumber entries hold one before each Monday holiday, as they do in 2026.

The final commit replays every 2027 record against the published schedule and aligns the 22 that disagreed, including the twelve CBOT rate products, which close 13:30 on Independence Day 2027 where their other Monday holidays use 12:00 - a difference CME publishes, not a recording choice.

Notes

  • The change is additive and forward-only: nothing removed, every touched date inside the September 2026 to December 2027 window, with one deliberate exception - YO's pre-existing 6/18/2027 early close moves from 12:00 to 16:00, because the published schedule shows YO trading an ordinary Friday in 2027, unlike 2026. It is a future date inside the window this PR is allowed to touch.
  • Verified against the feed record by record: every early close, late open and closure in the window agrees with the published schedule. The only products not comparable are nine whose feed entries are placeholders (16:01 pre-open, 16:02 open) - they take their 2026-mirrored values.
  • HRC and RX, unmaintained since 2019 and 2023, are filled back in from the feed for the whole window, Labor Day 2026 onward. On all thirty-one dates checked HRC publishes exactly crude oil's schedule and RX exactly the E-mini S&P's, and their own last records already match those peers to the minute, so each takes its peer's 74 window records verbatim.
  • MRB cannot be fixed: the feed's MRB is Micro RBOB Gasoline, while this database's Future-cme-MRB is BTIC Micro Ether, unmaintained since 2022 - the same code on two different products. There is no published source for the entry we hold, and no entry at all for the product CME now calls MRB. Both are follow-up work, as are the remaining stale entries the feed does not serve (CSW, HCL, M5F and similar).
  • EarlyClosesAndLateOpensFallOnTradingDays is added to MarketHoursDatabaseTests: it sweeps every resolved entry from 2026 forward and fails on an early close or late open stranded on a holiday or a non-trading weekday - the failure mode of carrying records across a weekday shift.
  • 2028 and later are not included. The endpoint returns nothing for them, so they could only be projected.

Related Issue

n/a

Motivation and Context

Keeps trading sessions and futures expiry dates correct through 2027 for the CME family.

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 - 532/532 pass, including the new sweep test.

Six recorded expiries move, all 2027 contracts. Each matches a 2021 contract in exactly the same weekday configuration that is already recorded that way:

Contract Was Now Precedent already in the file
BK, CSX May 2027 2027-05-31 2027-05-28 2021-05-28, Memorial Day on the 31st
BK, CSX Dec 2027 2027-12-31 2027-12-30 2021-12-30, New Year observed Friday
HH Jun 2027 2027-05-27 2027-05-26 2021-05-26
HH Jan 2028 2027-12-29 2027-12-28 2021-12-28

Both expiry rules were replayed independently over every recorded row for those three roots: 106 of 108, 103 of 105 and 149 of 151 reproduce the recorded value exactly, and the only differences are the six above.

🤖 Generated with Claude Code

@AlexCatarino
AlexCatarino force-pushed the bug-cme-memorial-day-bank-holidays branch from def3de6 to 62baa26 Compare August 20, 2026 19:24
@AlexCatarino AlexCatarino changed the title Add Memorial Day 2027-2031 to the CME bank holiday calendars Extend the CME holiday calendars past 2026 (Memorial Day and Good Friday) Aug 20, 2026
@AlexCatarino
AlexCatarino force-pushed the bug-cme-memorial-day-bank-holidays branch from 62baa26 to eeed880 Compare August 21, 2026 18:10
@AlexCatarino AlexCatarino changed the title Extend the CME holiday calendars past 2026 (Memorial Day and Good Friday) Complete the CME holiday calendars through 2029 Aug 21, 2026
@AlexCatarino
AlexCatarino force-pushed the bug-cme-memorial-day-bank-holidays branch 2 times, most recently from bce60f9 to ddf4acb Compare August 31, 2026 14:07
@AlexCatarino AlexCatarino changed the title Complete the CME holiday calendars through 2029 Add the published 2027 CME holiday dates Aug 31, 2026
@AlexCatarino
AlexCatarino force-pushed the bug-cme-memorial-day-bank-holidays branch 2 times, most recently from 1c8dfea to 3b2ec93 Compare August 31, 2026 14:36
@AlexCatarino AlexCatarino changed the title Add the published 2027 CME holiday dates Add the published 2027 CME holiday dates and hours Aug 31, 2026
@AlexCatarino
AlexCatarino force-pushed the bug-cme-memorial-day-bank-holidays branch 2 times, most recently from d4b9b9e to 5b67b7e Compare August 31, 2026 18:46
AlexCatarino and others added 3 commits September 2, 2026 14:29
The CME, CBOT, NYMEX and COMEX calendars carried nothing for 2027 beyond New
Year's Day and the observed Juneteenth, so every session and every expiry
computed into 2027 counted the rest of the year as ordinary business days.

Every 2026 record is carried to its 2027 counterpart - the same offset from the
same named holiday, written into the same field - and the times come from CME's
published 2027 schedule wherever it covers the product and date. Nothing on or
before today is touched, nothing is removed, and no existing value changes.

Full closes are only ever mirrored from 2026, never inferred. CME's feed
publishes no events for a product it has no schedule for, and reading that as
"the product does not trade" put Columbus Day and Veterans Day closures on TPY
and TPD, which no entry in this database has in any year for those dates.

Dates confirmed twice over, in OPM's published 2027 federal holiday schedule and
in CME's own 2027 holiday notes:

  Full closes, where CME states there is no trade date at all:

    1/1/2027    New Year's Day
    3/26/2027   Good Friday - "No trading for Friday March 26th trade date"
    12/24/2027  Christmas, observed Friday; last trade date is Thursday the 23rd

  Bank holidays, where CME trades but the banks are closed: 1/18 MLK, 2/15
  Washington's Birthday, 5/31 Memorial, 6/18 Juneteenth observed, 7/5
  Independence observed, 9/6 Labor, 10/11 Columbus, 11/11 Veterans, 11/25
  Thanksgiving, and 12/31 for New Year's Day 2028 observed. That last one has no
  2026 counterpart, since New Year's Day 2026 was the 1st itself, so it is placed
  on the entries that treat New Year's Day as a bank holiday, matching 2021.

Per-product hours come from CME's own published 2027 schedule, served by

  /services/trading-hours-by-product?fromEventDate=&toEventDate=

for 2026 and 2027 and no other years, which is exactly CME's publication window.
Each product's published 2027 event signature is matched against that same
product's 2026 holidays, whose treatment this database already records from CME's
published 2026 calendar.

The layout follows 2026: every holiday sits on the per-ticker entries, and the
four market-wide entries carry only Good Friday, Columbus Day and Veterans Day.
No date is duplicated between a ticker and its market entry, and none appears in
both holidays and bankHolidays, an overlap this file has nowhere else.

Two things a partial mirror would have missed, and one a projection would:

  * Livestock has no Sunday segment, so a full close is the only way it can be
    shut. LE, HE, GF and LBR keep all ten of the full closures they hold in 2026.
  * The early close on the calendar day before a holiday cancels the evening
    session. 102 entries carry one on Holy Thursday 2026 and now do for 25 March
    2027, and the grain, dairy and lumber entries carry one before each Monday
    holiday.
  * Crude oil closes at 14:30 on Independence Day 2027, not the 13:00 it uses in
    2026, and reopens at 18:00 where 2026 has no reopen at all, because the
    holiday is observed on a Monday rather than a Friday.

The eight remaining 2026 holidays were checked against the same source: 883 of
883 recorded values agree, so nothing before 2027 changes.

Six recorded expiries move, all 2027 contracts, each matching a 2021 contract in
the same weekday configuration already recorded that way:

  BK, CSX  May 2027   05-31 -> 05-28   cf. 2021-05-28, Memorial Day on the 31st
  BK, CSX  Dec 2027   12-31 -> 12-30   cf. 2021-12-30, New Year observed Friday
  HH       Jun 2027   05-27 -> 05-26   cf. 2021-05-26
  HH       Jan 2028   12-29 -> 12-28   cf. 2021-12-28

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The 2027 calendar was built by carrying each 2026 record to its counterpart at the
same offset from the same named holiday. That offset is in calendar days, so every
holiday whose weekday moved between the two years carried its record onto the wrong
day, and nothing was written where the new weekday needs a record 2026 had no reason
to hold.

Sessions that were modelled wrongly:

  7/6/2027 was a full close on 29 FX entries. Independence Day 2027 is observed on
  Monday the 5th, which this file already records; the 6th is an ordinary Tuesday.
  It came from 7/4/2026, the Saturday one day after that year's Friday observance.
  Nothing replaces it, because Sunday 7/4/2027 carries a live evening session for
  all 29.

  24 entries held a 7/5/2027 early close and no late open, leaving the session that
  runs into Monday open from midnight rather than shut until 17:00 or 18:00. The
  2026 observance was a Friday and rightly carries no reopen, so there was nothing
  to carry forward. Each entry takes its own 9/6/2027 value, which is what all 139
  entries already holding 7/5/2027 use and what 23 of these 24 use for 7/5/2021.

  Seven dairy entries held 7/5/2027 in holidays as well as the 17:00 late open they
  already carry, closing a day they trade. A Monday observance belongs in
  bankHolidays, where these entries put 1/18, 2/15, 5/31 and 9/6/2027, and 7/5/2021
  and 7/4/2022. It was carried from 7/3/2026, where holidays is correct because no
  evening session follows a Friday close.

  1OZ and MGT closed 7/5/2027 at 13:00 and MNH at 12:00, the 2026 Friday-observed
  times, where every peer took the published Monday times of 14:30 and 16:00.

  21 entries closed 12/23/2027 at the abbreviated Christmas Eve time carried from
  12/24/2026. Christmas 2027 is a Saturday observed on Friday the 24th, so the 23rd
  is a full session whose only distinction is that no evening session follows it.
  The 16 with an evening session take the time their same-shaped peers use to
  suppress it; the five livestock entries have no evening session and need no
  record at all.

Records removed, each inert because a holiday already closes the day:

  70 Good Friday early closes on 3/26/2027, carried from 4/3/2026. That date was
  the first Friday of the month and carried the Employment Situation release, so
  CME ran an abbreviated session; 2027 is not, so it is a full close, which the
  four market entries already record. No entry carries an early close on 4/18/2025,
  the previous ordinary Good Friday.

  163 late opens on 1/1/2027, a Friday with no evening session to reopen, and 15
  records on 1/2/2027, a Saturday.

The 7/5/2027 late opens had been appended after 11/25/2027, so lateOpens is back in
date order for the 163 entries that carry one.

EarlyClosesAndLateOpensFallOnTradingDays sweeps every entry and fails on an early
close or late open that lands on a holiday or on a weekday that never trades. It
catches every removal above. Entries written before 2026 hold thousands of records
of this shape, so the sweep starts at 2026.

Nothing outside 2027 is touched: 308 records removed and 50 added, all in 2027.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replaying every 2027 record against the per-product schedule CME publishes
through the trading-hours endpoint turned up 22 records where a value carried
from a sibling holiday or a differently-shaped 2026 date disagrees with what CME
states for the day itself. Each is set to the published value.

  ZB, ZN, ZF, ZT, UB, TN, MTN, MWN, 10Y, 2YY, 30Y and 5YY close 13:30 on
  Independence Day 2027, not the 12:00 their other Monday holidays use. CME
  publishes 12:00 for Memorial Day and Labor Day 2027 and 13:30 for July 5th,
  so the difference is the exchange's, not a recording slip.

  The six dairy entries close Sunday July 4th at 16:00, the value both this file
  and the feed give every other Sunday before a Monday holiday, including
  5/30/2027. The 13:55 came from Thursday 7/2/2026, the eve of a Friday
  observance, which is a different shape.

  IBV and E3G close 12:15 Central on 23 December 2027 while every peer runs to
  its regular close. The published schedule singles them out; the suppress-the-
  evening value they carried does not.

  YO does not trade a shortened Juneteenth in 2027: the feed shows an ordinary
  Friday closing at its regular 16:00, unlike 2026 when it closed at 12:00. This
  is the one change to a value that predates this branch - master already held
  12:00, written before CME published the year. It is a future date inside the
  window this work is allowed to touch.

  YO is dark on Monday holidays until its 17:00 reopen, as its 2026 records
  show with a late open and no early close. The 12:00 early close it was given
  alongside the 17:00 late open described a market closed for the whole day,
  evening included. The early close goes; the late open stays.

Every other early close, late open and closure in 2027 now agrees with the
published schedule exactly; the only products that cannot be compared are the
nine whose feed entries are placeholders and the three stale entries this
branch leaves untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AlexCatarino
AlexCatarino force-pushed the bug-cme-memorial-day-bank-holidays branch from 749225c to e295672 Compare September 2, 2026 13:32
HRC and RX stopped being maintained in 2019 and 2023, so they modelled every
holiday from here forward as an ordinary full session - starting with Labor Day,
five days from now.

Both are served by CME's per-product feed, which puts them back in reach. On
every date from September 2026 through December 2027 - holidays, eves and a
normal-day baseline, thirty-one dates in both years - HRC publishes exactly the
same event schedule as crude oil, and RX exactly the same as the E-mini S&P.
Their own last records agree: HRC's 2019 early closes are CL's values to the
minute, and RX's 2023 values are ES's. Each therefore takes its peer's records
for the window, 74 in all, copied verbatim since both pairs share the New York
time zone. Every copied date was individually verified equivalent in the feed
first, and the result replays cleanly against the published schedule.

No recorded HRC expiry lands in the window, so the expiry test data is
unchanged. These are the first records in this branch dated before 2027; all six
2026 dates are in the future, inside the September 2026 to December 2027 window
this work is scoped to.

MRB stays untouched, for a reason worth recording: the feed's MRB is Micro RBOB
Gasoline, an energy product, while this database's Future-cme-MRB is BTIC Micro
Ether, whose records end in late 2022. Same code, different products - there is
no published source for the entry we hold, and the entry for the product CME now
calls MRB does not exist here. Both halves are follow-up work.

Also removes the per-ticker 3/26/2027 from the 108 entries that carried it
alongside the market-wide record. A Good Friday without the Employment
Situation release is a full close for every product and lives only on the four
market entries - 4/18/2025 and 3/29/2024 have no per-ticker copies - and the
duplication contradicted how this branch describes its own layout. Every entry
remains fully closed through the market entries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant