
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.
概览
对 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 档。
安装
在 SourceWeft 中
- 打开 控制台中的 Pine Script Strategy Audit,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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_tickand 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:
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- v1.0.0最新Oct 2, 2026


