Indicators
Tradingview

Understanding the Repaint Issue in TradingView Indicators

May 2, 2025

Understanding the Repaint Issue in TradingView Indicators

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.

What Is Repainting?

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.

Why Repainting Is a Problem in TradingView

  • False Confidence: Repainting indicators often look “too perfect” on historical TradingView charts, leading traders to overtrust them.
  • Unreliable Signals: A signal you see today may disappear tomorrow. This makes automation or alerts using Pine Script impossible.
  • Backtest Inaccuracy: If you test a repainting indicator in TradingView's strategy tester, the results will be skewed because it’s using future information that wouldn’t be available during live trading.

Common Causes of Repainting in TradingView

  • Using future values: Indicators that use close[0], high[0], low[0], or forward-looking logic are prone to repainting.
  • Plotting during an open bar: Signals calculated while the current candle is still forming (barstate.isrealtime) can change as the candle updates.
  • Incorrect use of Pine Script functions: In TradingView, improper use of request.security() or wrong lookahead settings often causes repainting across multiple timeframes.

How to Detect Repainting in TradingView

  1. Observe in Real-Time: Add the indicator to a live chart and monitor it. If signals appear and then vanish, it’s likely repainting.
  2. Check Pine Script Code: Look for any use of [0] indexing or functions that rely on non-confirmed bars.
  3. Use Bar Replay: TradingView’s Bar Replay mode can help test whether signals stay consistent bar-by-bar.

How to Avoid Repainting in Pine Script

  • Use confirmed bar data: Rely on completed candles (e.g., close[1]) rather than current ([0]) values.
  • Control real-time execution: Use barstate.isconfirmed or barstate.islast to separate logic for closed bars.
  • Correctly configure request.security(): Always use lookahead=barmerge.lookahead_on when pulling data from higher timeframes.

When Is Repainting Acceptable?

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.

Final Thoughts

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.

Need a Non-Repainting Custom Indicator for TradingView?

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!

Ready to automate your trading?

We are ready to support you on your algo trading journey!

Get Started