TradingAgents:把交易公司搬进 AI——96k Stars 的多 Agent 金融交易框架

TradingAgents: Moving a Trading Firm Into AI — a 96k-Star Multi-Agent Financial Trading Framework

Tech-News #多Agent#量化交易#LangGraph#LLM金融#多模型支持#开源框架#Mycelium
更新于
🇨🇳 中文

by Mycelium Protocol


真实的交易公司里,一个交易决策背后往往有一个团队:有人负责研究基本面,有人盯着情绪指标,有人跑技术分析,有人做风险管理,最后由投资组合经理拍板。

TradingAgents 把这个结构原样搬进了 AI——用 7 种专职 LLM Agent 分工协作,最终由模拟交易所执行订单。

GitHub: https://github.com/TauricResearch/TradingAgents | ⭐ 96,107 | arXiv: 2412.20138


角色分工

分析师团队(Analyst Team)

四种角色,每种专注一个信息维度:

角色职责
基本面分析师评估公司财务数据和绩效指标,寻找内在价值和潜在风险信号
情绪分析师聚合新闻标题、StockTwits、Reddit 等社交媒体,生成短期市场情绪读数
新闻分析师监控全球新闻和宏观指标,解读事件对市场的影响
技术分析师利用 MACD、RSI 等技术指标,识别交易形态和价格走势预测

研究员团队(Researcher Team)

多空双方研究员对分析师的结论进行批判性审视,通过结构化辩论平衡潜在收益和固有风险。这个对抗性设计是 TradingAgents 区别于单 Agent 方案的核心——双方必须为各自立场找到足够强的论据。

交易员(Trader Agent)

综合分析师和研究员的报告,做出买入/卖出/持有的具体决定,确定交易时机和规模。

风控 + 投资组合经理

风控团队持续评估市场波动率、流动性和其他风险因素;投资组合经理基于风控报告批准或否决交易提案,批准后由模拟交易所执行。


LLM 支持矩阵

TradingAgents 支持几乎所有主流 LLM 提供商:

export OPENAI_API_KEY=...          # OpenAI (GPT)
export ANTHROPIC_API_KEY=...       # Anthropic (Claude)
export GOOGLE_API_KEY=...          # Google (Gemini)
export XAI_API_KEY=...             # xAI (Grok)
export DEEPSEEK_API_KEY=...        # DeepSeek
export DASHSCOPE_API_KEY=...       # Qwen 国际版
export DASHSCOPE_CN_API_KEY=...    # Qwen 国内版
export ZHIPU_API_KEY=...           # GLM 国际版
export ZHIPU_CN_API_KEY=...        # GLM 国内版(open.bigmodel.cn)
export MINIMAX_API_KEY=...         # MiniMax 全球
export MINIMAX_CN_API_KEY=...      # MiniMax 国内

v0.3.0 新增了 Kimi、Groq、Mistral、Bedrock 和任意 OpenAI 兼容端点(vLLM/LM Studio/llama.cpp)。本地 Ollama 也完全支持。

在代码中配置:

config = DEFAULT_CONFIG.copy()
config["llm_provider"] = "openai"           # 或 anthropic / google / deepseek / kimi / ollama / openai_compatible
config["deep_think_llm"] = "gpt-5.5"       # 复杂推理用的模型
config["quick_think_llm"] = "gpt-5.4-mini" # 快速任务用的模型
config["max_debate_rounds"] = 2             # 多空辩论轮数

市场覆盖

TradingAgents 使用 Yahoo Finance 格式的 ticker,支持所有 Yahoo Finance 覆盖的市场:

  • 美股AAPLSPY
  • 港股0700.HK(腾讯)
  • A 股600519.SS(贵州茅台/上交所)、000858.SZ(五粮液/深交所)
  • 东京7203.T伦敦AZN.L
  • 印度RELIANCE.NS加拿大.TO澳大利亚.AX
  • 加密货币BTC-USDETH-USD

快速安装

# 克隆并安装
git clone https://github.com/TauricResearch/TradingAgents.git
cd TradingAgents
conda create -n tradingagents python=3.12
conda activate tradingagents
pip install .

# 或 Docker
cp .env.example .env   # 填入 API Key
docker compose run --rm tradingagents

启动交互式 CLI:

tradingagents

会看到选择 ticker、分析日期、LLM 提供商、研究深度的界面,选好后 Agent 开始工作并实时显示进度。

Python API

from tradingagents.graph.trading_graph import TradingAgentsGraph
from tradingagents.default_config import DEFAULT_CONFIG

ta = TradingAgentsGraph(debug=True, config=DEFAULT_CONFIG.copy())
_, decision = ta.propagate("NVDA", "2026-01-15")
print(decision)

技术架构

基于 LangGraph 构建,用有向图表示 Agent 之间的信息流和决策流转。每个 Agent 是一个 LangGraph 节点,边表示信息传递方向。

v0.3.1 的主要修复:

  • Alpha Vantage 前瞻性过滤(防止数据泄露)
  • 图路由崩溃安全
  • 图形状感知的检查点恢复
  • 加密货币情绪数据源修复
  • 可配置 LLM 重试预算
  • Claude Sonnet 5 / Fable 5 支持

研究背景

arXiv 论文 2412.20138 详细描述了框架设计。2026 年 1 月还发布了 Trading-R1 技术报告——这是一个为交易推理任务进行强化学习微调的模型研究方向。

免责说明:TradingAgents 是研究工具。交易表现受 LLM 选择、模型温度、数据质量、时间周期等多种因素影响,不构成任何投资建议。


Mycelium Protocol — 追踪 AI 系统的底层演化


关于 Mycelium

