Table of Contents
Fetching ...

Agent-Based Simulation of a Financial Market with Large Language Models

Ryuji Hashimoto, Takehiro Takayanagi, Masahiro Suzuki, Kiyoshi Izumi

TL;DR

The paper tackles path-dependent price formation in financial markets by modeling investor behavior with FCLAgent, an LLM-guided trader that decides buy/sell actions while leaving order pricing to traditional rule-based mechanisms. This hybrid design enables psychologically plausible, context-sensitive loss aversion—anchored to reference points like purchase prices and all-time highs—without overburdening the LLM with numerical tasks. Empirical results show that incorporating FCLAgents reproduces the all-time high anomaly (a negative relation between proximity to $p_{1:t}^h$ and future returns) and preserves key stylized facts, while revealing that LLM-driven loss aversion can be highly context-dependent across models. The findings highlight the potential of LLM-based agents to enhance agent-based market simulations, offering richer behavioral realism and insights into how nuanced investor biases shape macro market dynamics. Future work will broaden heterogeneity (e.g., demographics) and further explore how different contextual cues influence collective market outcomes.

Abstract

In real-world stock markets, certain chart patterns -- such as price declines near historical highs -- cannot be fully explained by fundamentals alone. These phenomena suggest the presence of path dependence in price formation, where investor decisions are influenced not only by current market conditions but also by the trajectory of prices leading up to the present. Path dependence has drawn attention in behavioral finance as a key mechanism behind such anomalies. One plausible driver of path dependence is human loss aversion, anchored to individual reference points like purchase prices or past peaks, which vary with personal context. However, capturing such subtle behavioral tendencies in traditional agent-based market simulations has remained a challenge. We propose the Fundamental-Chartist-LLM-Agent (FCLAgent), which uses large language models (LLMs) to emulate human-like trading decisions. In this framework, (1) buy/sell decisions are made by LLMs based on individual situations, while (2) order price and volume follow standard rule-based methods. Simulations show that FCLAgents reproduce path-dependent patterns that conventional agents fail to capture. Furthermore, an analysis of FCLAgents' behavior reveals that the reference points guiding loss aversion vary with market trajectories, highlighting the potential of LLM-based agents to model nuanced investor behavior.

Agent-Based Simulation of a Financial Market with Large Language Models

TL;DR

The paper tackles path-dependent price formation in financial markets by modeling investor behavior with FCLAgent, an LLM-guided trader that decides buy/sell actions while leaving order pricing to traditional rule-based mechanisms. This hybrid design enables psychologically plausible, context-sensitive loss aversion—anchored to reference points like purchase prices and all-time highs—without overburdening the LLM with numerical tasks. Empirical results show that incorporating FCLAgents reproduces the all-time high anomaly (a negative relation between proximity to and future returns) and preserves key stylized facts, while revealing that LLM-driven loss aversion can be highly context-dependent across models. The findings highlight the potential of LLM-based agents to enhance agent-based market simulations, offering richer behavioral realism and insights into how nuanced investor biases shape macro market dynamics. Future work will broaden heterogeneity (e.g., demographics) and further explore how different contextual cues influence collective market outcomes.

Abstract

In real-world stock markets, certain chart patterns -- such as price declines near historical highs -- cannot be fully explained by fundamentals alone. These phenomena suggest the presence of path dependence in price formation, where investor decisions are influenced not only by current market conditions but also by the trajectory of prices leading up to the present. Path dependence has drawn attention in behavioral finance as a key mechanism behind such anomalies. One plausible driver of path dependence is human loss aversion, anchored to individual reference points like purchase prices or past peaks, which vary with personal context. However, capturing such subtle behavioral tendencies in traditional agent-based market simulations has remained a challenge. We propose the Fundamental-Chartist-LLM-Agent (FCLAgent), which uses large language models (LLMs) to emulate human-like trading decisions. In this framework, (1) buy/sell decisions are made by LLMs based on individual situations, while (2) order price and volume follow standard rule-based methods. Simulations show that FCLAgents reproduce path-dependent patterns that conventional agents fail to capture. Furthermore, an analysis of FCLAgents' behavior reveals that the reference points guiding loss aversion vary with market trajectories, highlighting the potential of LLM-based agents to model nuanced investor behavior.
Paper Structure (20 sections, 8 equations, 6 figures, 4 tables, 1 algorithm)

This paper contains 20 sections, 8 equations, 6 figures, 4 tables, 1 algorithm.

Figures (6)

  • Figure 1: Schematic overview of the FCLAgent architecture. The agent integrates a psychologically biased trading intention generated by an LLM with a traditional rule-based mechanism for stock price prediction. This hybrid structure allows the agent to exhibit human-like decision patterns while maintaining numerical reliability.
  • Figure 2: Overview of the simulation framework. At each time step $t\in\{1,...,T_{sim}\}$, one of the $n_a$ agent---either an FCNAgent or an LLM-guided FCLAgent---is selected to submit a limit order. Their actions are placed into a limit order book market, which matches buy and sell orders to determine transactions and update the market state.
  • Figure 3: Proportion of asset holdings by FCLAgents in a simulation trial ($n_{\mathrm{FCL}}=5$). The sample size is $4,072$. The dotted lines indicate the 1st, 50th, and 99th percentiles of the empirical distribution, corresponding to values of $0.11$, $0.28$, and $0.48$, respectively.
  • Figure 4: All-time high nearness $\frac{p_t}{p_{1:t}^h}$ at the time of the FCLAgents submit orders in a simulation trial ($n_{\mathrm{FCL}}=5$). The sample size are $2,023$ and $2,049$ for purchase and sales, respectively.
  • Figure 5: Conceptual diagram illustrating the four situations with different contexts in the single turn simulations. In G$-$ and L$+$ situation, all-time high (low) price can serve as a reference point, although the current and purchase prices are the same as G$+$ and L$-$, respectively.
  • ...and 1 more figures