TradingAgents: LLM Hedge Fund Sim w/ Debating Teams
TradingAgents simulates a Wall Street firm using LLM agents—4 parallel analysts, bull/bear debaters, trader, risk, and portfolio manager—for fully traceable stock decisions that learn from past trades.
Multi-Agent Structure Mirrors Real Trading Firms
TradingAgents breaks a hedge fund into specialized LLM agents: four parallel analysts (fundamentals pulls filings for ratio analysis and intrinsic value; sentiment scores Reddit/X mood; news tracks macro events; technical runs MACD/RSI/Bollinger Bands), producing independent reports without vector collapse to preserve disagreement as signal. Bullish and bearish researchers debate analyst outputs over configurable rounds, citing specifics. Trader proposes timing/position size, risk team checks volatility/liquidity, and portfolio manager approves/rejects with explanation. Built on LangGraph for node-based orchestration with checkpoint resume on crashes and persistent markdown decision log that injects past trade reflections (alpha vs. SPY benchmark) into future prompts, enabling learning from realized returns.
This traceable design outperforms mechanical rule-based systems (e.g., moving averages) or opaque ML black boxes by logging full transcripts—analyst reports, debates, rejection reasons—for auditability absent in traditional quants.
Bull-Bear Debate Drives Defensible Positions
Hedge funds succeed via team arguments, not solo picks; TradingAgents replicates this with structurally opposing researchers who argue multiple rounds on analyst data. Bull pushes open positions, bear counters, trader synthesizes transcript for trade proposal. This preserves diverse signals from parallel analysts, turning conflict into robust reasoning. Portfolio uses 5-tier scale (buy/overweight/hold/underweight/sell) consistently with research/trader outputs and log.
Painless Setup and v0.2.4 Production Upgrades
Clone repo (53k stars, 9.7k forks, Apache 2.0), pip install, set LLM API key (supports OpenAI GPT, Gemini, Claude, Grok, DeepSeek, Qwen, Ollama/local). CLI picks ticker, date, provider, debate rounds; runs simulated exchange backtest. v0.2.4 (Apr 25) adds Pydantic-structured outputs for research/trader/portfolio (cuts failures), DeepSeek/Qwen/GLM/Azure support, Docker multi-stage builds—drops setup to ~10min for hobbyists.
Quant researchers get LangGraph reference for multi-agent graphs; fintech founders fork for retail tools; indie hackers study practical agent wiring.
Key Trade-offs: Research Tool, Not Live Trading
Token-intensive (4 analysts + debates/trader/manager per ticker) burns LLM costs; simulated backtest lacks live broker—build your own. Not financial advice; don't bet retirement. Yet weekly releases, multi-lang docs, UCLA arXiv paper (2412.20138) validate as clean 2026 agent benchmark—clone to dissect wiring.