Does this indicator repaint? Paste the Pine Script and check
Paste the source of any open-source TradingView script below. The checker looks for the patterns TradingView's own Pine Script manual names as causes of repainting, tells you which line each one is on, and what the documented fix is. It runs entirely in your browser: nothing you paste is sent anywhere.
What "repainting" means
A script repaints when what it shows on past bars is not what it showed, or would have shown, while those bars were live. The history looks cleaner than anything you could have traded, because the marks that appeared and then vanished are gone. TradingView's manual sorts the causes into three groups: values calculated on bars that have not closed yet, things drawn on bars earlier than the one where they became known, and changes in the data itself.
What the checker looks for
- Future leak (high):
request.security()withlookahead = barmerge.lookahead_onand no[1]offset. History then shows higher-timeframe values before they existed. TradingView calls this "dangerously misleading", and publications that use it are moderated. - Unconfirmed higher-timeframe values (medium):
request.security()without an offset. Live, the daily value keeps changing until the day closes; on history you only see the final one. The documented fix isclose[1]withlookahead_on, used together. - Live-only state (medium):
varip,timenow,barstate.isnewandcalc_on_every_tick = trueall behave differently on live bars than on history. - Plotting in the past (medium): negative
offsetvalues, and pivot labels placed onbar_index[n]. A pivot is known only after its right-side bars close, but it is drawn on the pivot bar. - Synthetic prices (medium):
ticker.heikinashi(), Renko and similar. Strategies filling on them fill at prices that never traded. - Unconfirmed signals (low): crosses feeding alerts or shapes without
barstate.isconfirmed. A marker can appear on the live bar and disappear before the close.
Where it fails
- It reads text, it does not run the code. A pattern inside a function that is never called still gets flagged, and a repaint built from unusual code can be missed.
- A clean result means none of these patterns was found. It does not prove the script never repaints.
- Some flagged patterns are harmless where they are used, for example
barstate.islastto draw a table. Read the reason before judging the script. - It cannot check closed-source or invite-only scripts, because their code is not visible. For those, watch the script live for a few bars and compare with what history shows after a reload.
- Data revisions and a different first bar can change past values in any script. No text check can see that.
Sources: TradingView's Pine Script manual, Repainting.
See it applied
Our teardowns go through popular indicators one at a time, including whether each one repaints: Supertrend, UT Bot Alerts, RSI and VWAP. The monthly Teardown Letter does the same for one indicator per issue.
Also explained: VWAP, Supertrend, RSI, UT Bot Alerts, Nadaraya-Watson Envelope
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