Catch look-ahead bias, repainting and Pine v6 hygiene issues in TradingView Pine Script — inline, as you type. Runs locally; your code never leaves your machine.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Catch the bugs that compile but lie: look-ahead bias, repainting, and Pine v6 hygiene issues in your TradingView Pine Script — inline, as you type, right in your editor.
Runs 100% locally. Your code never leaves your machine.
What it flags
Look-ahead bias — request.security() with barmerge.lookahead_on and no [1] offset, negative history offsets, and other ways a script "reads the future" so a backtest looks better than live.
Repainting — signals evaluated on the still-forming bar with no barstate.isconfirmed gate; varip / timenow state that can't be reproduced on history.
Version hygiene — //@version=6 missing, un-namespaced built-ins (rsi → ta.rsi), removed constructs (study(), bare security()).
Intent mismatch — a stop/risk input declared but never wired into strategy.exit(), so the "risk control" doesn't actually exist in the executed logic.
Each finding lands in the Problems panel with the exact fix, and the status bar shows a Strategy Health Score™ (0–100, code correctness only).
Commands
ForexCodes: Validate Pine Script — validate the active file and show a summary.
ForexCodes: Open full audit in browser — run the full audit (AI-enhanced explanations + a shareable report) at forexcodes.com/audit.
forexcodes.validateOnType — validate as you type (default) vs. only on open/save.
Honest by design
This is a code-correctness tool. The Strategy Health Score measures whether your code does what it says and whether the backtest reflects behaviour you could reproduce live — it is not a measure of profitability, and nothing here is financial advice. Trading involves substantial risk of loss.
Part of ForexCodes — the quality-assurance platform for algorithmic trading.