How we test.
A backtest that looks too good is the failure this product is designed against. These are the three rules that cost the most performance and buy the most truth.
1
Nothing fills inside a bar
A stop inside a bar is the most common way a backtest flatters. If your rule says exit at a level and the bar traded through it, the tempting thing is to fill at the level.
Say a bar opens above your stop, trades below it, and closes above it again. A generous engine fills you at the stop and records a small loss. This one fills you at the close that crossed it, plus a tick, because that is the first moment a live account could have known. Sometimes that is worse than the stop and sometimes it is better. It is always what would have happened.
2
Labels arrive when they would have
A regime label is computed from a period, and a period is only known once it has closed. A strategy that reads the label of the session it is trading has read its own future.
A session is classified once it ends. Until then the read is provisional and the app says so. In a backtest the label reaches your strategy at the moment it became known, delay included, so a rule that keys on the day type gets the day type it could have had, not the one we can see now.
3
Every run is reconciled
An engine can produce an equity curve that its own trades do not add up to. Rounding, fees applied twice, a fill recorded against the wrong order.
After a run finishes, equity is rebuilt from the trades and compared with what the engine reported. Fills are matched back to the orders that caused them. Where the two disagree the run is marked rather than quietly corrected, because a difference is usually telling you something about the strategy and not about the arithmetic.