开发者 · Ultra API
给你的编码智能体一个 TradingView 策略实验室。
PineTune 开发者版提供本地回环 API 与 Agent Skill。智能体可以读取策略、改写 Pine 代码、启动寻优、订阅事件流等待完成并应用最佳结果,就在你自己的浏览器里。
桥接如何工作
Chrome MV3 扩展无法监听 TCP 端口,因此 PineTune 主动连接一个绑定在 127.0.0.1、零依赖的 Node 桥接服务;智能体用普通 HTTP 与桥接通信。
你的智能体
Claude Code、Codex、Devin、Cursor、Python 脚本……
Ultra 桥接
127.0.0.1:5678 · POST /api · GET /events
PineTune 扩展
授权校验,路由到图表标签页
你的 TradingView 图表
参数、Pine 编辑器、策略测试器
快速开始
- 1在 PineTune 弹窗中激活开发者版授权。
- 2设置:启用「Ultra Agent API」,端口 5678。
- 3打开加载了策略并显示策略测试器的 TradingView 图表。
- 4运行客户端,如有需要它会自动启动本地桥接。
# health check (bridge on loopback only)
curl http://127.0.0.1:5678/health
# full picture: strategy, inputs, Pine source, recent results
node tools/ultra-client.js snapshot --inputs --pine --result-limit 20
# start a run with the saved config, then block until it finishes
node tools/ultra-client.js call --method start
node tools/ultra-client.js waitDone --timeoutMs 900000
# apply the top passing result and wait for the tester to settle
node tools/ultra-client.js call --method applyBestPOST http://127.0.0.1:5678/api
{ "action": "call", "method": "readMetrics", "tabId": 123 }
→ { "ok": true,
"data": { "ok": true, "metrics": { "netProfitPct": 48.2, "profitFactor": 1.92, ... } } }智能体可以做什么
读取
snapshot · inspect · readMetrics · detect:策略、参数、指标、标的、周期、已保存结果。
修改 Pine
getPineSource · checkPineSource · updatePineSource · getPineErrors:整体替换、编译检查、哈希校验保存。
调参
setConfig · start · pause · resume · stop · waitDone:网格、随机、粗调再细调与过滤条件。
应用
applyBest · applyResult · applyParams:写回候选参数并等待回测稳定。
市场上下文
setSymbol · setTimeframe · readWatchlist · loadStudy:在标的与周期之间切换。
观察
GET /events(SSE / WebSocket)实时推送每次状态变化,无需盲等。
安全设计
- 桥接只绑定回环地址,绝不暴露到局域网或公网。
- 首个连接的扩展 ID 在 WebSocket Origin 与 hello ID 校验一致后被固定。
- API 响应不会回传完整授权码或第三方 API Key。
- 只读或受保护的 Pine 脚本不会被绕过限制修改。
开发者版
包含专业版全部功能,外加 Ultra API 与 Agent Skill,$349 / 年。
智能体操作的是你自己的 TradingView 会话,请审阅你让它执行的操作;回测结果不构成投资建议。