Skip to content

Fix index futures June 2027 expiry by adding observed Juneteenth holiday - #9572

Merged
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
AlexCatarino:bug-7164-juneteenth-2027-expiry
Jul 2, 2026
Merged

Fix index futures June 2027 expiry by adding observed Juneteenth holiday#9572
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
AlexCatarino:bug-7164-juneteenth-2027-expiry

Conversation

@AlexCatarino

@AlexCatarino AlexCatarino commented Jun 30, 2026

Copy link
Copy Markdown
Member

Description

Juneteenth 2027 (June 19) falls on a Saturday and is therefore observed on Friday June 18, 2027 — which is also the third Friday of June 2027. The futures entries in the market hours database tracked Juneteenth through 6/19/2026 but were missing 6/18/2027.

Index futures expiries computed via ThirdFriday(time, contract) move the third Friday back one business day when it is a holiday (holidays ∪ bankHolidays). Because 6/18/2027 was absent, the expiry was not moved back, so the June 2027 contract was created as ES18M27 instead of the correct ES17M27 (CME last trade date is 17 Jun 2027). This affects all index futures using the holiday-adjusted third Friday: ES, NQ, YM, RTY and their micros (MES, MNQ, MYM, M2K).

This is the same class of fix as #7164.

Changes

  • Data/market-hours/market-hours-database.json: add the observed Juneteenth 6/18/2027 alongside every existing 6/19/2026 entry (earlyCloses, lateOpens, bankHolidays, holidays). The change only touches entries that already observe Juneteenth, leaving non-US markets untouched.
  • Tests/TestData/FuturesExpiryFunctionsTestData.xml: add a June 2027 regression contract (last trade 2027-06-17) for ES, NQ, YM, RTY, MES, MYM.

Early close vs. full close

6/18/2027 was intentionally added to earlyCloses (13:00 ET), matching how equity index futures treat Juneteenth — an early close, not a full-day closure:

  • CME equity index futures fully close only on New Year's Day, Good Friday, Thanksgiving, and Christmas; MLK, Presidents Day, Memorial Day, Juneteenth, and Independence Day are early halts (~12:00 CT / 13:00 ET). See CME Group Holiday and Trading Hours and CME Trading Hours 2026 breakdown.
  • This matches the existing data: every prior Juneteenth (6/19/20236/19/2026) is in earlyCloses + bankHolidays, not the full-close holidays array. 6/19/2026 is itself a Friday Juneteenth — the direct analog of 2027.
  • Observed-on-Friday precedent agrees: July 4, 2020 (Saturday) → observed Friday July 3, 2020, recorded as an early close.
  • The cash equity market (NYSE) is fully closed on Juneteenth, which is already reflected in the Equity-usa entry; the equity index futures differ.
  • The official CME 2027 calendar is not published yet (finalized ~2 weeks prior), so this follows the established pattern.

Regardless of the early/full-close distinction, the expiry fix is driven by bankHolidays, so ESM27 correctly rolls to June 17.

Verification

  • Confirmed June 18, 2027 is a Friday and June 19 is a Saturday (observed Juneteenth on the 18th); the Equity-usa entry already carried 6/18/2027.
  • FuturesExpiryFunctionsTests passes 191/191, including the new 2027-06-17 cases for the affected index futures.

🤖 Generated with Claude Code

Juneteenth 2027 (June 19) falls on a Saturday and is observed on Friday
June 18, 2027, which is also the third Friday of June 2027. The futures
market hours database tracked Juneteenth through 6/19/2026 but was missing
6/18/2027, so ThirdFriday-based index expiries (ES, NQ, YM, RTY and their
micros) were not moved back, producing e.g. ES18M27 instead of ES17M27.

Add 6/18/2027 alongside every existing 6/19/2026 entry (earlyCloses,
lateOpens, bankHolidays, holidays). Same class of fix as QuantConnect#7164.

Add June 2027 regression contracts (last trade 2027-06-17) for ES, NQ,
YM, RTY, MES, MYM in the expiry test data.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Martin-Molinero
Martin-Molinero merged commit 02948bf into QuantConnect:master Jul 2, 2026
7 of 8 checks passed
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.

3 participants