Alex — you mailed two equity curves and a complaint. The 20-day high breakout looks clean in the backtest. The paper account, running the same code on the same names, takes about half the entries and then gets stopped on days the backtest never blinked. You asked whether our paper gateway is dropping orders. It isn't. Your daily bars are gluing two sessions together and labeling the result a day.
I pulled the mid-cap you circled from October 22. The vendor daily high is $41.86. Regular hours never printed through $41.12. That $41.86 is an 800-share print at 7:41 PM Eastern, sitting in a 22-cent spread. Your signal marked a new 20-day high and queued a buy for the next open. The paper session, which we run 9:30 to 16:00 Eastern unless you flip it, never saw the breakout. There was nothing to buy.
Which high is on that row?
Daily, on US equities, is a vendor convenience. You can be handed at least three different bars for the same calendar date, and most CSV exports will not tell you which one you got.
| Bar | Clock | Where the high/low come from | A trade at that high would have meant |
|---|---|---|---|
| Regular hours | 9:30-16:00 ET, plus the two auctions | The continuous book and the open/close crosses | Being in the regular session, often in an auction |
| Extended | Roughly 4:00-9:30 and 16:00-20:00, broker-dependent | Thin pre-market and after-hours prints | A session your cash account may not even be permissioned for |
| Composite | Whatever the vendor stitched | A mix of the above, sometimes odd lots and TRF prints | A print that might have been 80 shares on a wide quote |
Crypto taught you to treat a UTC midnight as the start of a trading day. Equities do not owe you that. The matching engine you can actually reach from a long-only cash account is six and a half hours of continuous matching and two crosses. The rest is a different crowd, a different spread, and often a different last.
I still have a directory of Yahoo CSVs from 2015 where I was sure I had a lovely Donchian on small biotech. The highs were after-hours binary-event prints. I had been backtesting other people's 200-share panic and calling it a channel. You are doing a more respectable version of the same thing with a paid feed.
If your research agent asked a vendor for daily OHLCV and didn't ask which session, assume composite. Agents take the convenient default. Convenient is how 7:41 PM ends up inside a breakout.
Why paper then looks broken in both directions
Once the session in the file and the session on the account disagree, you do not get a simple undercount. You get three kinds of drift, and you had all three.
- Breakout on an extended-hours high. The backtest enters the next regular open. Paper never had a signal. That is your missing eight entries.
- Stop under yesterday's low, with yesterday's low taken from the composite bar. The backtest already exited on an after-hours wick. Paper, marking regular hours only, holds into a day the backtest shows flat.
- The reverse stop: paper marks last including pre-market, a 5:10 AM print takes you out, and the regular-hours backtest is still in because that print is not on its bar.
The stop case is meaner than the missed breakout. Missed entries show up as fewer trades. Stops that fire in a room with seven people in it show up as different dollars on the trades you did take, which is why you blamed the gateway.
On 1-minute bars the same bug is quieter. Filter by session in America/New_York. If the file has no session tag, the filter is theater.
Pin the session before you retune the lookback
I reran your 20-day high on regular-hours daily bars, same names, same dates. Six breakouts remain. That is the paper account. The other eight were a print you would have had to take at 7:41 PM in 800 shares. Don't spend a week fitting a paper-slippage parameter to a session mismatch.
For each equity series, put three booleans on the research contract: includes_premarket, includes_afterhours, includes_odd_lots. Then pick the strategy's eligible session and make the fill model live in that session. If you really want extended hours, say so, and size like 7:41 PM: wider spreads, slower cancels, a book that looks like a quote and is actually one lot.
If a vendor cannot tell you which session a daily row used, treat it as composite until they can. Ask them in writing. A web chart will not answer. And if you later decide the strategy should trade the close, that is a different letter: the official close is an auction you have to join.
Run it again with the session pinned. Then we can talk about the six.
← All posts


