Skip to content
ChartTailor
WorkServicesPricingField NotesAbout Start a build
← Field Notes

Why your indicator repaints, and which kinds actually matter

Repainting is the word traders use when a signal that looked perfect in history would never have appeared live. Some of it is harmless. One kind quietly invalidates everything you backtested. Here’s how I tell them apart.

Repainting is one of those words traders throw around like an accusation. “That indicator repaints,” said the way you’d say a car’s a lemon. And sometimes it’s fair, because some repainting genuinely makes a tool worthless. But a lot of what gets called repainting is harmless, and the confusion costs people good tools and false confidence in equal measure. So let me pull it apart properly, because the distinction is the whole thing.

What “repainting” actually means

At its core, repainting is when an indicator’s historical signals don’t match what you’d have seen live. You look back at the chart and there’s a perfect arrow at the perfect spot. But if you’d been watching in real time, that arrow either never appeared, or appeared somewhere else, or flickered on and off before settling. The history has been quietly rewritten to look better than the live experience ever was.

That’s the umbrella. Underneath it sit a few very different behaviours, and lumping them together is where people go wrong.

The harmless kind: the current bar is alive

The most common form isn’t really a problem at all. While a candle is still forming, the values on it change, because price is still moving. An indicator calculated on the live bar will wobble as that bar develops, and might show a signal that then disappears before the bar closes. That’s not deception. That’s just the present being unfinished.

The fix for this is a discipline, not a code change: only trust signals on closed bars. If a tool flickers mid-bar but locks in once the candle closes, and the closed-bar signal matches history, it isn’t lying to you. You just have to wait for the bar to finish before you act, which you should be doing anyway.

The dangerous kind: history that rewrites itself

The version that actually matters is when closed, completed bars change their signals after the fact. You see an arrow on a candle from two hours ago that wasn’t there an hour ago. The indicator went back and edited the past, usually because its calculation depends on something that was only knowable later.

This is the one that destroys backtests. If signals on finished bars can move, then the beautiful historical performance you’re looking at is a performance that was assembled with hindsight. Live, you’d never have gotten those signals at those moments. The track record is fiction, and it’s fiction of the most flattering, most dangerous sort, because it looks exactly like a great indicator until you trade it.

How the dangerous kind sneaks in

Usually it comes from pulling future or not-yet-final information into a past calculation. A higher-timeframe value that hadn’t finished forming when the lower-timeframe bar closed. A pivot or level that can only be confirmed by bars that came afterward, and then gets drawn back onto the bar where it “started.” In each case the indicator is being honest about the present only with knowledge from the future, and that’s the exact recipe for history that won’t survive contact with real time.

The test that settles it

Forget reading the code. The cleanest test is behavioural. Put the indicator on a chart and watch it live for a while as bars close. Note where the signals land. Then reload the chart later and compare. Do the signals on the old, closed bars sit exactly where they did when those bars closed? If yes, the tool is honest, whatever it does mid-bar. If the old signals have shifted, moved, or appeared where there was nothing before, you’ve caught it rewriting history, and nothing it shows you about the past can be trusted.

What to do with the answer

Harmless repainting just means “wait for the close.” Dangerous repainting means “this indicator’s history is a lie, and so is any backtest built on it.” Those are wildly different verdicts, and they get pronounced on the same tools by people using the same word. Knowing which one you’re looking at is the difference between discarding a perfectly good indicator over a non-issue and trusting a fraudulent one all the way to a blown account. The arrow on the chart looks identical either way. The watching is what tells them apart.

The useful version

Do not ask “does it repaint?” first. Ask which state changed.

Use three labels:

  • forming: the live bar can change;
  • confirmed: the bar closed and the signal is locked;
  • historical: the chart was reloaded and rebuilt.

Harmless repainting is when forming signals change before confirmation. Dangerous repainting is when confirmed historical signals move after they should be locked.

A practical audit

Create a small notebook or screenshot log for one live session. Record the signal when the bar closes. Reload later and compare that closed-bar signal.

If the closed signal is still there, the tool may be noisy live but honest historically. If the closed signal moved, appeared, or vanished after reload, the history is not trustworthy.

In code, the cleanest fix is often not clever. Separate the two states:

formingSignal = setupCondition
confirmedSignal = barstate.isconfirmed and setupCondition

Then only backtest or alert on the state you actually mean.