Pine Script Strategy Audit

io.github.tylerscomic-labv1.0.0更新於 Oct 2, 2026

Static analysis for Pine Script v6 strategies — catches backtest-vs-live divergence traps.

已驗證Streamable HTTP可網頁執行FinanceDeveloper Tools

概覽

AI 產生的概覽

對 Pine Script v6 交易策略進行靜態稽核,找出能正常編譯但在回測與實盤之間產生偏差的陷阱。

功能
提供一個工具 audit_pine_strategy,對提交的 Pine Script v6 策略執行完整靜態分析,回傳發現的每個陷阱、具體行號以及淺顯易懂的說明。它針對成交時點假設、ATR 平滑方式不匹配、request.security() 等呼叫造成的未來函式偏差、VWAP 錨定漂移、與 calc_on_every_tick 和收盤假設相關的出場漂移,以及 v6 特有的語法陷阱。它屬於一套面向自營交易與量化驗證的工具集。
適用情境
在部署或信任一個回測表現良好的 Pine Script v6 策略之前使用,以發現回測與實盤之間隱蔽的偏差風險。適合演算法交易者與量化驗證人員審查用於自營交易或實盤的策略。
執行需求
遠端 streamable HTTP 端點;未宣告認證、環境變數或標頭。文件另描述自架方式,需要 Node.js 並在本機執行伺服器。託管方式據說明有免費方案與付費 Pro 方案。
安裝前請注意
README 說明託管方式有免費方案,付費 Pro 方案可提高額度,因此可能產生費用。提交的策略程式碼會傳送到遠端端點進行分析。此稽核僅為靜態分析,不保證實盤交易結果。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Pine Script Strategy Audit,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "pinescript-audit-mcp": {
      "type": "http",
      "url": "https://pinescript-audit-mcp.mcpize.run/mcp"
    }
  }
}

README

pinescript-audit-mcp

[License: MIT] [Live on MCPize]

An MCP server that statically audits Pine Script v6 strategies for the specific traps that compile clean, backtest beautifully, and then diverge from live behavior.

The problem this solves

Pine Script strategies can compile with zero errors and still behave differently live than in the backtester — fill-timing assumptions, ATR-smoothing mismatches, lookahead bias, VWAP-anchoring drift, and exit-drift are all silent, syntactically valid patterns that the compiler has no reason to flag. This catches them before they cost real money finding out live.

What it catches

  • Fill-timing traps — orders that backtest as filling at a price/bar the live broker can't actually match
  • ATR-smoothing mismatches — RMA vs. SMA vs. EMA smoothing assumptions that quietly change signal timing
  • Lookahead bias — request.security() and similar calls that leak future bar data into historical evaluation
  • VWAP-anchoring drift — anchor-period assumptions that behave differently on session boundaries live vs. in backtest
  • Exit-drift — exit logic that behaves differently depending on calc_on_every_tick and bar-close assumptions
  • Pine v6 syntax traps — v6-specific footguns that compile but change behavior from v5 equivalents

Tools

audit_pine_strategy

Runs the full static-analysis pass against a submitted Pine Script v6 strategy and returns every trap found, with the specific line and a plain-English explanation of the backtest-vs-live divergence it causes.

Use it

Hosted (recommended): MCPize — free tier, paid Pro tier for higher limits.

Self-host:

bash
npm installnode server.js

Part of the AlgoForge suite

Prop-firm and quant-validation tools for algo traders: prop-rules-mcp, trade-journal-mcp, payout-calc-mcp, econ-calendar-mcp, montecarlo-validator-mcp, overfitting-audit-mcp, walkforward-validator-mcp, backtest-cost-sensitivity-mcp, pinescript-mcp.

License

MIT

來源:README.md,提交 d8e8ea0

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v1.0.0最新Oct 2, 2026