Skip to content
Research

TradingAgents: Multi-Agents LLM Financial Trading Framework

  • Yijia Xiao, Edward Sun, Di Luo, Wei Wang
  • Multi-agent
  • LLM
  • Trading

TradingAgents is a multi-agent LLM framework for autonomous trading that simulates the dynamics of a professional trading firm. Specialized agents, from analysts to risk managers, collaborate on every decision.

The system reaches up to 30.5% annualized return (AAPL, June–November 2024 backtest) and outperforms the traditional trading strategies it is compared with.

Summary

We introduce TradingAgents, a stock trading framework inspired by trading firms. It uses multiple LLM-powered agents with specialized roles, such as fundamental, sentiment, and technical analysts, and traders with diverse risk profiles.

Bull and Bear researchers evaluate market conditions, a risk management team oversees exposure, and traders integrate insights from debates and historical data to make informed decisions.

Our experiments show significant improvements in cumulative returns, Sharpe ratio, and maximum drawdown compared with baseline models. The results highlight the effectiveness of multi-agent LLM frameworks in financial trading.

Framework overview

TradingAgents simulates a professional trading firm with distinct roles: fundamental, sentiment, and technical analysts; researchers; traders; and risk managers. These agents collaborate through structured communication and debates.

Every trade flows through a five-stage pipeline, with information passing from one team to the next:

  1. Analyst team: four analysts concurrently gather relevant market information.
  2. Research team: the team discusses and evaluates the collected data.
  3. Trader: based on the researchers’ analysis, the trader makes the trading decision.
  4. Risk management team: risk guardians assess the decision against current market conditions to mitigate risks.
  5. Fund manager: the fund manager approves and executes the trade.

Role specialization

Assigning specific roles to LLM agents lets complex trading objectives be broken down into manageable tasks. Inspired by trading firms, TradingAgents has seven distinct roles: Fundamentals Analyst, Sentiment Analyst, News Analyst, Technical Analyst, Researcher, Trader, and Risk Manager.

Each agent is equipped with specialized tools and constraints tailored to its function.

Analyst team

The Analyst Team gathers and analyzes market data across various domains. Four analysts work in parallel, each covering a different information source:

AnalystRole
Fundamental AnalystsAssess company fundamentals to identify undervalued or overvalued stocks.
Sentiment AnalystsAnalyze social media and public sentiment to gauge market mood.
News AnalystsEvaluate news and macroeconomic indicators to predict market movements.
Technical AnalystsUse technical indicators to forecast price trends and trading opportunities.

Their combined insights feed into the Researcher Team for further evaluation.

Researcher team

The Researcher Team critically evaluates analyst data through a dialectical process involving bullish and bearish perspectives:

ResearcherRole
Bullish ResearchersHighlight positive market indicators and growth potential.
Bearish ResearchersFocus on risks and negative market signals.

This debate weighs both opportunities and risks. The result is a balanced read of market conditions that Trader Agents can act on.

Trader agents

Trader Agents execute decisions based on the analysts’ and researchers’ work. They evaluate insights from analysts and researchers to determine trading actions, balancing returns and risks as market conditions change.

Their responsibilities include:

  • Assessing analyst and researcher recommendations.
  • Determining trade timing and size.
  • Executing buy/sell orders.
  • Adjusting portfolios in response to market changes.

Risk management team

The Risk Management Team oversees the firm’s exposure to market risks and keeps trading activities within predefined limits.

Their responsibilities include:

  • Assessing market volatility and liquidity.
  • Implementing risk mitigation strategies.
  • Advising Trader Agents on risk exposures.
  • Aligning the portfolio with risk tolerance.

All agents use the ReAct prompting framework.

Agent workflow

Communication protocol

TradingAgents uses a structured protocol that combines clear, structured outputs with natural language dialogue. The structured outputs minimize information loss and maintain context over long interactions.

Types of agent interactions

