Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Pine Script Strategy Reviewer

    1

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

    Free

    14 usesSecurity 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

    Designed to review TradingView Pine Script strategy or indicator source with a declared Pine version (including v4, v5, and v6 syntax where recognizable). Preserve the script's existing version unless migration is requested. Version-specific behavior should be assessed against the source's declared version. This is static reasoning, not a Pine compiler or TradingView backtest.

    Required: A compatible AI agent that supports and can read SKILL.md. Relevant Pine Script source is needed for source-specific findings; full source and relevant strategy/chart settings improve the review, while snippets can be reviewed with scope limits stated.

    Direct file edits: Read Files and Write Files access are required only when the buyer clearly requests direct edits to a selected Pine source file. Read only the identified file(s), edit only the requested file(s) and smallest justified lines, inspect the change, and re-review the result. If file read/write access is unavailable, provide a patch for the buyer to apply instead. Pasted code and patch advice remain available without file-edit access.

    Not required: TradingView compiler, account, or platform access; external plugins; broker account; network access; shell/terminal; webhooks; API keys; credentials; or environment-variable permissions. Do not use shell/terminal or network actions. Do not access TradingView UI/settings or claim compilation, backtesting, or runtime verification unless actually performed.

    Limitations: The skill cannot compile or execute Pine code, reproduce fills, verify live-market behavior, assess profitability, or guarantee safety for deployment. User-specific broker, exchange, and market assumptions must be supplied; do not share credentials or secrets.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Trading & Investing.

    Does not perform financial risk assessment or profitability forecasting. Focuses strictly on technical script logic and backtest integrity.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    14 uses

    Times used to date

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 14 days ago

    • Free with an Agensi account

    Permissions

    Read Files
    Write Files
    Listed2 months ago
    Updated14 days ago

    What's inside

    Frequently Asked Questions

    This skill specifically targets "repainting" and "lookahead bias," two common coding errors that make backtests appear profitable when they are actually using future data. It audits your script for improper `request.security` calls and execution logic that wouldn't be possible in live trading.

    The Pine Script Strategy Reviewer is fully compatible with both Pine Script v4 and v5. It can also assist in refactoring older v4 scripts to the v5 standard while ensuring no new logic errors are introduced during the conversion.

    Simply paste your Pine Script code into the chat interface of your supported AI agent. The skill will analyze the logic, flag specific lines of code that pose risks, and provide corrected snippets to ensure your strategy is execution-ready.

    Yes, in addition to identifying logic errors, the skill checks your `alertcondition` and `strategy.entry` calls. It ensures your webhook payloads are formatted correctly for seamless integration with third-party execution platforms and prop firm automated tools.

    While it is highly effective at identifying technical coding flaws and execution biases, it does not provide financial advice or guarantee future profitability. Its purpose is to ensure your backtest results are mathematically honest and replicable in real-market conditions.

    New in Trading & Investing

    Free