Periscøpe
// Field note

Why calendar bugs look like strategy bugs

When a strategy does something inexplicable on one particular day, the instinct is to blame the logic. Often the real culprit is the calendar, and it hides well.

June 19, 2026

A strategy that’s behaved perfectly for months does something bizarre on a single day. You dive into the logic, re-read the entry conditions, second-guess the sizing. Hours later you notice the date: it was a half-day before a holiday. The strategy was fine. The calendar wasn’t.

Calendar bugs are uniquely good at disguising themselves as strategy bugs, and it’s worth understanding why.

The symptom shows up in the strategy

The cause is in the data or the session model, but the symptom is always the strategy doing something odd, entering when it shouldn’t, sizing wrong, firing end-of-day logic at the wrong time. So your attention goes straight to the strategy code, which is the one place the bug isn’t. You can stare at correct logic for a long time when the inputs are quietly wrong.

The usual disguises

  • Holidays. The market was closed, but a stray bar or a loop that assumed a normal session made the strategy act anyway.
  • Half-days. The session ended hours early. End-of-day logic fires at the usual time, into a market that already closed.
  • Time zones and DST. Exchange time, UTC, and local time get mixed, and a daylight-saving transition shifts everything by an hour at precisely the wrong moment.
  • Futures expiration. A contract expires and settles underneath a strategy that wasn’t watching for it, and the P&L does something that looks like a logic error but is really a contract rolling off.

Each of these produces a result that’s perfectly explicable once you know the date, and completely baffling if you don’t.

Why they’re so persistent

Because they’re rare and specific. A calendar bug might surface a handful of days a year, so it doesn’t show up in casual testing, and when it does, it’s surrounded by hundreds of normal days that all worked. It’s the definition of an edge case, which is exactly the kind of thing human attention skips.

The fix is structural

You don’t fix calendar bugs by being more careful in the strategy. You fix them by making sessions and holidays a property of the engine, not something each strategy re-derives. Real market calendars, correct handling of half-days and time zones, and proper expiration logic mean the strategy never sees a bar that shouldn’t exist, and a whole category of “the strategy went crazy on one day” mysteries simply never happens.

So the next time a strategy does something inexplicable on a single date, check the calendar before you blame the code. More often than you’d guess, the strategy was innocent all along.

Related
// Access

Run one strategy through Periscøpe.

We onboard in focused cohorts. Tell us what you trade and how you work. Live access is rolled out to select users on request.

We only use your email to contact you about access.

Read the docs →