Four Ways Pine Script Repainting Silently Inflates Backtest Results
Repainting in TradingView's Pine Script causes strategies to perform well in backtests but fail in live trading, because the code uses price data it should not yet have access to. The four main sources are incorrect request.security() offsets, unguarded intrabar signals using barstate.isconfirmed, ambiguous bar-internal stop and target order resolution, and lookahead settings applied directly to live values. Traders can detect repainting manually by stepping through historical data with TradingView's Bar Replay tool and watching whether past signals shift or disappear. An independent cross-check method — replicating entry and exit logic in Python against raw price data — can validate whether Strategy Tester results are reliable before risking real capital. Several tools, including Pineify and LuxAlgo Quant, now assist with Pine Script generation, but independent verification of outputs remains essential.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in