One of the most frustrating problems traders face when using custom indicators or strategies in TradingView is the repaint issue. Repainting indicators may look perfect in backtests but fail miserably in real-time trading. In this post, we’ll explain what repainting is in TradingView, why it’s a problem, how to detect it, and how to avoid using repainting indicators.
Repainting refers to the behavior of an indicator that changes its historical values as new data comes in. This means the indicator might show a signal (like a buy or sell arrow) on one bar and then remove or shift that signal later as the market moves forward.
While this can make the indicator look incredibly accurate in the past, it does not reflect what would have happened in real-time — making it misleading and dangerous for live trading.
close[0]
, high[0]
, low[0]
, or forward-looking logic are prone to repainting.barstate.isrealtime
) can change as the candle updates.request.security()
or wrong lookahead
settings often causes repainting across multiple timeframes.[0]
indexing or functions that rely on non-confirmed bars.close[1]
) rather than current ([0]
) values.barstate.isconfirmed
or barstate.islast
to separate logic for closed bars.request.security()
: Always use lookahead=barmerge.lookahead_on
when pulling data from higher timeframes.In some cases, repainting is okay for visual-only tools — such as indicators used for training, post-analysis, or static chart screenshots. But for alerts, automation, or real-time signals, repainting should always be avoided.
Repainting in TradingView can be a trap for unsuspecting traders. Indicators that appear flawless in hindsight often collapse in live markets. The key is to build or use Pine Script indicators that are designed to avoid repainting, so you can rely on what you see.
Always test your tools in real-time and build them on confirmed data.
We specialize in building non-repainting Pine Script indicators for TradingView. Whether you need signals, alerts, or automation-ready tools, contact us today to build your custom solution!