convez.ai
SkillFinanceiroAvançado
WilliamYi951208

Assistente de Trading Intraday para Ouro Futuro

WilliamYi951208/trading-assistant

IA para trading intraday com Price Action, SMC, Order Flow e Volume Profile

Ver no GitHub
InicialPluginScore · de 0 a 100

Assistente de trading automatizado para futuros de ouro (GC) em timeframe 5m, combinando quatro metodologias: Price Action (Al Brooks), Smart Money Concepts (SMC), Order Flow e Volume Profile. Ingere dados em tempo real via webhook TradingView ou indicador ATAS, gerando recomendações estruturadas de trade.

Instalação

$npx convez-ai WilliamYi951208/trading-assistant

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
45
Forks
12
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
—
Issues abertas
1
Contribuidores
1

Casos de uso

  • Análise automática de futuros de ouro em tempo real
  • Geração estruturada de sinais de entrada, stop-loss e take-profit
  • Integração com TradingView alerts ou ATAS para dados live
  • Backtesting e refinamento de estratégias multi-metodologia

Veredito

Ferramenta técnica robusta para traders experientes em futuros, com suporte a múltiplas fontes de dados e metodologias reconhecidas. Requer conhecimento profundo de trading, análise técnica avançada e gestão de risco para uso responsável.

README

A tradução para o português deste README ainda está na fila.

📈 Trading Assistant

期货日内交易助手

基于 Al Brooks 价格行为 · SMC · Order Flow · Volume Profile 四套体系的 GC(黄金期货)5 分钟日内交易助手实时自动取数 · 自动盘面分析 · 以 Agent Skill 形式即插即用

Methodology Instrument Timeframe Agent Skill License

简体中文 · English

[!WARNING] 免责声明:本项目仅用于交易方法论学习与个人工具搭建,不构成任何投资建议。期货交易风险极高,盈亏自负。


✨ 功能概览

能力说明
🧠 多体系分析价格行为(信号棒 / H-L 计数 / Always In / 交易者方程)、SMC(FVG / Order Block / BOS-CHoCH / 流动性)、Order Flow(Delta / Footprint / DOM)、Volume Profile(POC / VAH-VAL / HVN-LVN)。有什么数据用什么,不数据瘫痪。
📡 两种数据源Webhook 模式 — TradingView alert 推送 K 线到本地接收器;ATAS 模式 — 自带指标导出实时 OHLCV / Delta / Footprint
⚡ 自动输出每根新 K 自动生成结构化交易建议:做/不做/等 · 方向 · 入场 · 止损 · 止盈 · 手数 · 理由

🗂️ 目录结构

trading-assistant/
├── 📄 README.md / README.en.md     # 说明文档(中 / 英)
├── 📁 skill/                       # ⭐ 可直接安装的 Agent Skill(核心产物)
│   ├── SKILL.md                    # 四体系完整版(交易助手 v3.1)
│   └── references/                 # Order Flow / SMC / VP 实战手册(精简版,供 Agent 调用)
├── 📁 docs/                        # 📚 说明文档与深度参考
│   ├── WEBHOOK_FAST_MODE.md        # Webhook 快速模式说明
│   ├── OPENCLAW_INTEGRATION.md     # OpenClaw 集成指南
│   ├── smc-reference.md            # SMC 参考手册(详细版,供人阅读)
│   ├── vp-reference.md             # Volume Profile 参考手册(详细版)
│   └── legacy/                     # 归档:纯 PA 旧版 Skill(见其 README)
├── 📁 scripts/                     # 🔧 数据采集与服务脚本
│   ├── webhook_receiver.py         # Webhook 接收器(HTTP 服务)
│   ├── fetch_data.py               # MCP 数据拉取
│   ├── poll-*.py                   # 新 K 轮询
│   ├── config.json                 # 主配置(模板)
│   ├── config.vps.json             # VPS 部署配置(模板)
│   ├── deploy-vps.sh               # VPS 部署脚本
│   └── *.ps1 / *.bat               # Windows 启动脚本
└── 📁 atas-indicator/              # 📊 ATAS 数据导出指标(C# 源码)
    ├── ClaudeDataExport.cs
    └── ClaudeDataExport.csproj

[!TIP] 默认 Skill 是 skill/SKILL.md(四体系完整版)。如果只想要纯 Al Brooks 价格行为的旧版,见 docs/legacy/ 里的说明和替换方法。


🚀 快速开始

1️⃣ 安装 Skill

把 skill/ 目录拷到你的 Agent skills 目录:

# Claude Code
cp -r skill ~/.claude/skills/trading-assistant

# OpenClaw
cp -r skill ~/.agents/skills/trading-assistant

[!TIP] 默认安装的是四体系完整版。想换成纯 PA 旧版或轻量版(无需本地服务器),把对应的 SKILL.md 覆盖进去即可,详细替换方法见 docs/legacy/README.md。

2️⃣ 配置

复制配置模板并填入你自己的值:

cp scripts/config.json scripts/config.local.json
{
  "output_dir": "你的输出目录",
  "data_source": "webhook",
  "mcp_symbol": "GOLD",
  "mcp_timeframe": "5m",
  "host": "127.0.0.1",
  "port": 8787,
  "webhook_secret": "填入你自己的密钥"
}

[!CAUTION] 仓库中的 config.json / config.vps.json 是模板,webhook_secret 等字段为占位符。部署时务必替换成你自己的密钥,且不要把含真实密钥的配置提交回仓库。


