開發者 · 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 工作階段,請審閱你讓它執行的操作;回測結果不構成投資建議。