About Financial Market Simulation
Agent-based financial market simulations model price formation by populating a virtual order book with heterogeneous traders: fundamentalists who buy when price falls below intrinsic value, chartists who follow trends, and noise traders who act randomly. The interaction of these agents through limit and market orders replicates key features of real markets including fat-tailed return distributions, volatility clustering, and occasional flash crashes—phenomena that simple equilibrium models cannot explain.
The order book is the core mechanism: buyers submit limit bids at various prices and sellers submit limit offers; trades occur when bid and ask prices cross. The mid-price between best bid and best ask forms the quoted price. Market microstructure—the bid-ask spread, market depth, and order flow imbalance—determines transaction costs and price impact. Agent-based models have become standard tools for stress-testing exchanges, designing circuit breakers, and studying algorithmic trading strategies.
This simulator lets you control the mix of trader types, their aggressiveness, and fundamental value to observe how different market regimes emerge. With many fundamentalists the price is stable and mean-reverting; with many trend-followers the price exhibits momentum and bubbles; with many noise traders price becomes nearly random. Real markets contain all three types, producing the rich statistical properties observed in empirical price data.
Frequently Asked Questions
What is an order book and how does it work?
An order book is a real-time list of all outstanding buy (bid) and sell (ask) limit orders at various price levels. When a new market order arrives to buy, it matches against the lowest available ask; a market sell matches the highest bid. The best bid and best ask form the spread, with trades occurring at the intersection. The order book reveals supply and demand at each price and determines the immediate market impact of large orders.
What causes fat tails in financial return distributions?
Empirically, extreme price moves occur far more often than a normal (Gaussian) distribution would predict—this is called fat tails or leptokurtosis. In agent-based models, fat tails emerge from herding: when trend-followers trigger further trend-followers, cascades of correlated orders amplify small shocks into large moves. Feedback loops between price and agent behavior, combined with endogenous liquidity crises, produce the power-law tails observed in all major financial markets.
What is volatility clustering and why does it occur?
Volatility clustering means that large price changes tend to be followed by large changes (of either sign), and calm periods cluster together—captured statistically by GARCH-type models. In agent-based markets, this arises because large moves change agents' beliefs and risk appetite, increasing order flow variability. The positive feedback between recent volatility and future volatility mirrors the behavioral herding and risk-adjusting behavior of real market participants.
How do circuit breakers prevent flash crashes?
Circuit breakers are market-wide or individual-stock trading halts triggered when prices move beyond a threshold in a short time. They give market participants time to re-evaluate, break liquidity-withdrawal spirals where market makers pull orders, and allow erroneous algorithmic orders to be cancelled. Studies of the 2010 Flash Crash (Dow dropped ~1000 points in minutes) showed that coordinated circuit breakers and order cancellation policies can significantly reduce the depth and recovery time of such events.
What is the efficient market hypothesis and how does this simulation relate to it?
The efficient market hypothesis (EMH) states that prices instantly and fully reflect all available information, making it impossible to consistently beat the market. Agent-based simulations challenge the strong form of EMH by showing that even if individual agents use public information, price dynamics can diverge from fundamental value due to coordination failures, herding, and feedback loops. The coexistence of fundamentalists and trend-followers creates predictable short-term patterns that a sufficiently sophisticated strategy could exploit, consistent with empirical evidence of short-term return autocorrelation.