23/5 Trading: US Equities Market-Data Pipeline Fixes
23/5 trading for US equities starts December 6, 2026 with a 9 PM-4 AM ET overnight session. Rebuild your session calendar, gap alerts and backtests.

Starting 6 December 2026 (planned), US stocks gain a 9 PM to 4 AM ET overnight session and lose everything except a one-hour pause from 8 PM to 9 PM ET. Any market-data pipeline that equates a trading day with a calendar date is about to file ticks under the wrong day.
I run market-data capture for a living, and one of my systems records crypto around the clock. Crypto taught me the lesson the hard way, and it was never about volume. The first time I ran a nonstop capture, my daily bars were wrong for weeks before I noticed, because my code kept cutting "the day" at UTC midnight. Nothing crashed. The numbers were just quietly off, and a restart that replayed buffered ticks without dedup doubled a chunk of one afternoon's volume. I only spotted that because a bar's volume looked absurd next to the exchange's own figure.
Equities are now walking into that same trap. On the planned date the US consolidated feeds and Nasdaq move to about 23 hours a day, five days a week. Below is what that does to a backend, and the Spring Boot and QuestDB setup I would use to absorb it: a session calendar, gap alerts that understand the pause, sequence handling around reconnects, a migration plan for history you already stored, and daily bars that do not get polluted.
On the date: Nasdaq tied the switch to feed readiness and pending SEC rule changes, and I am writing a day before the planned start. The Nasdaq 23/5 hub and Nasdaq Trader notice dn2026-8 (24 September 2026) are the places to verify. Everything here is built as data in a calendar table, so a slipped date is a row edit.
What actually changes
In Eastern Time (ET, New York's clock), the old US stock day looked like this:
- Pre-market, 4:00 AM to 9:30 AM
- Regular session, 9:30 AM to 4:00 PM
- After-hours, 4:00 PM to 8:00 PM
- Dark, 8:00 PM to 4:00 AM
Under 23/5 the dark stretch is replaced by an overnight session from 9 PM to 4 AM ET, leaving only the 8 to 9 PM pause. I will not spend more words on that list, because every broker page has it. What matters for a backend is the pause: it is where exchanges and the consolidated feeds do maintenance, and connections may drop.
Two terms I use below:
- SIP is the Securities Information Processor, the consolidated feed that produces the national best bid and offer (NBBO) from all venues. If your code reads NBBO, you read a SIP, and each SIP feed has its own sequence numbering.
- Trade date is the label reports and settlement attach to a trade. It is a convention you choose, and it need not equal the wall-clock date.
Now the trouble. A trade at 11 PM Sunday has a Sunday calendar date, but it belongs with Monday's trading. With trade_date = timestamp.toLocalDate() you just filed Monday's opening liquidity under Sunday.
Venue participation is not uniform either. Press coverage names Nasdaq, NYSE Arca, Cboe EDGX, MEMX and 24X as launch venues, and a venue being on does not mean every symbol or order type is. So I key the calendar by venue rather than keep one global schedule.
Why date-based partitioning fails
Most pipelines I have inherited rest on three quiet assumptions:
- A day starts and ends inside one ET calendar date.
- Regular hours are the data worth keeping, and extended hours are a bonus.
- Silence after 8 PM ET means the market is shut.
All three fail from Sunday evening on. The third one bites hardest, because it lives in alert rules. Somebody wrote if (now.getHour() >= 20 || now.getHour() < 4) skipHeartbeatCheck(); two years ago, and that line will now mute seven hours of live trading.
The fix I trust from crypto is to stop asking what day it is and ask which session a tick belongs to. A session is a named, bounded interval with an ID. Trade date, daily bars and gap alerts all derive from it.
The data model: a session calendar, not a date
This is the first table I would create. It is small and it replaces a pile of scattered if statements.
-- Postgres or any relational store; this is reference data, not a tick table.
CREATE TABLE session_calendar (
session_id VARCHAR(40) NOT NULL, -- e.g. 'NASDAQ-2026-12-07'
venue VARCHAR(16) NOT NULL, -- NASDAQ, ARCX, EDGX, MEMX, 24X, SIP
trade_date DATE NOT NULL, -- the label reports use
phase VARCHAR(16) NOT NULL, -- OVERNIGHT, PREMARKET, REGULAR, POST, PAUSE
starts_at TIMESTAMPTZ NOT NULL, -- stored in UTC
ends_at TIMESTAMPTZ NOT NULL,
is_half_day BOOLEAN NOT NULL DEFAULT FALSE,
expect_data BOOLEAN NOT NULL, -- FALSE during PAUSE and holidays
PRIMARY KEY (venue, phase, starts_at)
);
Some choices worth explaining:
- One row per phase. The overnight phase of the session labelled Monday starts Sunday 9 PM ET. A half-day can shorten REGULAR and POST without any special code path.
trade_dateis stored, not computed. I choose the convention once, when the calendar is generated, and consumers just read it.- UTC timestamps produced from
America/New_York. The generator applies the ET rules, daylight saving included, and writes UTC. No consumer repeats timezone math. expect_datakeeps gap detection honest: FALSE for the pause and holidays, TRUE otherwise.
I load a year ahead and re-sync whenever a venue posts a notice. When an exchange changes a rule, a row changes and nothing is redeployed.
Rebuilding the trade-date rollover
The venue boundary is the pause. The calendar boundary is midnight. The trade-date boundary is whatever you pick, and brokers have picked differently. Interactive Brokers, for instance, documents that trades from 8 PM to midnight go to the next trading day, and its overnight window (8 PM to 3:50 AM ET with a short break) is not the venue's window. Your broker statement and your capture can legitimately disagree about the same fill.
My convention is that the trade date is the date of the regular session the tick leads into. Everything from the 9 PM overnight start through the next evening's 8 PM belongs to one trade date. It lines up with the pause, never splits a regular session, and keeps a daily bar as one contiguous block of time.
When reconciling with a broker, store both your trade_date and a broker_trade_date mapped in a small adapter. One column cannot honour two conventions.
The resolver is a lookup, with no date arithmetic:
@Component
public class SessionResolver {
private final NavigableMap<Instant, SessionWindow> byStart = new ConcurrentSkipListMap<>();
public void load(List<SessionWindow> windows) {
windows.forEach(w -> byStart.put(w.startsAt(), w));
}
public Optional<SessionWindow> resolve(String venue, Instant ts) {
Map.Entry<Instant, SessionWindow> e = byStart.floorEntry(ts);
while (e != null) {
SessionWindow w = e.getValue();
if (w.venue().equals(venue) && ts.isBefore(w.endsAt())) {
return Optional.of(w);
}
if (ts.isAfter(w.endsAt().plus(Duration.ofDays(2)))) break;
e = byStart.lowerEntry(e.getKey());
}
return Optional.empty();
}
}
public record SessionWindow(String sessionId, String venue, LocalDate tradeDate,
Phase phase, Instant startsAt, Instant endsAt,
boolean expectData) {}
In production I would index by venue first so each lookup is a single floor call, but the shape stays the same. Every tick is stamped at ingest with sessionId, tradeDate and phase. If resolve returns empty, the tick sits outside every window I know about. I do not drop it. It goes to a quarantine stream with an alert, since it means either a calendar bug or a venue doing something I did not expect, and both need a human.
A QuestDB schema for session-aware ticks
QuestDB partitions on the designated timestamp, in UTC. A session running 9 PM ET to 8 PM ET the next day crosses UTC midnight, so no UTC partition matches a session. I stopped fighting that: partitions serve storage and retention, and the session travels as a column.
CREATE TABLE ticks (
ts TIMESTAMP, -- exchange timestamp, UTC
recv_ts TIMESTAMP, -- when my process saw it
symbol SYMBOL CAPACITY 16384 INDEX,
venue SYMBOL,
session_id SYMBOL,
trade_date DATE,
phase SYMBOL,
seq LONG, -- feed sequence number
price DOUBLE,
size LONG,
flags INT
) TIMESTAMP(ts)
PARTITION BY DAY WAL
DEDUP UPSERT KEYS(ts, symbol, venue, seq);
In order of pain saved:
session_idandphaseas SYMBOLs. Their cardinality is tiny, so filters are cheap, and a daily bar becomesGROUP BY session_idwith no timestamp comparison.recv_tsbesidets. After a reconnect, replayed ticks arrive late. Having both separates "the market was quiet" from "my process was away."DEDUP UPSERT KEYSincludingseq. Reconnects replay, and replays double-insert unless the table refuses duplicates. My doubled-volume afternoon is why capture tables are WAL tables with dedup now.- No partition per session. Sessions are labels. Partitions are storage.
For the replay side, such as joining ticks to quotes at a timestamp, see deterministic market-data replay with QuestDB ASOF joins. The session columns slot straight into that design.
Late and out-of-sequence prints
Overnight sessions make late reporting more visible. A trade can be reported to the tape after later trades, with a condition flag marking it as out of sequence, and a correction or cancel can follow. Three consequences for storage:
- Order by
tsfor storage, but never trust arrival order to equal event order. That is whatrecv_tsis for. - Keep the condition flags in
flagsand decide per use whether a print counts toward bars. I exclude late-reported prints from the open and close, and include them in volume. - A late print can land after a session's bar has been computed. Make bar jobs idempotent and re-runnable for the last few sessions instead of treating a closed bar as final.
Pause or outage? Classifying silence
Crypto venues have no pause, so there silence is always suspicious. Equities now have a daily window where silence is expected and long hours where it is not, and on a messages-per-second graph the two look identical. So the classifier reads the calendar:
public enum Silence { EXPECTED_PAUSE, HOLIDAY, REAL_GAP, THIN_MARKET }
@Service
public class GapClassifier {
private final SessionResolver sessions;
private final Duration gapThreshold = Duration.ofSeconds(15);
public Silence classify(String venue, Instant lastTick, Instant now, String symbol) {
Duration quiet = Duration.between(lastTick, now);
if (quiet.compareTo(gapThreshold) < 0) return Silence.THIN_MARKET;
Optional<SessionWindow> w = sessions.resolve(venue, now);
if (w.isEmpty()) return Silence.REAL_GAP; // unknown time: be loud
if (!w.get().expectData()) {
return w.get().phase() == Phase.PAUSE ? Silence.EXPECTED_PAUSE : Silence.HOLIDAY;
}
// Inside a live phase: overnight quiet is normal for illiquid names
long ticksLastHour = recentTickCount(venue, symbol, Duration.ofHours(1));
if (w.get().phase() == Phase.OVERNIGHT && ticksLastHour < 5) return Silence.THIN_MARKET;
return Silence.REAL_GAP;
}
}
Two points are packed in there. First, the threshold should vary by phase in a real deployment: a liquid ETF silent for 15 seconds at 10 AM is a page, while a small cap silent for 15 minutes at 2 AM is an ordinary Tuesday. Second, data vendors that serve overnight quotes have warned about stale bid and ask values early in the overnight session. A quote that has not updated is a gap in the market, not in your connection. Track connection heartbeats separately from per-symbol update age, because merging them is how you page someone at 3 AM over a stock nobody is trading. When an alert fires, distributed tracing in Spring Boot tells me whether the gap began in my process or upstream.
I also keep heartbeat checks running through the pause. A TCP connection should either close cleanly or idle there. The meaning of a drop changes, and the check does not.
Reconnects and sequence gaps around the maintenance window
Feeds may drop connections during maintenance, so 8 to 9 PM is the one time each day when disconnects are scheduled, and 9 PM is when every client reconnects at once. A synchronised reconnect storm is hard on a feed handler, as I learned from watching one.
My handler follows four rules:
- A disconnect during the pause is a state change, not an error. Mark the venue
PAUSED, stop alerting, and schedule the reconnect for the nextstartsAtminus a small jitter. - Jitter the reconnect by a few seconds per connection so you stay out of the stampede.
- Compare sequence numbers after reconnecting. If the first sequence exceeds
lastSeq + 1, you have a gap. If it is lower, numbering restarted, and the feed should say so in a reset notice. - Do not assume sequences span the pause. Many feeds reset at a session boundary. I store
session_idalongsidelast_seq, so a reset at the boundary is expected and a reset mid-session is a defect. Keep this per feed too: each SIP line and each direct venue feed counts on its own, so a gap on one never implies a gap on another.
@Service
public class ReconnectHandler {
private final SessionResolver sessions;
private final TaskScheduler scheduler;
private final Map<String, FeedState> state = new ConcurrentHashMap<>();
public void onDisconnect(String venue, Instant now) {
Optional<SessionWindow> w = sessions.resolve(venue, now);
if (w.isPresent() && w.get().phase() == Phase.PAUSE) {
state.get(venue).setStatus(Status.PAUSED);
Instant next = nextSessionStart(venue, now)
.minusSeconds(ThreadLocalRandom.current().nextInt(5, 25));
scheduler.schedule(() -> connect(venue), next);
return;
}
state.get(venue).setStatus(Status.DOWN);
alert("Unscheduled disconnect on " + venue);
scheduler.schedule(() -> connect(venue), now.plusSeconds(backoff(venue)));
}
public void onMessage(String venue, String sessionId, long seq) {
FeedState s = state.get(venue);
if (!sessionId.equals(s.sessionId())) { // new session: sequence may reset
s.rollSession(sessionId, seq);
return;
}
if (seq > s.lastSeq() + 1) {
requestRetransmit(venue, s.lastSeq() + 1, seq - 1); // recover, then alert
alertGap(venue, s.lastSeq() + 1, seq - 1);
}
s.setLastSeq(seq);
}
}
requestRetransmit depends on what your feed gives you. Some offer a replay channel, others only a snapshot. If you get neither, write the hole to a feed_gaps table with the session ID and treat any bar spanning it as suspect. A known hole beats a silent one.
Resubscription deserves its own line: after the pause, do not assume your symbol subscriptions survived. I re-send the full subscription list on every fresh connect and compare the acknowledged count with what I expect, since a half-restored subscription looks like a quiet market.
If you hold hundreds of per-symbol connections, virtual threads help here. I wrote that setup up in Java virtual threads in Spring Boot production.
Migrating the history you already stored
Most guides stop at the new design and ignore the data you have: years of ticks whose trade_date was the calendar date and whose coverage is 4 AM to 8 PM. This is where I expect the real pain. What I would do:
- Add the new columns without rewriting old rows at first. Create
session_id,phaseandtrade_date_v2, backfill them from the calendar for history, and keep the oldtrade_dateuntouched until the new one is verified. - Backfill from the calendar, not arithmetic. Generate historical session rows for the past with only PREMARKET, REGULAR and POST phases, then stamp old ticks through the same resolver. Old and new data then go through one code path.
- Pick a cutover marker. Daily bars before the first overnight session and after it must be flagged, so a researcher can see the regime change instead of discovering it as a step in a chart.
- Reconcile on regular hours. For old days, the new session-based regular-hours bar must equal the old calendar-date bar. If it does not, the backfill is wrong. I diff the two for a sample of symbols before trusting anything.
- Check the boundary day. The weekend of the cutover is the only place old and new conventions meet, so I inspect it by hand.
Where backtests go wrong when overnight data mixes in
So far this was capture. Now the part that quietly costs money: research code.
Suppose daily bars come from GROUP BY symbol, trade_date with trade_date the calendar date. Before 23/5 that was nearly correct, because overnight hours were empty. After 23/5 it is wrong in several ways. Take one stock on a Monday where the overnight session prints 40,000 shares between 9 PM Sunday and 4 AM Monday, at prices a little away from Friday's close.
Before (calendar-date grouping):
SELECT symbol,
first(price) AS open,
last(price) AS close,
sum(price * size) / sum(size) AS vwap,
sum(size) AS volume
FROM ticks
WHERE symbol = 'ACME'
SAMPLE BY 1d ALIGN TO CALENDAR TIME ZONE 'America/New_York';
With overnight data, Sunday's 9 PM to midnight ticks create a "Sunday" bar that never existed, with three hours of thin trading. Monday's open becomes the first overnight print just after midnight, not the 9:30 AM open that indexes, benchmarks and corporate-action maths use. VWAP drifts toward illiquid prints. And the close is a post-market print near 7:59 PM, not the 4 PM close.
After (session-aware):
SELECT symbol, session_id,
first(price) FILTER (WHERE phase = 'REGULAR') AS reg_open,
last(price) FILTER (WHERE phase = 'REGULAR') AS reg_close,
sum(price * size) FILTER (WHERE phase = 'REGULAR')
/ sum(size) FILTER (WHERE phase = 'REGULAR') AS reg_vwap,
sum(size) FILTER (WHERE phase = 'OVERNIGHT') AS overnight_volume,
first(price) FILTER (WHERE phase = 'OVERNIGHT') AS overnight_open
FROM ticks
WHERE symbol = 'ACME'
GROUP BY symbol, session_id;
If your QuestDB version lacks FILTER on aggregates, use CASE WHEN inside the aggregate. The point is one bar per session with separate columns per phase, so regular-hours figures stay comparable with years of history and overnight numbers become new features.
What this prevents:
- Corrupted open and close. Open-to-close and close-to-open returns compare different things on either side of the cutover, and your backtest shows a step change on 7 December that no market caused.
- Gap statistics. "Overnight gap" used to mean last close to next open. Now much of that move happens while the market is open, so gaps shrink and a model trained on old gaps sees fewer.
- VWAP drift. Overnight prints are sparse and wide. Folding them into regular VWAP biases any execution benchmark you compare against.
- Replay look-ahead. If a replay sorts by calendar date while overnight ticks carry Monday's
trade_date, the engine can feed Monday's ticks into Sunday's simulation. A tester replaying strictly in timestamp order is unharmed. One that replays by day pays for it. - Thin book and stale NBBO. At 9 PM a symbol may have almost no resting liquidity, and the last NBBO you hold can be hours old. A backtest that fills at the stale mid is simulating a trade that could not have happened. I mark quotes older than a threshold as non-fillable and, for overnight, require an actual print or fresh two-sided quote before allowing a simulated fill.
One cheap guard I now keep: a test that fails if any tick count in the PAUSE phase is above zero. If the pause contains data, the calendar and the venue disagree, and I want to learn that before the backtest runs.

The Friday question
Sources describe the Friday-evening boundary a little differently. Does a Friday overnight session roll into Saturday, or does the week end at 8 PM Friday ET with the next session opening Sunday at 9 PM? I have not found a primary source I would bet a schema on, so I will not guess in print. Check the Nasdaq hub and your venue notices.
It matters because this is precisely what the calendar approach absorbs. If the answer differs from my assumption, I edit rows in session_calendar. Had I hard-coded "Sunday 9 PM through Friday 8 PM" in a scheduler, I would be redeploying on a weekend.
Rollout order for one weekend
With one weekend and a production system, I would go in this order:
- Stop trusting the clock. Find every place that derives a date from a timestamp: search for
toLocalDate,DATE_TRUNC,SAMPLE BY 1d, and cron expressions with hour ranges. Each hit is a candidate bug. - Create the calendar table and load the next few months, including the pause row and
expect_dataflags. - Add
session_idandphaseto the tick table and stamp them at ingest. Backfill history as described above. - Move heartbeat alerts to the classifier, and run the old alert in shadow mode for a week to compare noise.
- Rebuild daily bars from sessions, with regular-hours columns that match history.
- Add sanity checks: data in the pause, unknown-window ticks, mid-session sequence resets.
- Only then decide whether overnight data belongs in any strategy. That is a research question, not plumbing, and I keep trading views out of this post on purpose.
This is the same discipline I used building ingestion pipelines earlier in my career, which you can read about under experience and projects. On the delivery side, where replayed ticks must not double-count, transactional outbox and idempotent consumers apply almost unchanged.
Before the next 9 PM
I would not wait for certainty about the cutover. Whether the switch lands on 6 December or slips, the design is identical, and the calendar table costs an afternoon. Create session_calendar with a pause row, add session_id and phase to your tick table, and point one heartbeat alert at the classifier tonight. If you want a second pair of eyes on a market-data pipeline, reach me through contact.