📈 Financial Market — Agent-Based Model
200 heterogeneous agents — fundamentalists, trend followers and noise traders — interact in an order book. Watch bubbles and crashes emerge spontaneously from simple behavioural rules.
Market Parameters
Market Status
Agent Population
Pt+1 = Pt · exp(λ·D̃ + σ·ε)
D̃ = excess demand/N
ε ~ N(0,1)
How the Simulation Works
200 agents each submit a buy or sell order each tick based on their type. Fundamentalists compare price to the fundamental value V: they buy when P < V(1−δ) and sell when P > V(1+δ), acting as a stabilising force. Trend followers look at the 10-tick price momentum: they buy in uptrends and sell in downtrends, amplifying movements and creating bubbles. Noise traders send random orders, injecting stochastic fluctuations. The price update is log-linear in excess demand, so the model can produce fat-tailed return distributions similar to real markets. Increase trend followers (and reduce fundamentalists) to trigger bubble-crash cycles.