@cevenif: 兄弟们,有个库今天直接引爆了——快 9 万收藏了,叫 TradingAgents,是个多智能体交易框架。 用人话讲就是:一群 AI 分工协作帮你炒币炒股。 ① 有的 AI 专职盯盘面行情 ② 有的 AI 负责出策略决策 ③ 有的 AI 专…
摘要
TradingAgents 是一个多智能体交易框架,通过多个 AI 分工协作实现自动炒币炒股,支持实时数据接入、策略自动生成和持续优化,已在 GitHub 上获得近 9 万收藏。
查看缓存全文
缓存时间: 2026/06/15 15:07
兄弟们,有个库今天直接引爆了——快 9 万收藏了,叫 TradingAgents,是个多智能体交易框架。
用人话讲就是:一群 AI 分工协作帮你炒币炒股。
① 有的 AI 专职盯盘面行情 ② 有的 AI 负责出策略决策 ③ 有的 AI 专职做风险控制 支持接入市场实时数据、自动生成策略、还能持续迭代优化,相当于给你白送了一整支 AI 交易团队。 做加密的、搞量化的、想弄点副业的,跑通了之后想象空间真的非常大。
https://github.com/TauricResearch/TradingAgents…
TauricResearch/TradingAgents
Source: https://github.com/TauricResearch/TradingAgents
TradingAgents: Multi-Agents LLM Financial Trading Framework
News
- [2026-05] TradingAgents v0.2.5 released with the grounded Sentiment Analyst, GPT-5.5 etc. model coverage, Qwen/GLM/MiniMax dual-region support,
TRADINGAGENTS_*env-var configurability with API-key auto-detection, remote Ollama support, non-US alpha benchmarks, and ticker path-traversal hardening. See CHANGELOG.md for the full list. - [2026-04] TradingAgents v0.2.4 released with structured-output agents (Research Manager, Trader, Portfolio Manager), LangGraph checkpoint resume, persistent decision log, DeepSeek/Qwen/GLM/Azure provider support, Docker, and a Windows UTF-8 encoding fix.
- [2026-03] TradingAgents v0.2.3 released with multi-language support, GPT-5.4 family models, unified model catalog, backtesting date fidelity, and proxy support.
- [2026-03] TradingAgents v0.2.2 released with GPT-5.4/Gemini 3.1/Claude 4.6 model coverage, five-tier rating scale, OpenAI Responses API, Anthropic effort control, and cross-platform stability.
- [2026-02] TradingAgents v0.2.0 released with multi-provider LLM support (GPT-5.x, Gemini 3.x, Claude 4.x, Grok 4.x) and improved system architecture.
- [2026-01] Trading-R1 Technical Report released, with Terminal expected to land soon.
🎉 TradingAgents officially released! We have received numerous inquiries about the work, and we would like to express our thanks for the enthusiasm in our community.
So we decided to fully open-source the framework. Looking forward to building impactful projects with you!
🚀 TradingAgents | ⚡ Installation & CLI | 🎬 Demo | 📦 Package Usage | 🤝 Contributing | 📄 Citation
TradingAgents Framework
TradingAgents is a multi-agent trading framework that mirrors the dynamics of real-world trading firms. By deploying specialized LLM-powered agents: from fundamental analysts, sentiment experts, and technical analysts, to trader, risk management team, the platform collaboratively evaluates market conditions and informs trading decisions. Moreover, these agents engage in dynamic discussions to pinpoint the optimal strategy.
TradingAgents framework is designed for research purposes. Trading performance may vary based on many factors, including the chosen backbone language models, model temperature, trading periods, the quality of data, and other non-deterministic factors. It is not intended as financial, investment, or trading advice.
Our framework decomposes complex trading tasks into specialized roles.
Analyst Team
- Fundamentals Analyst: Evaluates company financials and performance metrics, identifying intrinsic values and potential red flags.
- Sentiment Analyst: Aggregates news headlines, StockTwits, and Reddit chatter into a single sentiment read to gauge short-term market mood.
- News Analyst: Monitors global news and macroeconomic indicators, interpreting the impact of events on market conditions.
- Technical Analyst: Utilizes technical indicators (like MACD and RSI) to detect trading patterns and forecast price movements.
Researcher Team
- Comprises both bullish and bearish researchers who critically assess the insights provided by the Analyst Team. Through structured debates, they balance potential gains against inherent risks.
Trader Agent
- Composes reports from the analysts and researchers to make informed trading decisions, determining the timing and magnitude of trades.
Risk Management and Portfolio Manager
- Continuously evaluates portfolio risk by assessing market volatility, liquidity, and other risk factors. The risk management team evaluates and adjusts trading strategies, providing assessment reports to the Portfolio Manager for final decision.
- The Portfolio Manager approves/rejects the transaction proposal. If approved, the order will be sent to the simulated exchange and executed.
Installation and CLI
Installation
Clone TradingAgents:
git clone https://github.com/TauricResearch/TradingAgents.git
cd TradingAgents
Create a virtual environment in any of your favorite environment managers:
conda create -n tradingagents python=3.12
conda activate tradingagents
Install the package and its dependencies:
pip install .
Docker
Alternatively, run with Docker:
cp .env.example .env # add your API keys
docker compose run --rm tradingagents
For local models with Ollama:
docker compose --profile ollama run --rm tradingagents-ollama
Required APIs
TradingAgents supports multiple LLM providers. Set the API key for your chosen provider:
export OPENAI_API_KEY=... # OpenAI (GPT)
export GOOGLE_API_KEY=... # Google (Gemini)
export ANTHROPIC_API_KEY=... # Anthropic (Claude)
export XAI_API_KEY=... # xAI (Grok)
export DEEPSEEK_API_KEY=... # DeepSeek
export DASHSCOPE_API_KEY=... # Qwen — International (dashscope-intl.aliyuncs.com)
export DASHSCOPE_CN_API_KEY=... # Qwen — China (dashscope.aliyuncs.com)
export ZHIPU_API_KEY=... # GLM via Z.AI (international)
export ZHIPU_CN_API_KEY=... # GLM via BigModel (China, open.bigmodel.cn)
export MINIMAX_API_KEY=... # MiniMax — Global (api.minimax.io)
export MINIMAX_CN_API_KEY=... # MiniMax — China (api.minimaxi.com)
export OPENROUTER_API_KEY=... # OpenRouter
export ALPHA_VANTAGE_API_KEY=... # Alpha Vantage
For Azure OpenAI, copy .env.enterprise.example to .env.enterprise and fill in your credentials.
For AWS Bedrock, install the extra with pip install ".[bedrock]", set llm_provider: "bedrock", configure AWS credentials (environment variables, ~/.aws/credentials, or an IAM role) and AWS_DEFAULT_REGION, and use a Bedrock model ID, e.g. us.anthropic.claude-opus-4-8-v1:0.
For local models, configure Ollama with llm_provider: "ollama". The default endpoint is http://localhost:11434/v1; set OLLAMA_BASE_URL to point at a remote ollama-serve. Pull models with ollama pull <name>, and pick “Custom model ID” in the CLI for any model not listed by default.
For any other OpenAI-compatible server (vLLM, LM Studio, llama.cpp, or a custom relay), use llm_provider: "openai_compatible" and set the endpoint via backend_url (or TRADINGAGENTS_LLM_BACKEND_URL), e.g. http://localhost:8000/v1 for vLLM or http://localhost:1234/v1 for LM Studio. The model is whatever your server serves. No key is needed for local servers; set OPENAI_COMPATIBLE_API_KEY when the endpoint requires one.
Alternatively, copy .env.example to .env and fill in your keys:
cp .env.example .env
CLI Usage
Launch the interactive CLI:
tradingagents # installed command
python -m cli.main # alternative: run directly from source
You will see a screen where you can select your desired tickers, analysis date, LLM provider, research depth, and more.
Markets and tickers
TradingAgents works with any market Yahoo Finance covers, using the exchange-suffixed ticker. Company identity and the alpha benchmark resolve automatically per market.
- US:
AAPL,SPY - Hong Kong:
0700.HK· Tokyo:7203.T· London:AZN.L - India:
RELIANCE.NS,.BO· Canada:.TO· Australia:.AX - China A-shares: Shanghai
.SS, Shenzhen.SZ(e.g.600519.SSfor Kweichow Moutai) - Crypto:
BTC-USD,ETH-USD
An interface will appear showing results as they load, letting you track the agent’s progress as it runs.
TradingAgents Package
Implementation Details
We built TradingAgents with LangGraph to ensure flexibility and modularity. The framework supports multiple LLM providers: OpenAI, Google, Anthropic, xAI, DeepSeek, Qwen (Alibaba DashScope, international and China endpoints), GLM (Zhipu), MiniMax (global + China), OpenRouter, Ollama for local models, and Azure OpenAI for enterprise.
Python Usage
To use TradingAgents inside your code, you can import the tradingagents module and initialize a TradingAgentsGraph() object. The .propagate() function will return a decision. You can run main.py, here’s also a quick example:
from tradingagents.graph.trading_graph import TradingAgentsGraph
from tradingagents.default_config import DEFAULT_CONFIG
ta = TradingAgentsGraph(debug=True, config=DEFAULT_CONFIG.copy())
# forward propagate
_, decision = ta.propagate("NVDA", "2026-01-15")
print(decision)
You can also adjust the default configuration to set your own choice of LLMs, debate rounds, etc.
from tradingagents.graph.trading_graph import TradingAgentsGraph
from tradingagents.default_config import DEFAULT_CONFIG
config = DEFAULT_CONFIG.copy()
config["llm_provider"] = "openai" # e.g. openai, google, anthropic, deepseek, groq, ollama; openai_compatible covers any OpenAI-compatible endpoint (vLLM, LM Studio, llama.cpp, ...)
config["deep_think_llm"] = "gpt-5.5" # Model for complex reasoning
config["quick_think_llm"] = "gpt-5.4-mini" # Model for quick tasks
config["max_debate_rounds"] = 2
ta = TradingAgentsGraph(debug=True, config=config)
_, decision = ta.propagate("NVDA", "2026-01-15")
print(decision)
See tradingagents/default_config.py for all configuration options.
Persistence and Recovery
TradingAgents persists two kinds of state across runs.
Decision log
The decision log is always on. Each completed run appends its decision to ~/.tradingagents/memory/trading_memory.md. On the next run for the same ticker, TradingAgents fetches the realised return (raw and alpha vs SPY), generates a one-paragraph reflection, and injects the most recent same-ticker decisions plus recent cross-ticker lessons into the Portfolio Manager prompt, so each analysis carries forward what worked and what didn’t.
Override the path with TRADINGAGENTS_MEMORY_LOG_PATH.
Checkpoint resume
Checkpoint resume is opt-in via --checkpoint. When enabled, LangGraph saves state after each node so a crashed or interrupted run resumes from the last successful step instead of starting over. On a resume run you will see Resuming from step N for <TICKER> on <date> in the logs; on a new run you will see Starting fresh. Checkpoints are cleared automatically on successful completion.
Per-ticker SQLite databases live at ~/.tradingagents/cache/checkpoints/<TICKER>.db (override the base with TRADINGAGENTS_CACHE_DIR). Use --clear-checkpoints to reset all of them before a run.
tradingagents analyze --checkpoint # enable for this run
tradingagents analyze --clear-checkpoints # reset before running
config = DEFAULT_CONFIG.copy()
config["checkpoint_enabled"] = True
ta = TradingAgentsGraph(config=config)
_, decision = ta.propagate("NVDA", "2026-01-15")
Reproducibility
TradingAgents is LLM-driven, so two runs of the same ticker and date can differ. This is expected for a research tool built on language models, not a defect. The variation comes from a few distinct sources, and it helps to separate them.
Language model sampling is non-deterministic. Even at a fixed temperature, providers do not guarantee byte-identical output across calls, and reasoning models (the default GPT-5.x family, and any thinking-mode model) vary the most because their internal reasoning is itself sampled.
Live data moves. News, StockTwits, and Reddit return different content as time passes, so a run today sees different inputs than a run last week even for the same historical trade date. Pin the analysis date to hold the price and indicator window fixed, but the social and news sources still reflect “now”.
To reduce variation you can lower the sampling temperature. Set temperature in your config (or TRADINGAGENTS_TEMPERATURE in .env); lower values make models that honor it more repeatable. Reasoning models largely ignore temperature, so for tighter reproducibility pair a low temperature with a non-reasoning model such as gpt-4.1.
config = DEFAULT_CONFIG.copy()
config["llm_provider"] = "openai"
config["deep_think_llm"] = "gpt-4.1" # non-reasoning model honors temperature
config["quick_think_llm"] = "gpt-4.1"
config["temperature"] = 0.0
What does not vary anymore: the analyzed company identity is resolved deterministically from the ticker before any agent runs, and the market analyst grounds exact price and indicator claims in a verified data snapshot. Earlier reports of “different companies” or fabricated price levels across runs are addressed by these two mechanisms.
Backtest results are not guaranteed to match any published figure. Returns depend on the model, the temperature, the date range, data quality, and the sampling above. Treat the framework as a research scaffold for studying multi-agent analysis, not as a strategy with a fixed, replicable return.
Contributing
Contributions are welcome: bug fixes, documentation, and feature ideas; past contributions are credited per release in CHANGELOG.md.
Citation
Please reference our work if you find TradingAgents provides you with some help :)
@misc{xiao2025tradingagentsmultiagentsllmfinancial,
title={TradingAgents: Multi-Agents LLM Financial Trading Framework},
author={Yijia Xiao and Edward Sun and Di Luo and Wei Wang},
year={2025},
eprint={2412.20138},
archivePrefix={arXiv},
primaryClass={q-fin.TR},
url={https://arxiv.org/abs/2412.20138},
}
相似文章
@XAMTO_AI: 兄弟们,有个东西我实在忍不住要跟你们念叨一下。 一个开源AI量化交易平台,悄悄就上线了,本地自部署,全链路打通,加密货币、美股、外汇全覆盖,从分析到实盘一条龙——你说气不气,这种东西两年前要么收费贵到离谱,要么根本找不到,现在直接开源扔G…
介绍一个开源的AI量化交易平台QuantDinger,支持本地部署、全链路打通加密货币、美股、外汇,集成AI分析、策略生成、回测与实盘对接。
@CycleDecoded: 离谱了兄弟们,GitHub 刚冒出个闷声发大财的怪物级项目,直接要把机构量化员的饭碗给掀了。 项目叫 Alpha-Dojo/DojoAgents,定位极其硬核:「全市场个人投资 AI 副驾」。这不是那种只会说车轱辘话的割韭菜大模型,而是真…
Alpha-Dojo/DojoAgents 是一个全市场个人投资 AI 副驾框架,支持股票、外汇、加密货币的自动化分析和策略回测,完全开源,旨在让散户拥有机构级量化工具。
@seclink: 最近这个开源工具挺火的。 看起来像是 钉钉悟空 、 字节 aily的开源版本。 你可以基于它来实现自己的agent 并且接入到上述的 即时通讯平台之中。 有的哥们基于这个改吧改吧,就能给投资人演示,拿到了不小规模的估值 。 让投资人记忆深…
CowAgent 是一个基于大模型的开源 AI 助理框架,支持自主任务规划、长期记忆、知识库、多模型切换和多渠道接入(微信、飞书、钉钉等),可快速构建和部署个性化 AI agent。
@KKaWSB: https://x.com/KKaWSB/status/2074289438474330306
本文详细介绍了如何利用免费的AI开源工具(如OpenBB、Qlib、TradingAgents等)搭建个人量化交易系统,涵盖数据、研究、回测、风控和执行五大模块,并指出了常见陷阱与纪律。
@XAMTO_AI: 还在为写量化策略头发一把把掉? Vibe-Trading,港大HKUDS团队出品的个人AI交易代理,直接用自然语言就能指挥AI干活! 你只需要说人话,它就能帮你: 研究市场 + 自动生成策略 一键回测 + 输出完整报告 多Agent团队协…
Vibe-Trading是港大HKUDS团队出品的个人AI交易代理,支持自然语言生成量化策略、一键回测和多Agent协作,内置456个Alpha因子库,并已开源。