Skip to content

Commit 2b2dcb9

Browse files
authored
Merge pull request #478 from Jaco-Ren/fix/477-cme-equity-market-pause
Fix CME equity market pause cutover
2 parents 2892885 + 66ba60a commit 2b2dcb9

4 files changed

Lines changed: 70 additions & 1 deletion

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Issue 477 CME Equity Market Pause Plan
2+
3+
## Current Step
4+
5+
4. Run focused plus full validation. Completed.
6+
7+
## Plan
8+
9+
1. Reproduce the obsolete post-cutover pause and confirm the historical boundary. Completed.
10+
2. Add focused schedule, open-state, and intraday-grid regression tests around the cutover. Completed.
11+
3. Add a date-effective CME equity-hours transition that preserves the pre-2021 pause. Completed.
12+
4. Run focused plus full validation. Completed.
13+
14+
## Assumptions
15+
16+
- CME's June 2021 Globex notice is authoritative for the June 28, 2021 trade-date cutover.
17+
- Historical sessions before the cutover must retain the 15:15-15:30 CT pause.
18+
- A zero-length break at the former 15:15 CT pause boundary preserves the established schedule schema without
19+
removing any tradable time.
20+
21+
## Validation
22+
23+
- The two new regression tests failed before the implementation and passed afterward.
24+
- Focused CME equity and source tests: 25 passed.
25+
- Fast suite: 1492 passed and 1 failed; the only failure was the existing timezone-sensitive
26+
`test_valid_days_tz_aware` NYSE baseline already documented on `dev`.
27+
- Ruff lint and format checks passed for all changed Python files.
28+
- `git diff --check` passed with CRLF treated as a valid line ending.

‎pandas_market_calendars/calendars/cme.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
CME_EQUITY_LEGACY_HOURS_START = "2005-09-12"
6262
CME_EQUITY_MODERN_HOURS_START = "2012-11-19"
63+
CME_EQUITY_MARKET_PAUSE_END = "2021-06-28"
6364

6465

6566
class CMETradeDateCalendar(MarketCalendar):
@@ -117,7 +118,8 @@ class CMEEquityExchangeCalendar(MarketCalendar):
117118
118119
Open Time: 5:00 PM, America/Chicago
119120
Close Time: 4:00 PM, America/Chicago
120-
Break: 3:15 - 3:30pm America/Chicago
121+
Market pause through June 25, 2021: 3:15 - 3:30pm America/Chicago
122+
No intraday pause from trade date June 28, 2021
121123
"""
122124

123125
aliases = ["CME_Equity", "CBOT_Equity"]
@@ -141,6 +143,8 @@ class CMEEquityExchangeCalendar(MarketCalendar):
141143
(None, time(15, 30)),
142144
(CME_EQUITY_LEGACY_HOURS_START, time(15, 15)),
143145
(CME_EQUITY_MODERN_HOURS_START, time(15, 30)),
146+
# Preserve the schedule columns while representing continuous trading.
147+
(CME_EQUITY_MARKET_PAUSE_END, time(15, 15)),
144148
),
145149
}
146150

‎pandas_market_calendars/sources.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ class Source(NamedTuple):
151151
last_verified="2025-01-24",
152152
covers="trading hours",
153153
),
154+
Source(
155+
name="CME Globex Equity Market Pause Elimination Notice",
156+
url="https://www.cmegroup.com/notices/electronic-trading/2021/06/20210621.html",
157+
last_verified="2026-08-12",
158+
covers="historical trading hours",
159+
),
154160
),
155161
"CME_Agriculture": (
156162
Source(

‎tests/test_cme_equity_calendar.py‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
from datetime import time
2+
13
import pandas as pd
24
from zoneinfo import ZoneInfo
35

6+
import pandas_market_calendars as mcal
47
from pandas_market_calendars.calendars.cme import CMEEquityExchangeCalendar, CMETradeDateCalendar
58

69

@@ -92,6 +95,34 @@ def test_historical_trade_date_time_helpers_match_schedule_cutovers():
9295
assert cme.break_end_on("2012-11-19").minute == 30
9396

9497

98+
def test_equity_market_pause_eliminated_on_june_28_2021():
99+
cme = CMEEquityExchangeCalendar()
100+
schedule = cme.schedule("2021-06-25", "2021-06-28", tz=cme.tz)
101+
102+
before_cutover = schedule.loc["2021-06-25"]
103+
after_cutover = schedule.loc["2021-06-28"]
104+
105+
assert before_cutover.break_start == pd.Timestamp("2021-06-25 15:15:00", tz=cme.tz)
106+
assert before_cutover.break_end == pd.Timestamp("2021-06-25 15:30:00", tz=cme.tz)
107+
assert after_cutover.break_start == after_cutover.break_end
108+
assert after_cutover.break_end == pd.Timestamp("2021-06-28 15:15:00", tz=cme.tz)
109+
assert cme.break_end_on("2021-06-25") == time(15, 30)
110+
assert cme.break_end_on("2021-06-28") == time(15, 15)
111+
112+
assert cme.open_at_time(schedule, "2021-06-25 15:20:00-05:00") is False
113+
assert cme.open_at_time(schedule, "2021-06-28 15:20:00-05:00") is True
114+
115+
116+
def test_equity_market_pause_cutover_preserves_intraday_bars():
117+
cme = CMEEquityExchangeCalendar()
118+
schedule = cme.schedule("2021-06-25", "2021-06-28", tz=cme.tz)
119+
bars = mcal.date_range(schedule, "5min")
120+
121+
for minute in (20, 25, 30):
122+
assert pd.Timestamp(f"2021-06-25 15:{minute}:00", tz=cme.tz) not in bars
123+
assert pd.Timestamp(f"2021-06-28 15:{minute}:00", tz=cme.tz) in bars
124+
125+
95126
def test_2023_good_friday_has_early_close_session():
96127
cme = CMEEquityExchangeCalendar()
97128
schedule = cme.schedule("2023-04-06", "2023-04-10", tz="America/New_York")

0 commit comments

Comments
 (0)