Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+22 more

    Pine Script Strategy Reviewer

    1

    Audit TradingView Pine Script for repainting, lookahead bias, and unrealistic backtest results.

    Free

    7 installsSecurity scanned
    Pine Script Strategy Reviewer

    Pine Script Strategy Reviewer

    Example session with this skill installed

    Review this Pine Script for repainting
    val = request.security(syminfo.tickerid, 'D', close, lookahead=barmerge.lookahead_on)
    plot(val)

    • Read your context and instructions
    • Compiled the pine script strategy

    I have reviewed your Pine Script snippet. The use of the close series with lookahead=barmerge.lookahead_on at a higher timeframe is a primary source of lookahead bias, as it pulls the daily close price before the daily bar has actually completed on your chart's timeframe.

    Pine Script Strategy Review

    🚨 Critical Flaws Detected:

    Lookahead Bias in request.security: Your script accesses the close of the Daily timeframe while lookahead is enabled. In a backtest, this allows the script to know the final daily closing price at the start of the day, creating unrealistic "perfect" entries that cannot exist in live trading.

    📊 Execution & Alert Logic:

    Slippage: The snippet does not account for slippage. Daily timeframe execution often incurs significant gaps that will deviate from the theoretical price.

    • Alerts: No alert logic detected in this snippet.

    🛠️ The Fix:
    To fix this, you should use the previously closed daily price (close[1]) or ensure the security call is handled as a non-repainting tuple.

    // @version=5
    indicator("Non-Repainting Daily Close", overlay=true)
    
    // The fix: use close[1] to ensure we only use data known at the start of the bar
    // This prevents the script from "seeing the future" daily close.
    dailyClose = request.security(syminfo.tickerid, "D", close[1], lookahead=barmerge.lookahead_off)
    
    plot(dailyClose, color=color.new(color.blue, 0), title="Confirmed Daily Close")
    

    Next steps

    1. Replace your current request.security line with the corrected version above.
    2. Re-run your Strategy Tester; you will likely see the "true" performance without the lookahead inflation.
    3. Add slippage = 2 to your strategy() declaration to account for market impact.

    [Self-Check]

    • Repainting and lookahead bias strictly evaluated
    • Execution realism (slippage/spread) assessed
    • Alert/Webhook logic reviewed
    • Corrected code provided for any flaws found

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    Traders often deploy Pine Script strategies that look profitable in backtests but fail in live markets. This usually happens because the script accidentally uses future data or ignores execution realities like slippage.

    What it does

    • Identifies lookahead bias in request.security calls that leak future price data.
    • Detects repainting indicators that change historical signals after the bar closes.
    • Evaluates execution realism by checking for missing slippage and spread assumptions.
    • Validates alert and webhook payloads for compatibility with automated trading platforms.
    • Provides corrected code snippets to fix identified logic errors.

    Frameworks & tools

    TradingView Pine Script (v4 and v5).

    Why this beats prompting it yourself

    Generic AI often misses subtle repainting issues like improper barmerge.lookahead_on usage or bar-state handling. This skill uses a strict checklist to verify that backtest results are mathematically honest and replicable in real-time execution.

    Use cases

    • Auditing a strategy before connecting it to a live prop-firm account.
    • Debugging "too good to be true" backtest results in the Strategy Tester.
    • Ensuring webhooks trigger correctly for third-party execution via alerts.
    • Refactoring older v4 scripts to modern, non-repainting v5 standards.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    7 installs

    Downloaded by developers to date

    Free forever

    No account required to browse

    Trust & safety

    Security scanned

    Verified clean 23 days ago

    • Free to download with an account

    Listed23 days ago

    What's inside

    Frequently Asked Questions