If a signal can appear, move or vanish after the bar it sits on has closed, the indicator repaints, and its backtest was scored on information nobody had at the time. You can find out without reading the strategy logic.
An indicator repaints when the value it shows for a past bar is not the value it showed on that bar while it was live. History is computed from finished candles; the live bar is computed from a candle that is still forming. When the two disagree, the chart you scroll back through is cleaner than the one you would have traded, and so is any backtest run on it. The most common cause in Pine Script is a single line that pulls a value from a higher timeframe.
A strategy trades a 15-minute chart and only takes longs when price is above a daily EMA, requested with request.security(syminfo.tickerid, "D", ta.ema(close, 12)).
lookahead_off, each 15-minute bar reads the last finished day. The filter only changes when a day closes.The version that holds up asks for the last closed day inside the call, ta.ema(close, 12)[1] with lookahead = barmerge.lookahead_on, so history and the live bar receive the same confirmed value. The cost is lag: in a market that trades 24 hours a day, one daily bar spans 96 fifteen-minute bars, so the filter can be up to 96 chart bars old before it updates. The full explanation, with both broken versions, is in the one-bar repaint note.
The lag is one higher-timeframe bar, counted in chart bars. For a market that trades 24 hours a day:
If a strategy's results look much better with the filter than a value that old could plausibly explain, the filter is probably not the honest version.
1. Read the requests. Search the script for request.security. For each call, check that the series is offset by [1] inside the call and that lookahead is on. An offset outside the call shifts by one chart bar, not one higher-timeframe bar, and does not fix it.
2. Run the reload test. Screenshot the signals on a live chart, wait for at least one higher-timeframe bar to close, reload, and compare. Any signal that moved was computed from a candle that had not closed.
3. Watch it live before you trust the history. Leave the indicator on a live chart for a session and note where signals appear in real time. If the history later shows signals in places you never saw them, the backtest is scoring trades you could not have taken.
There is no calculator for this one; the tool is a chart. The free, open-source Repaint Demo: Higher-Timeframe EMA, Both Ways plots the same daily EMA the repainting way and the honest way side by side. Leave it on a live 15-minute chart for a few hours, then reload. The other checks have calculators on the tools page.
The one-page Backtest Verification Checklist, free. Confirm the email and the PDF opens straight away; one worked check each Tuesday after that.
The only figures here are bar counts: minutes in the higher-timeframe bar divided by minutes in the chart bar, for a market that trades 24 hours a day (a day is 1,440 minutes, a 4-hour bar 240). Markets with shorter sessions have fewer chart bars per day. The EMA and its length are an example, not a recommendation, no strategy result is quoted, and nothing here is investment advice.
Historical simulations are not live results. Nothing on this site is investment advice.