TradingAgents: Multi-Agents LLM Financial Trading Framework

Yijia Xiao1, Edward Sun1, Di Luo2, Wei Wang1
1University of California, Los Angeles, 2Massachusetts Institute of Technology

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, as demonstrated by our comprehensive experiments showing significant improvements in cumulative returns, Sharpe ratio, and maximum drawdown compared to baseline models. Our results highlight the effectiveness of multi-agent LLM frameworks in financial trading.

Introduction

Autonomous agents powered by Large Language Models (LLMs) revolutionize decision-making by mimicking human workflows across various domains, including finance. Unlike traditional algorithmic trading systems that rely on quantitative models, LLMs excel in processing and understanding natural language data, making them adept at analyzing news, reports, and social media sentiment. Recent multi-agent LLM frameworks in finance have shown promise in creating explainable AI systems, enhancing decision transparency and reasoning.

However, existing applications face two main challenges:

Organizational Modeling: Current frameworks often overlook the complex interactions that mirror real trading firms, focusing instead on isolated tasks. This limits their ability to replicate effective trading practices. Communication Efficiency: Reliance on unstructured natural language communication leads to information loss and context degradation over lengthy interactions, reducing effectiveness in complex tasks.

Our framework addresses these issues by simulating the multi-agent decision-making processes of professional trading teams. We employ specialized agents with distinct roles inspired by real trading firms, coupled with a structured communication protocol that combines clear, structured outputs with natural language dialogue. This hybrid approach ensures precise and efficient interactions, enabling robust decision-making.

We validate TradingAgents using historical financial data, comparing its performance against several baselines through metrics like cumulative return, Sharpe ratio, and maximum drawdown, demonstrating its superior effectiveness.

TradingAgents: Role Specialization

Assigning specific roles to LLM agents allows complex trading objectives to 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:

  • 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.

TradingAgents Analyst Team
Figure 2: TradingAgents Analyst Team

Researcher Team

The Researcher Team critically evaluates analyst data through a dialectical process involving bullish and bearish perspectives. This debate ensures balanced analysis, identifying both opportunities and risks to inform trading strategies.

TradingAgents Researcher Team
Figure 3: TradingAgents Researcher Team
TradingAgents Trader Decision-Making Process
Figure 4: TradingAgents Trader Decision-Making Process
TradingAgents Risk Management Team Workflow
Figure 5: TradingAgents Risk Management Workflow
  • Bullish Researchers: Highlight positive market indicators and growth potential.
  • Bearish Researchers: Focus on risks and negative market signals.

This process ensures a balanced understanding of market conditions, aiding Trader Agents in making informed decisions.

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.

  • 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 their role in maximizing performance.

Risk Management Team

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

  • 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.

TradingAgents: 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

Cumulative Returns on AAPL
(a) Cumulative Returns on AAPL
TradingAgents Transactions for AAPL
(b) TradingAgents Transactions for AAPL.
Green / Red Arrows for Long / Short Positions.
Categories Models AAPL GOOGL AMZN
CR%↑ ARR%↑ SR↑ MDD%↓ CR%↑ ARR%↑ SR↑ MDD%↓ CR%↑ ARR%↑ SR↑ MDD%↓
Market B&H -5.23-5.09-1.2911.90 7.788.091.3513.04 17.117.63.533.80
Rule-based MACD -1.49-1.48-0.814.53 6.206.262.311.22 ----
KDJ&RSI 2.052.071.641.09 0.40.40.021.58 -0.77-0.76-2.251.08
ZMR 0.570.570.170.86 -0.580.582.122.34 -0.77-0.77-2.450.82
SMA -3.2-2.97-1.723.67 6.236.432.122.34 11.0111.62.223.97
Ours TradingAgents 26.6230.58.210.91 24.3627.586.391.69 23.2124.905.602.11
Improvement(%) 24.5728.436.57- 16.5819.494.26- 6.107.302.07-

Table 1: TradingAgents: Performance Metrics Comparison across AAPL, GOOGL, and AMZN.

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.