Repainting in Pine Script: 5 Key Checks
Repainting isn’t just one bug—it’s a group of behaviors that can make historical signals look better than what was actually visible in real time.
1. Confirmed vs. live data
Live-bar values can change before the candle closes. Test signals on confirmed/closed bars and compare live vs. final signals.
2. Higher-timeframe data
Check every HTF request for lookahead and whether the value comes from a completed candle. Ask: Could this value really have been known at that moment?
3. Pivots & swing points
Pivots need future bars for confirmation. A marker plotted on an earlier candle may only become known later. Check the confirmation time, plot location, and alert timing.
4. Test in real-time conditions
Use Bar Replay, live alerts, reloads, and timeframe changes. Watch for signals or drawings that move, disappear, or change.
5. Document limitations
Don’t simply claim “non-repainting.” Clearly state whether signals use confirmed bars, completed HTF data, delayed pivots, or intrabar updates.
Bottom line: The goal isn’t to eliminate every moving value—it’s to clearly separate information available now from information revealed later.
Educational only. Not financial advice.$BTC
Repainting isn’t just one bug—it’s a group of behaviors that can make historical signals look better than what was actually visible in real time.
1. Confirmed vs. live data
Live-bar values can change before the candle closes. Test signals on confirmed/closed bars and compare live vs. final signals.
2. Higher-timeframe data
Check every HTF request for lookahead and whether the value comes from a completed candle. Ask: Could this value really have been known at that moment?
3. Pivots & swing points
Pivots need future bars for confirmation. A marker plotted on an earlier candle may only become known later. Check the confirmation time, plot location, and alert timing.
4. Test in real-time conditions
Use Bar Replay, live alerts, reloads, and timeframe changes. Watch for signals or drawings that move, disappear, or change.
5. Document limitations
Don’t simply claim “non-repainting.” Clearly state whether signals use confirmed bars, completed HTF data, delayed pivots, or intrabar updates.
Bottom line: The goal isn’t to eliminate every moving value—it’s to clearly separate information available now from information revealed later.
Educational only. Not financial advice.$BTC