Explainers / What is repainting on TradingView?
Pine Script repainting: what it is on TradingView
An indicator repaints when what it shows for a past bar today is different from what it showed on that bar when it was live. A signal you see on the chart now may not have been there at the time, or may have been somewhere else.
That matters for one reason: you can only act on what an indicator showed at the time. A chart that repaints looks better in hindsight than it ever was in real time.
Not all repainting is the same. There are four kinds, and they differ a lot in how much they matter.
1. The live bar moves (almost every indicator)
Until a bar closes, its close is just the latest price. Anything calculated from the close moves with every tick: RSI, moving averages, VWAP, Supertrend, and so on. A cross or a colour change can appear mid-bar and be gone at the close.
This is normal and easy to handle: read signals on closed bars, and set alerts to "Once per bar close". Once the bar closes, the value is fixed.
2. Future bars are used to draw the past (the misleading kind)
Some scripts calculate each historical point using bars that came after it. The past looks smooth and well-timed because it was drawn with knowledge of what happened next. The newest part of the line keeps changing as new bars arrive.
Common examples:
- Kernel and regression smoothers drawn over history, such as the default mode of the Nadaraya-Watson Envelope.
- Pivots, swing highs and lows, and zigzags. A pivot high with 5 bars on the right can only be confirmed 5 bars later, but it is drawn back on the bar where the high was. On a chart it looks instant; live, it was 5 bars late.
- Objects redrawn on the last bar only. Lines, boxes and labels that a script deletes and redraws on each update show only the latest version, not what was drawn at the time.
3. Higher-timeframe data leaking onto history
A script that pulls daily data onto a 1-hour chart can, on historical bars, see the day's final close at the start of the day. In Pine Script this happens with request.security() when lookahead is on and the value is not offset by one bar. On history it looks like perfect timing. Live, the day's close is not known until the day ends.
The standard fix is to request the previous completed higher-timeframe bar:
request.security(symbol, "D", close[1], lookahead = barmerge.lookahead_on)
If a script requests another timeframe, check how it does it before trusting its history.
4. Strategies that fill differently in history and live
A strategy calculated on history sees each bar only once, at its close. Live, with "recalculate on every tick" turned on, it can act mid-bar. The backtest and the live behaviour then follow different rules. Intrabar order fills on history are also estimated from open, high, low and close, not from the real path of price.
"Repainting Mode Enabled": what that box means
If you see a box saying "Repainting Mode Enabled" on your chart, it is most likely LuxAlgo's Nadaraya-Watson Envelope, which prints that message in its default mode. As far as we can find, it is not a TradingView setting. To turn it off, open the indicator's settings and untick "Repainting Smoothing". The line then becomes a one-sided average that does not change its past, at the cost of lag (about 6 bars on average at the default settings). Full explanation: Nadaraya-Watson Envelope.
Which popular indicators repaint?
Read from each script's published source:
| Indicator | Closed bars | Live bar | Notes |
|---|---|---|---|
| VWAP | Fixed | Moves | Anchored VWAP anchors are chosen in hindsight |
| Supertrend | Fixed | Moves (flips can vanish) | Higher-timeframe versions depend on how they request data |
| RSI | Fixed | Moves | Same caveat for higher-timeframe RSI |
| UT Bot Alerts | Fixed | Moves (labels can vanish) | Heikin Ashi request uses the chart's own timeframe |
| Squeeze Momentum (LazyBear) | Fixed | Moves | No future data; no built-in alerts |
| Nadaraya-Watson Envelope (LuxAlgo) | Redrawn in default mode | Moves | Uses later bars; endpoint mode does not |
Each line has its own page: VWAP · Supertrend · RSI · UT Bot Alerts · Squeeze Momentum · Nadaraya-Watson Envelope.
How to check any indicator yourself
- Bar Replay. Step forward bar by bar and note where signals appear. Then jump to the present and compare. A signal that is on the chart now but did not appear during replay was repainted.
- Watch it live, then reload. Screenshot a few signals as they happen. Reload the chart the next day and compare.
- Read the source, if it is open-source. Look for
request.security()calls, negative offsets oroffset =on plots, pivot functions, and drawings that are deleted and redrawn on the last bar. Or paste the code into our free repaint checker: it lists the lines matching known repaint patterns, with the usual fix, and runs in your browser without uploading anything. It flags risk; it cannot prove a script is safe. - Check the alerts. If an alert uses a value that is only final on bar close, set it to "Once per bar close".
Where it fails
- "Closed bars are fixed" assumes the same data. A symbol's history can be revised (corporate actions, data-vendor fixes), and values that depend on how much history is loaded, such as RSI's starting average, can shift slightly.
- Bar Replay is not live trading. It replays finished bars, so it can miss intrabar behaviour.
- Non-repainting is not the same as useful. An indicator that never repaints can still lag, whipsaw or tell you nothing about the next bar.
- Our table covers the published versions we read, on the dates we read them. A later update or a different author's version can behave differently.
Educational content only. Not financial advice. Nothing here is a recommendation to buy or sell anything.
Also explained: Repaint checker, VWAP, Supertrend, RSI, UT Bot Alerts, Nadaraya-Watson Envelope, Squeeze Momentum, Is TradingView backtesting accurate?, Chandelier Exit, WaveTrend Oscillator, QQE MOD, Pivot highs and lows, Hull Suite, Range Filter, Twin Range Filter, HalfTrend, ZigZag++, SSL Hybrid, CM MacD Ultimate MTF, Volume Profile / Fixed Range, ADX and DI, Support Resistance Channels, Market Structure Break & Order Block, Order Block Finder, Pivot Point SuperTrend, Trendlines with Breaks [LuxAlgo], Divergence for Many Indicators, TradingView script selling terms, Support and Resistance Levels with Break, Liquidity Swings [LuxAlgo], Pine Script errors, Breakout Probability (Expo), Did ChatGPT or Claude write your Pine Sc, Lorentzian Classification, SuperTrend AI (Clustering), Machine Learning Adaptive SuperTrend, Dynamic Swing Anchored VWAP, Support and Resistance Power Channel by , Support and Resistance (High Volume Boxe, Trendline Breakouts With Targets by Char, Breakout Finder by LonesomeTheBlue
Get the next teardown by email
One short email when a new teardown or free tool goes live, about twice a month. No signals, no hype. Unsubscribe in one click.
Almost done. Check your inbox and click the confirmation link.
Sent with Kit. Your address is used only for these emails. Privacy
No TradingView account yet? This affiliate link gives you a $15 coupon toward a paid plan, and we earn a commission if you buy one. The free plan is enough to follow this page.