Some of the most frustrating bugs in a trading system aren’t in the strategy at all. They’re in the calendar: trading when the market is closed, mishandling an early close, or fumbling a futures expiration. They produce weird results that look like strategy problems, so they’re easy to misdiagnose. Here’s how to avoid them.
Why calendar bugs masquerade as strategy bugs
When a strategy does something inexplicable on a particular day, the instinct is to blame the logic. But if that day was a half-session, a holiday, or an expiration, the strategy may have behaved perfectly given bad inputs, a bar that shouldn’t exist, a session boundary it didn’t know about, a contract that expired underneath it. The symptom shows up in the strategy; the cause is in the calendar.
The usual suspects
- Holidays. The market was closed, but your data or loop assumed a normal session.
- Early closes (half-days). The session ended hours early; orders placed after the close go nowhere, and end-of-day logic fires at the wrong time.
- Time zones and DST. Mixing exchange time with UTC or local time, especially across daylight-saving transitions, shifts everything by an hour at exactly the wrong moments.
- Futures expiration and roll. A contract expires and settles; a strategy that doesn’t handle expiration or roll keeps trading a dead instrument or misattributes P&L.
- Extended hours. Pre- and post-market sessions have different liquidity and rules; treating them like regular hours distorts fills.
Symptoms to watch for
- Trades or signals timestamped when the market was closed.
- P&L jumps around known holidays or expiration dates.
- End-of-day actions firing at the wrong time on half-days.
- Results that change when you switch time zones in your data pipeline.
How to test for them
- Run the backtest across known holidays and half-days and confirm nothing trades when it shouldn’t.
- Include at least one futures expiration in the test window and verify the strategy handles it.
- Check behavior around DST transitions in both spring and fall.
- Be explicit about whether your strategy is meant to trade regular or extended hours, and test that boundary.
How Periscøpe handles calendars
This is an area where the platform does the heavy lifting. Periscøpe’s engine uses real market calendars, NYSE for equities and ETFs, and the relevant exchange calendars for futures, so it skips non-session time instead of inventing bars. It handles futures expiration against the trading calendar and supports an extended-hours toggle for strategies that need it. The result is that a whole category of “the strategy went crazy on a holiday” bugs simply doesn’t happen, because the session boundaries are modeled for you rather than left as an exercise.