Unlike previous frameworks that rely heavily on unstructured dialogue, our agents communicate through structured reports and diagrams, preserving essential information and enabling direct queries from the global state:

  • Analyst team: compiles research into concise analysis reports.
  • Traders: review analyst reports and produce decision signals with detailed rationales.

Natural language dialogue is reserved for specific interactions, such as debates within the Researcher and Risk Management teams:

  • Researcher team: engages in debates to form balanced perspectives.
  • Risk management team: deliberates on trading plans from multiple risk perspectives.
  • Fund manager: reviews and approves risk-adjusted trading decisions.

Backbone LLMs

We select LLMs based on task requirements, using quick-thinking models for data retrieval and deep-thinking models for in-depth analysis and decision-making. TradingAgents operates without GPUs, and alternative models can be integrated.

Experiments

We evaluated TradingAgents against the baselines below.

Backtest data

Our simulation used a multi-asset, multi-modal financial dataset including historical stock prices, news articles, social media sentiment, insider transactions, financial reports, and technical indicators from January to March 2024.

Simulation setup

The trading environment spanned from June to November 2024. Agents operated on a daily basis, making decisions on the data available at the time, with no access to later data.

Baseline models

We compared TradingAgents against the following strategies:

  • Buy and Hold: investing equally across selected stocks throughout the period.
  • MACD: momentum strategy based on MACD crossovers.
  • KDJ & RSI: combined momentum indicators for trading signals.
  • ZMR: mean reversion strategy based on price deviations.
  • SMA: trend-following strategy using moving average crossovers.

Evaluation metrics

Performance is reported across three tickers. Metrics: CR% is cumulative return (↑), ARR% annualized rate of return (↑), SR Sharpe ratio (↑), and MDD% maximum drawdown (↓).

AAPL

ModelCR% ↑ARR% ↑SR ↑MDD% ↓
Buy & Hold−5.23−5.09−1.2911.90
MACD−1.49−1.48−0.814.53
KDJ & RSI2.052.071.641.09
ZMR0.570.570.170.86
SMA−3.20−2.97−1.723.67
TradingAgents26.6230.508.210.91

GOOGL

ModelCR% ↑ARR% ↑SR ↑MDD% ↓
Buy & Hold7.788.091.3513.04
MACD6.206.262.311.22
KDJ & RSI0.400.400.021.58
ZMR−0.580.582.122.34
SMA6.236.432.122.34
TradingAgents24.3627.586.391.69

AMZN

ModelCR% ↑ARR% ↑SR ↑MDD% ↓
Buy & Hold17.1017.603.533.80
MACDn/an/an/an/a
KDJ & RSI−0.77−0.76−2.251.08
ZMR−0.77−0.77−2.450.82
SMA11.0111.602.223.97
TradingAgents23.2124.905.602.11

Sharpe ratio

TradingAgents has a higher Sharpe ratio than every baseline on AAPL, GOOGL, and AMZN (8.21, 6.39, and 5.60).

Maximum drawdown

Rule-based strategies excel in controlling risk, and TradingAgents keeps a low maximum drawdown (0.91% to 2.11%) while posting the highest returns on all three tickers.

Explainability

Unlike traditional deep learning models, TradingAgents explains its decisions in natural language. Each agent’s actions are accompanied by detailed reasoning and tool usage, so the system’s operations can be interpreted and debugged, as real-world financial applications require.

Conclusion

We presented TradingAgents, a multi-agent LLM-driven stock trading framework that emulates a realistic trading firm with specialized agents collaborating through debates and structured communication. Our framework uses diverse data sources and multi-agent interactions to inform trading decisions, and outperforms traditional strategies on cumulative returns, Sharpe ratio, and risk management.

Citation

@article{xiao2024tradingagents,
  title={TradingAgents: Multi-Agents LLM Financial Trading Framework},
  author={Xiao, Yijia and Sun, Edward and Luo, Di and Wang, Wei},
  journal={arXiv preprint arXiv:2412.20138},
  year={2024}
}

Share