When AI Meets Finance (StockAgent): Large Language Model-based Stock Trading in Simulated Real-world Environments
ArXiv ID: 2407.18957 “View on arXiv”
Authors: Unknown
Abstract
Can AI Agents simulate real-world trading environments to investigate the impact of external factors on stock trading activities (e.g., macroeconomics, policy changes, company fundamentals, and global events)? These factors, which frequently influence trading behaviors, are critical elements in the quest for maximizing investors’ profits. Our work attempts to solve this problem through large language model based agents. We have developed a multi-agent AI system called StockAgent, driven by LLMs, designed to simulate investors’ trading behaviors in response to the real stock market. The StockAgent allows users to evaluate the impact of different external factors on investor trading and to analyze trading behavior and profitability effects. Additionally, StockAgent avoids the test set leakage issue present in existing trading simulation systems based on AI Agents. Specifically, it prevents the model from leveraging prior knowledge it may have acquired related to the test data. We evaluate different LLMs under the framework of StockAgent in a stock trading environment that closely resembles real-world conditions. The experimental results demonstrate the impact of key external factors on stock market trading, including trading behavior and stock price fluctuation rules. This research explores the study of agents’ free trading gaps in the context of no prior knowledge related to market data. The patterns identified through StockAgent simulations provide valuable insights for LLM-based investment advice and stock recommendation. The code is available at https://github.com/MingyuJ666/Stockagent.
Keywords: LLM Agents, Multi-Agent Systems, Stock Market Simulation, Algorithmic Trading, Macroeconomic Factors, Equities
Complexity vs Empirical Score
- Math Complexity: 3.5/10
- Empirical Rigor: 8.0/10
- Quadrant: Street Traders
- Why: The paper is primarily a system-building and experimental work using LLM agents for simulated trading, relying heavily on implementation, code availability, and empirical evaluation of trading behaviors rather than advanced mathematical derivations. It features a GitHub link, backtesting environments, and analysis of external factors, indicating high empirical rigor but relatively low mathematical complexity.
flowchart TD
Start["Research Goal<br>Simulate real-world trading to evaluate external factors' impact"] --> Methodology["Methodology<br>Build StockAgent: Multi-agent LLM system avoiding test leakage"]
Methodology --> Inputs["Data/Inputs<br>Real stock market data, macroeconomic indicators, news events"]
Inputs --> Process["Computational Process<br>LLM agents trade in simulated environment without prior knowledge of test data"]
Process --> Findings["Key Findings<br>1. Identified impact of external factors on trading behavior<br>2. Revealed stock price fluctuation patterns<br>3. LLMs can provide valuable investment advice<br>4. Code available: github.com/MingyuJ666/Stockagent"]