Does my EA repaint or look ahead?
EA Trade TesterDemo labHow we testFor AI agents
An indicator repaints when a signal it showed on a past bar changes later. A backtest has look-ahead when a decision uses a price that was not known yet at that moment. Both make past results look far better than anything that can be traded, and both are easy to build by accident.
What are the common causes?
- Reading the bar still forming:
iClose(_Symbol, PERIOD_M15, 0)orClose[0]on every tick, with no new-bar check. Our first read flags this. - Zigzag, fractals and swing points: a swing high is only known some bars later; drawing it on the bar where it happened repaints.
- Higher-timeframe values: using the daily close or the H4 bar before that bar has closed.
- Centred filters: any smoothing that uses bars on both sides of a point.
- In-bar order: a bar's high and low do not say which came first; a test that assumes the good one first is too kind. Our lab assumes the stop was hit first.
How does our look-ahead probe work?
We cut the price data part-way and run the rules again on the shorter history. Every signal before the cut must be exactly the same as with the full history. A signal that changes when later data is removed was using the future, and the lab reports it.
How can I check an indicator myself?
- Run it in the MT5 Strategy Tester in visual mode, and note the signals as they appear bar by bar.
- At the end of the run, compare them with the signals now drawn on the same past bars.
- Any signal that moved, appeared or vanished is repainting.
Is every repainting indicator useless?
No: a repainting indicator can still be read on closed bars only, once its value is final. The problem is a backtest or an EA that trades on the first, unfinished value as if it were final.
Related pages
- MQL5 / MQL4 EA code checker
- Why live results are worse than the backtest
- Is my EA backtest real or luck?
- How we test
- EA Trade Tester home: test your EA, bot, indicator or report
Questions people ask
Does the MT5 tester catch look-ahead?
Not by itself. It runs the code as written; if the code reads a value that is not final yet, the tester uses it too.
Can a backtest be too good to be true?
Yes. A profit factor above 5 or more than +1 R a trade is a typical sign of look-ahead or missing costs; our checks flag implausible records.
Do you test indicators without an EA?
Yes: send the indicator code and the rule you use (for example, buy when the arrow appears). We test our rebuilt copy of that rule.
Is this financial advice?
No. It is about how tests can mislead. Not financial advice.