r/mltraders • u/person-person12 • 1h ago
An AI written backtest can only cheat with hindsight if the model touches the candles while the test runs
The most common doubt I get about using an LLM to backtest is that the model already knows what happened. It was trained on data that includes 2024, so how can a 2024 backtest mean anything?
That worry is real when the model is making the trade decisions during the test. If you hand it each candle and ask buy or sell, it can lean on what it remembers about that week, and nothing in the output will tell you it did.
It goes away when the model only writes the rules. In Agenticks the model turns what you typed into fixed entry, exit and sizing rules as code, and then a separate replay walks the historical candles one at a time with the rules already frozen. The model never sees a candle during the run, so its training cutoff has nothing to leak into.
The place hindsight can still sneak in is the human, which is the part people skip. If you run it, look at the equity curve, change the stop, run it again, and keep going until 2024 looks good, you have done the overfitting yourself and the model was never involved. A strategy that took 15 tweaks to look good on one window has mostly learned that window.
What I check before trusting a run is whether the rules would read the same if I had written them down before seeing any result, and whether the numbers hold on a stretch of data I didnt touch while tweaking, since that second window is the closest thing to live a backtest gets.