跳转到内容

TradingView Webhook 配置

  1. app.panshi.io 组合详情页Webhook 面板生成 URL
  2. TradingView Alert → Webhook URL 粘贴上述 URL
  3. Alert message 用 JSON 模板(详见 Alert 模板
  4. 策略触发 → TV 打过来 → panshi-sim 下单(模拟 / 实盘镜像)
  1. 组合详情页 → Webhook 面板 → “生成 Webhook URL”
  2. 系统返回形如:
https://api.panshi.io/webhook/tv/<webhook_token>
  • 面板同时展示 curl 示例 + TradingView message 模板,一键复制
  • token 只展示这一次,关闭对话框后只能吊销重建
  • Condition:你的 Pine 策略 / 指标
  • Alert actions:勾 “Webhook URL”
  • Webhook URL:粘贴上面生成的 URL
  • Message:参照 Alert 模板 填 JSON

靠 URL path 里的 <webhook_token>(TV 不能加 HTTP header)。token 一旦泄漏立即吊销,吊销后历史订单不受影响,只是新信号不再接受。

同一 Alert 重复触发不会重复下单。幂等 key:

newClientOrderId = 'p_' + sha256(source + symbol + action + floor(ts/60000)).slice(0, 32)

同一信号 1 分钟内重试视为同一笔,Binance 端也会自动去重。

症状原因解法
401 unauthorizedtoken 错 / 已吊销重新生成
400 bad_requestJSON 格式错参照 Alert 模板
429 rate_limited单 token 频率超限合并 alert 或开多个 token 分流
451 geo_blockedTV 服务器出口 IP 被判中国大陆使用 api.panshi.io(CF 接入层)