📡 数据采集:两种自动获取方式

助手不靠人工贴 K 线,而是自动拿到每根新收盘 K 后立即分析。两套链路二选一(也可同时用),都把数据落到 output_dir/bars/ 供 Agent 读取。

🟢 方式 A:TradingView Webhook

TradingView 警报 ──▶ Pine 脚本拼 JSON ──▶ HTTP 推到本地接收器 ──▶ 写入 bars 目录 ──▶ Agent 分析
pip install tradingview-ta
python scripts/webhook_receiver.py

默认监听 http://127.0.0.1:8787,收到的每根 K 会写入 output_dir/bars/(按日轮转的 bars-YYYY-MM-DD.jsonl + 滚动的 recent-20-bars.json)。

TradingView 的警报只能 POST 到公网地址,所以本地端口要穿透出去。用 ngrok 最简单:

ngrok http 8787

记下它给的 https://xxxx.ngrok-free.dev 地址。若你有 VPS,也可参考 scripts/deploy-vps.sh 部署到服务器,省去每次开 ngrok。

[!WARNING] 接收器默认无鉴权。 一旦暴露到公网,务必在 config.json 里设置 webhook_secret,接收器会校验请求体里的 secret 字段,丢弃不带正确密钥的请求。

  1. 打开 TradingView 图表,切到 GC 的 5 分钟周期。
  2. 打开 Pine 编辑器,把 scripts/tradingview-codex-5m-webhook.pine 全文粘进去,保存并「添加到图表」。脚本会画一条 EMA20,并在每根 5m K 收盘确认时触发一条警报,内容是拼好的 JSON(含 symbol / OHLC / volume / ema20 / bar_index 等)。
  3. 点图表上的 警报(Alarm)→ 新建警报:
    • 条件选这个指标(Codex 5m Webhook - GC Scalp),触发选 alert() function calls only
    • 频率选 Once Per Bar Close
    • 勾选 Webhook URL,填第 2 步的地址 + /webhook,例如 https://xxxx.ngrok-free.dev/webhook
    • 消息留空即可,脚本内部已用 alert() 把 JSON 发出去了
  4. 创建警报后,每根 5m K 收盘就会自动推一次数据。

[!TIP] 若设置了 webhook_secret,需让请求体带上 secret。最省事的做法是部署到 VPS 并在转发层注入;纯 ngrok 直连场景可临时把 secret 留空,仅在本机/可信网络使用。

对 Agent 说「开始做单」,它会调用 scripts/poll-new-bar.py 监听 bars 目录,一旦有新 K 就自动读取并输出交易建议。

🔵 方式 B:ATAS 指标导出

ATAS 自定义指标 ──▶ 每根 K 收盘写本地 JSON/MD ──▶ 轮询脚本检测新 K ──▶ 唤醒 Agent 分析

atas-indicator/ 是一个 ATAS 平台自定义指标的 C# 源码。用 .NET 编译出 DLL:

cd atas-indicator
dotnet build -c Release

[!NOTE] ATAS 指标依赖平台自带的 ATAS.Indicators 程序集,需在本机装有 ATAS 的环境下编译。编译产物在 bin/Release/ 下。

把编译出的 ClaudeDataExport.dll 放进 ATAS 的指标目录(通常是 Documents\ATAS\Indicators),重启 ATAS。在 GC 的 5m 图表上添加 Claude Data Export 指标,按需设置参数:

参数说明默认
Output Directory数据导出目录(请改成你自己的路径)G:\PriceAction\交易日志\atas
EMA Period趋势判断用的 EMA 周期20
Recent Bars Count滚动保留的 K 线数量20

指标会在每根 K 收盘时写两个文件:recent-20-bars.json(含 OHLCV + Delta 的结构化数据)和 latest-atas-brief.md(含本地预分析的简报)。

对 Agent 说「开始做单」,它会调用 scripts/poll-atas-bar.py 监听 ATAS 导出目录,检测到新 K(靠 bar_index 变化)就唤醒分析并输出建议。

[!NOTE] 方式 B 的导出目录要和 poll-atas-bar.py 里的 BRIEF_FILE 路径一致(两边都改成你的实际路径)。


🔌 API 端点(Webhook 接收器)

方法路径说明
POST/webhook接收 TradingView K 线推送
POST/start开始输出分析
POST/stop停止输出分析
GET/status查询运行状态
GET/health健康检查
GET/latest-brief最新分析简报
GET/decision-pack完整决策包 JSON

🧠 交易方法论

四套体系融合,核心原则是「按有什么数据用什么,不数据瘫痪」:

  • ✅ PA + SMC 永远可用(只需 OHLCV + EMA)
  • ➕ Order Flow 在有 Footprint / Delta 数据时叠加
  • ➕ Volume Profile 在有成交量分布时叠加

详见 skill/SKILL.md 与 skill/references/ 下的实战手册(深度参考另见 docs/)。


⚙️ 配置项说明

字段说明
output_dir分析结果输出目录
data_sourcewebhook / mcp / hybrid
mcp_symbol标的,如 GOLD
mcp_timeframe周期,如 5m
host / port接收器监听地址
webhook_secretWebhook 鉴权密钥(留空则不校验,公网部署务必填写)

📄 License

本项目以 MIT License 开源

仅供学习与个人工具搭建 · 不构成投资建议 · 交易有风险,盈亏自负

Ver o original no GitHub

Bom para

Relacionados