菌丝协议。持续追踪 AI 工具、系统和实验的内容节点。


🇬🇧 English

TradingAgents: A 96k-Star Multi-Agent LLM Framework That Replicates a Trading Firm

by Mycelium Protocol


Inside a real trading firm, a single decision involves a team: someone researches fundamentals, someone tracks sentiment, someone runs technical analysis, someone manages risk, and a portfolio manager makes the final call.

TradingAgents replicates this structure in AI — seven specialized LLM agents collaborate, and a simulated exchange executes the orders.

GitHub: https://github.com/TauricResearch/TradingAgents | ⭐ 96,107 | arXiv: 2412.20138


Role Architecture

Analyst Team — four roles, each focused on one information dimension:

RoleResponsibility
Fundamentals AnalystEvaluates company financials and metrics, identifies intrinsic value and risk flags
Sentiment AnalystAggregates news, StockTwits, Reddit into a single short-term mood read
News AnalystMonitors global news and macro indicators, interprets market impact
Technical AnalystUses MACD, RSI, and other indicators to detect patterns and forecast movements

Researcher Team — a bullish and a bearish researcher critique the analysts’ conclusions through structured debate. This adversarial design is the core differentiator from single-agent approaches — both sides must build strong cases for their positions.

Trader Agent — synthesizes analyst and researcher reports into buy/sell/hold decisions, setting timing and trade size.

Risk Management + Portfolio Manager — the risk team continuously evaluates volatility, liquidity, and risk factors; the portfolio manager approves or rejects trade proposals, which are then executed by the simulated exchange.


LLM Support

TradingAgents works with nearly every major provider:

config["llm_provider"] = "openai"        # GPT family
# Also: anthropic, google, xai, deepseek, kimi,
#        qwen, glm, minimax, groq, mistral, bedrock,
#        ollama, openai_compatible
config["deep_think_llm"] = "gpt-5.5"        # complex reasoning
config["quick_think_llm"] = "gpt-5.4-mini"  # fast tasks
config["max_debate_rounds"] = 2

v0.3.0 added Kimi, Groq, Mistral, Bedrock, and any OpenAI-compatible endpoint (vLLM, LM Studio, llama.cpp). Local Ollama is fully supported.


Market Coverage

Uses Yahoo Finance ticker format — any market Yahoo covers works:

  • US: AAPL, SPY
  • Hong Kong: 0700.HK
  • China A-shares: 600519.SS (Kweichow Moutai), 000858.SZ
  • Tokyo: 7203.T · London: AZN.L · India: RELIANCE.NS
  • Crypto: BTC-USD, ETH-USD

Quick Start

git clone https://github.com/TauricResearch/TradingAgents.git
cd TradingAgents
conda create -n tradingagents python=3.12 && conda activate tradingagents
pip install .

tradingagents   # interactive CLI

Or with Docker:

cp .env.example .env   # add API keys
docker compose run --rm tradingagents

Python API:

from tradingagents.graph.trading_graph import TradingAgentsGraph
from tradingagents.default_config import DEFAULT_CONFIG

ta = TradingAgentsGraph(debug=True, config=DEFAULT_CONFIG.copy())
_, decision = ta.propagate("NVDA", "2026-01-15")
print(decision)

Technical Foundation

Built on LangGraph — each agent is a node, edges represent information flow. The graph structure allows checkpointing and recovery mid-run (added in v0.2.4).

v0.3.1 fixes include: Alpha Vantage look-ahead filtering (prevents data leakage), graph-router crash safety, working crypto sentiment sources, configurable LLM retry budget, and Claude Sonnet 5 / Fable 5 support.

A companion research track: Trading-R1 explores RL fine-tuning specifically for trading reasoning tasks.

Disclaimer: TradingAgents is a research framework. Trading performance varies based on LLM choice, temperature, data quality, and other factors. Not financial advice.


Mycelium Protocol — tracking the deep evolution of AI systems

© 2026 Mycelium Protocol. All rights reserved.

💬 评论与讨论

使用 GitHub 账号登录后发表评论

关于本站 · 免责声明

🍄 Mushroom Research Blog 是非营利、免费公开的个人科技观察博客与公众号 XStack18,不接受商业合作、不代表任何企业或机构立场,也不谋求商业利益。我们以个人视角客观中立地记录和分析 AI、Web3 等领域的最新模型发布与技术动态——不止转述新闻标题或二手信息,而是给出有独立思考的深入分析,希望帮更多人获得有价值的一手科技认知。

⚠️ 文中介绍的开源代码与模型,仅供学习交流与技术借鉴。它们大多仍处于早期阶段,有待进一步研究和验证,请勿直接用于工作或生产环境;如需采用,请先自行充分测试,并核实其许可证与安全性。
Open-source code and models featured here are shared for learning and reference only. Most are early-stage and still need further study and verification — please don't use them directly in your work or in production. Test them thoroughly and check their licenses and security first.

  1. 本站文章均为作者基于公开信息的个人研究与观点整理,不代表文中提及的任何公司、产品、模型的官方立场,未与其构成商业关联或合作关系。
  2. 科技行业信息更新极快,我们尽力保证内容准确、及时,但不对完整性、实时性做绝对保证,具体请以相关企业/项目官方公告为准。
  3. 文中引用的第三方商标、产品名称、图片、数据等版权归原权利人所有,我们会尽量注明来源;如你认为存在版权疑问或侵权,请通过下方邮箱联系我们,收到通知后会尽快核实处理(更正、加注来源或删除)。
  4. 文章内容仅为技术科普与个人观点,不构成投资、法律或其他专业建议,据此进行任何决策的后果需自行判断和承担。

📮 侵权 / 勘误 / 合作咨询:[email protected]