Research
  • Multi-Agent
  • LLM
  • Trading

TradingAgents: Multi-Agents LLM Financial Trading Framework

Yijia Xiao, Edward Sun, Di Luo, Wei Wang

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 returns, outperforming traditional trading strategies while maintaining robust risk management.

Abstract

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

The system features Bull and Bear researchers evaluating market conditions, a risk management team overseeing exposure, and traders integrating insights from debates and historical data to make informed decisions. This collaborative, dynamic environment enhances trading performance.

Our comprehensive experiments show significant improvements in cumulative returns, Sharpe ratio, and maximum drawdown compared to 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, enhancing decision-making and optimizing trading strategies.

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

  1. Analysts 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 features 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 their function, ensuring comprehensive market analysis and informed decision-making.

Analyst Team

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

  • Fundamental Analysts: Assess company fundamentals to identify undervalued or overvalued stocks.
  • Sentiment Analysts: Analyze social media and public sentiment to gauge market mood.
  • News Analysts: Evaluate news and macroeconomic indicators to predict market movements.
  • Technical Analysts: Use technical indicators to forecast price trends and trading opportunities.

Combined, their insights provide a holistic market view, feeding 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:

  • Bullish Researchers: Highlight positive market indicators and growth potential.
  • Bearish Researchers: Focus on risks and negative market signals.

This debate ensures balanced analysis, identifying 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 comprehensive analyses. They evaluate insights from analysts and researchers to determine optimal trading actions, balancing returns and risks in a dynamic market environment.

Their responsibilities include:

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

Precision and strategic thinking are essential for maximizing performance.

Risk Management Team

The Risk Management Team oversees the firm's exposure to market risks, ensuring trading activities stay within predefined limits.

Their responsibilities include:

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

They ensure financial stability and safeguard assets through effective risk control.

All agents utilize the ReAct prompting framework, facilitating a collaborative and dynamic decision-making process reflective of real-world trading systems.

Agent Workflow

Communication Protocol

To enhance communication efficiency, TradingAgents employs a structured protocol that combines clear, structured outputs with natural language dialogue. This approach minimizes information loss and maintains context over long interactions, ensuring focused and effective communication among agents.

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, fostering deeper reasoning and balanced decision-making:

  • 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. This strategic alignment ensures efficiency and robust reasoning, allowing TradingAgents to operate without the need for GPUs and enabling easy integration of alternative models in the future.

Experiments

We evaluated TradingAgents using a comprehensive experimental setup to assess its performance against various baselines.

Back Trading

Our simulation utilized a multi-asset, multi-modal financial dataset including historical stock prices, news articles, social media sentiments, 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 based on available data without future information, ensuring unbiased results.

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% cumulative return (↑), ARR% annualized rate of return (↑), SR Sharpe ratio (↑), 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 achieves superior risk-adjusted returns, consistently outperforming all baselines across AAPL, GOOGL, and AMZN. The enhanced Sharpe Ratios demonstrate the framework's effectiveness in balancing returns with risk, highlighting its robustness in diverse market conditions.

Maximum Drawdown

While rule-based strategies excel in controlling risk, TradingAgents maintains a low maximum drawdown without sacrificing high returns. This balance underscores the framework's ability to maximize profits while effectively managing risk.

Explainability

Unlike traditional deep learning models, TradingAgents offers transparent decision-making through natural language explanations. Each agent's actions are accompanied by detailed reasoning and tool usage, making the system's operations easily interpretable and debuggable, which is crucial for real-world financial applications.

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 leverages diverse data sources and multi-agent interactions to enhance trading decisions, achieving superior performance in cumulative returns, Sharpe ratio, and risk management compared to traditional strategies.

Future work includes live deployment, expanding agent roles, and integrating real-time data processing to further improve performance.

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