OpenSource-Hub

Vibe-Trading

命令行工具

HKUDS/Vibe-Trading

一站式个人交易智能体,支持多券商与 AI 策略。

项目简介

Vibe-Trading 是一个由 LLM 驱动的个人交易智能体,集成多代理编排与券商连接器,支持回测、实时行情和风控。提供命令行、REST API、MCP 和 Web 界面,一条命令即可部署交易策略。

README 预览

\n  English | 中文 | 日本語 | 한국어 | العربية\n\n\n\n  \n\n\nVibe-Trading: Your Personal Trading Agent\n\n\n  One Command to Empower Your Agent with Comprehensive Trading Capabilities\n\n\n\n  \n\n\n\n  \n  \n  \n  \n  \n  \n  \n  \n  \n\n\n\n  Website  · \n  Docs  · \n  News  · \n  Features  · \n  Shadow Account  · \n  Demo  · \n  Quick Start  · \n  Examples  · \n  API / MCP  · \n  Roadmap  · \n  Contributing\n\n\n\n  \n\n\n---\n\n## 📰 News\n\n- **2026-06-03** 🧹 **Community triage + trace correlation**: Tool-call trace entries now carry the originating `call_id`, so a `tool_result` can be matched back to its `tool_call` when replaying a run trace — arg previews stay truncated to keep trace files small ([#168](https://github.com/HKUDS/Vibe-Trading/pull/168), thanks @zwrong). Source comments no longer point at an internal-only docs path that external contributors couldn't find ([#166](https://github.com/HKUDS/Vibe-Trading/issues/166), thanks @jaleelpersonal). Also clarified that the `langchain-community` resolver warning on install is a harmless leftover-package notice, not a failure ([#167](https://github.com/HKUDS/Vibe-Trading/issues/167)), and scoped Gemini 2.5/3.0 `thoughtSignature` round-tripping for function calls as a `help wanted` task with a full fix plan ([#170](https://github.com/HKUDS/Vibe-Trading/issues/170), thanks @jliu6789).\n- **2026-06-02** 🔌 **Six new broker connectors (Tiger / Longbridge / Alpaca / OKX / Binance / Futu)**: The connector-first trading layer gains a direct-SDK transport alongside IBKR (local) and Robinhood (MCP). Each connector exposes read-only account / positions / orders / quote / history **plus paper-account order placement** — test your strategies across these broker paper accounts. Five of them (Tiger, Alpaca, OKX, Binance, Futu) also support **bounded, mandate-ga

常见问题 (4)

故障排除
为什么在使用 DeepSeek v4 pro API key 时,vibe-trading 会返回 401 错误?

401错误表示LLM提供商配置不正确。请确保.env(最好是~/.vibe-trading/.env)包含以下内容:

LANGCHAIN_PROVIDER=deepseek
LANGCHAIN_MODEL_NAME=deepseek-v4-pro
DEEPSEEK_API_KEY=sk-your-deepseek-official-api-key
DEEPSEEK_BASE_URL=https://api.deepseek.com/v1
TIMEOUT_SECONDS=2400

重要提示:
- LANGCHAIN_PROVIDER必须为deepseek,而不是openrouter
- 不要混用OpenRouter和DeepSeek的密钥。
- Vibe-trading会优先读取~/.vibe-trading/.env;如果该文件存在,请更新它而非agent/.env

来源 Issue #139
故障排除
为什么 Vibe-Trading CLI swarm 失败并显示 '429 billing_not_active' 错误?

Swarm工作节点使用其独立的LLM提供商配置,与Codex或单任务运行使用的配置不同。CLI的swarm命令启动工作流,但内部节点因通过环境变量(例如agent/.env或shell中的LANGCHAIN_PROVIDER、LANGCHAIN_MODEL_NAME、DEEPSEEK_API_KEY)配置的提供商账户未激活或未设置计费而失败。解决办法:检查agent/.env文件,确保设置了正确的API密钥,且提供商账户处于激活状态并启用了计费。然后重新运行swarm命令。

来源 Issue #131
故障排除
为什么Vibe-Trading在代理达到最大迭代次数时会显示'Execution failed: unknown'?

这是一个已知的Bug(问题 #114),当代理循环耗尽 max_iterations 时,会话聊天不会显示实际的失败原因。真正的错误保存在运行的 state.json 文件中。临时解决方法:找到运行目录(例如,在 data/runs/<run_id>/ 下),并检查 state.json 中的 reason 字段:grep reason data/runs/*/state.json。永久修复尚未完成;请关注仓库以获取更新。

来源 Issue #114
操作指南
如何在FinRL中将mootdx添加为A股回测的数据源?

FinRL目前尚未内置对mootdx的支持(计划在下一版本中添加)。临时解决方案:(1)进入agent/backtest/loaders/目录,(2)将akshare.py复制为mootdx.py,(3)修改加载器以通过mootdx库获取数据(TCP直连,无需认证,无IP封锁)。示例:通过调用market.get_k_data()使用mootdx获取K线数据。对于基于MCP的集成,扩展智能体以通过MCP服务器调用mootdx。完整的官方集成跟踪见此issue。

来源 Issue #107