Artificial Stock Market Simulations



Traditional mainstream economic models of the stock market assert that in equilibrium all rational agents must agree not to disagree and therefore subscribe to the same prediction model for the price, viz. have homogeneous rational expectations. As a result a no trade equilibrium follows and the price does not display the boom-bust dynamics of the real world.  This also flies in the face of high trading volumes in modern stock markets.  What is the fundamental source of heterogeneity and can there be endogenous explanations for boom-bust dynamics ?

This section will cover a set of simulators: the Markose et. al. Herding and Guru Model of Endogenous boom and bust dynamics and also the Santa Fe Institute Stock Market Model.

The Santa Fe Institute Stock Market Model incorporates Brian Arthur’s genius like intuition that where rewards can arise from being in the minority aka being a Contrarian by doing the opposite of the herd, there will always be a heterogeneity of prediction models and trading strategies.  Why ?   Brian Arthur litigates his famous El Farol Bar game.  Say the bar takes 100 people and all 100 subscribe to the same forecast function, viz follow homogeneous rational expectations (HRE).  If this HRE results, for example, in a forecast of over 50, nobody will turn up and hence the forecast will be negated and fails to be ‘rational’.  In order to win minority games, agents will have to go against the herd or the consensus prediction.  In the best tradition of a winning stock market strategy of buying low and selling high Indeed, in the presence of  the contrarian or the Liar (who falsifies anything, which can be predicted or for which there is a predictable trend) there cannot be a computable fixed point or rational expectation.  Markose (2005, 2017) shows that the Liar/Contrarian is the basis of Complex Adaptive Systems and also of mathematical incompleteness, non-computability and undecidability.

Thus, Santa Fe ASM, bring together two archetypes, trend followers and contrarians.

As one of the earliest agent-based approaches to financial models it has served as a kind of benchmark model inspiring many others. It is in the class of agent-based models which are highly computational, using many tools from machine learning to model the activities of learning agents. It set these learning agents into a relatively simple economic environment and explored the dynamics of prices, trading volume, and their responses to certain key parameters.  In the original Santa Fe ASM, there were well recognised flaws: the retraining of the evolutionary forecasting roles of the price were set exogenously by the experimenter. Markose et al. (2005) introduced the so-called ‘Red Queen constraint’ which endogenises when agents retrain.

The ASM simulator based on Java and allows users to select the number agents, their initial wealth, if they want to apply Red Queen Principle etc. There are other features such as how the agents knowledge get improved after retraining. After selecting the required parameters, you can come to know the Agent’s wealth is increasing or decreasing.

To run the simulation, first set the ASM Model Parameters and BF Agent Parameters. Then, click on ‘Build Simulation’ icon on the top menu which creates different windows for plotting the Agent’s information. Once the simulation has finished, you can analyze the Agent’s wealth and the stock market wealth.

Useful References:




For any further information, please contact