Repainting Indicators: Why Your Strategy Tests Well and Trades Badly
What repainting is, why so many indicators quietly rewrite their own history, how to test any tool for it — and how Raw Edge is built so signals stay put.
Every trader meets this indicator eventually. On the historical chart the arrows are immaculate — a buy at every swing low, a sell at every top. Then you watch it live for an afternoon: an arrow appears, disappears, and reappears two candles later somewhere else. Nothing was wrong with your eyes. The indicator repaints.
Repainting is an indicator revising its own history. The value it shows for a bar after the fact is not the value it showed while that bar was live. Any rule built on it inherits the same property: the historical chart shows you the signals that survived, not the signals you would have had to trade.
That matters for one reason above all: a backtest reads the finished chart. If the indicator quietly rewrites itself, the backtest is testing the rewritten version — a sequence of decisions nobody could actually have made. This is the single most common way a strategy tests beautifully and loses money from day one, and it is worth understanding mechanically, because it is easy to build by accident and invisible until you know where to look.
Where repainting comes from
Repainting is rarely malicious. It falls out of three ordinary implementation choices, which is why such a large share of community-published indicators do it.
Reading the bar that is still forming. While a candle is open, its close does not exist — there is only the current price, changing every tick. A condition computed on the forming bar flickers with it: true at 10:32, false at 10:41, true again at 10:58. History keeps only the final value, so the chart afterwards shows one clean, confident reading where a live trader saw twenty contradictory ones.
Structure that needs the future. A swing low is only a swing low because of what happened next — price has to fail to go lower for some number of bars before the label applies. Tools built on pivots — ZigZag, fractals, most drawn market structure — place the mark at the pivot bar, which is several bars in the past by the time the pivot is actually knowable. On the historical chart the marker sits at the exact bottom. Live, it appears bars later, or jumps when a lower low arrives.
Higher-timeframe leakage. A one-hour strategy that references "today's daily close" knows, at 9am, a number that will not exist until midnight. The same applies to a session high referenced before the session has ended, or a weekly level read mid-week. The daily bar's final value gets applied backwards across all 24 hourly bars, including the ones that came before it was knowable.
None of these feel like cheating while you are building the thing. All three let tomorrow's information leak into today's signal.
Repainting is not the same as lag
It is worth separating the two, because the honest fix for repainting is lag. A confirmed swing low is only knowable several bars after the low itself, so any honest tool tells you about it late. A repainting tool tells you about it on time — retroactively. It waits until the swing is confirmed, then draws the signal back at the pivot as if it had known all along.
Lag is the price of tradeable information. Repainting is lag with the evidence removed. When you compare an honest tool against a repainting one on a historical chart, the repainting one always looks better — its entries sit at the exact turn, because they were placed there after the turn was known. The honest tool's entries look late because they were late, in exactly the way your live entries would have been.
How to test any indicator for repainting
You do not need source code access to catch most of it:
- Bar replay. Step through history candle by candle with a replay tool and watch whether existing marks move, vanish or arrive with a delay. Ten minutes of this exposes most pivot-based repainting.
- The screenshot test. Screenshot the live chart with its signals today. Compare against the same chart in a week. Any signal that moved, appeared or disappeared is repainting.
- Demo divergence. Run the strategy forward on demo for two weeks, then backtest the identical rules over the identical fortnight. The trade lists should match almost exactly. If the backtest found trades the live run never took, something is reading the future.
- Read the inputs, if you can. In any script you can inspect, the red flags are values read from the current unclosed bar, and drawing functions that place objects at negative offsets — that is, back in time.
How Raw Edge makes repainting a non-issue
Raw Edge takes the decision away from whoever builds the strategy. The engine has one evaluation mode, and it is the honest one — there is no way to express a repainting rule in it.
- Rules evaluate on closed candles only, and entries fill at the next bar's open. A signal's existence and its fill price can depend only on bars that had finished when it fired.
- Swings fire on confirmation, not at the pivot. A swing point needs a full window of closed bars on both sides before it exists at all, and everything built on structure — break of structure, CHoCH, order blocks — fires on the bar where confirmation completes. The marker is placed where the trade was possible, not where hindsight would prefer it.
- Levels are locked the moment they become knowable. The previous day's high and low are fixed the instant the new day opens, and never touched again. Equal-highs liquidity pools anchor to the first swing that formed them and do not drift. A fair value gap exists only once its third candle has closed.
- A break can be required to be a close, not a wick. Structural breaks support a close-through requirement, so a single spike through a level does not rewrite the structure that every later signal depends on.
Because "we evaluate on closed bars" is a claim every vendor makes, the engine also has to prove it — permanently. Two automated guards run against every change. A clip test takes each detected signal, cuts the data off at the very bar it fired on, and re-runs the detector: the signal must still be there, because a signal that vanishes when the future is removed was built on the future. A neutralisation test re-runs whole strategies with every bar after each entry flattened out: the same entries must still occur, at the same bars and prices. A change that introduces look-ahead fails the build and cannot ship.
The last piece is that whatever a rule detected is drawn on your chart — the zone, the level, the swing — so you can see exactly what the rule saw, and a deployed strategy runs the same engine against the same closed candles on your MT5 account. The signal it takes live is the one the backtest would have recorded. How that deployment loop works is covered in backtesting an EA without writing code.
What non-repainting does not buy you
Honesty about the other direction. Non-repainting signals arrive later than the hindsight version — entries a few bars off the exact turn, because the exact turn is only visible from the future. If a tool's marketing chart shows entries at perfect tops and bottoms, that is not a feature of the tool; it is the signature of the problem.
And a non-repainting platform can still test a bad idea faithfully. Costs, sample size, curve fitting and the rest are all still yours to get right — the seven mistakes that blow up live accounts all remain available. What you gain is narrower, and more valuable: when the backtest says no, the no is real, and when it says yes, the yes was at least achievable. An honest test can still deliver bad news. That is what tests are for.
Test it before you trade it
Raw Edge lets you build strategies visually, backtest them with realistic spread and commission, and deploy the same logic straight to MetaTrader 5.
See pricingMore reading
- Backtesting Smart Money Concepts: Order Blocks, FVGs and LiquidityHow to turn order blocks, fair value gaps, liquidity sweeps, BOS and CHoCH into precise, testable rules — and find out whether your SMC idea actually works.
- MT5 Backtesting Software: How to Test a Strategy ProperlyA practical guide to backtesting software for MetaTrader 5 — data quality, spread and commission modelling, sample size, and out-of-sample testing.
- How to Backtest an EA Without Writing Any CodeYou do not need MQL5 to test a trading idea. Here is how no-code backtesting works, what it handles well, and where writing code is still the better option.