A great deal of current research in the field of artificial life is
focused on the behavior of complex systems which are composed of numerous simple
subsystems. Such systems exhibit a wide variety of behaviors. The evolution of such a
system can be critically dependent on the initial configuration, i.e., a simple
perturbation in the initial state can produce a radically different final state or set of
states. It is hoped that systems that are constructed in this fashion, can be used to
model some complex high dimensional real life phenomena such as the evolution of a forest
fire, the turbulent flow of a fluid, the varying weather patterns and the price movements
in a stock market.
This simulation deals with the familiar example of a stock market.
The primary aim is to use a multitude of agents, in a manner very similar to the classical
cellular automata approach, whose decisions to buy, sell or hold on to stocks, and the
prices at which to buy or sell, are described by a small set of simple rules. The
resulting market shows a variety of different trends, which depend on the initial state of
the system.
Simulation
Description
Using the Simulation
Future Improvements
Description of the System
The system consists of a set of traders (represented by a square in the
trader grid), each of whom initially starts off with some stock and some money. The
traders are characterized by an analysis period (corresponding to the time frame
over which he evaluates the performance of the stock) and a threshold
(corresponding to the percentage of fluctuation in the price that the trader deems
significant). At each instant a trader uses the stock price at three instants (each
separated from the other by the analysis period), to decide if he wants to buy, sell or
hold on to stock, and the price at which he decides to buy or sell them. At any instant
potential buyers invest a fixed fraction of the money they hold and potential sellers, a
fixed fraction of their stock. The buyers are then randomly ordered. A buyer and seller
are matched if the buyers price is greater than or equal to the seller's price. Only one
buyer is allowed to make a transaction, before the price is reset. In each such
transaction the buyer buys at his predicted price and the seller sells at his predicted
price, and the price of the stock is set to the price of the buyer. In addition, the set
of traders is randomly (in time) perturbed by an external input that forces a trader (who
is randomly picked) to become a potential buyer, at a marginally higher price than the
market value. The steps can be listed as:
- All traders decide to buy, sell or hold and set a buying or selling
price (if they buy or sell), based on the past prices (the length of the past determined
by the trader's time period) and variation thresholds.
- The amount of money to be invested (i.e. a fixed fraction of the
trader's current balance) by potential buyers, and the number of stocks to be sold by
potential sellers (i.e., a fixed fraction of the stock he holds) is computed.
- The buyers are ordered at random.
- The first buyer tries to buy as many stocks as possible (he is
allowed to buy only if his price is greater than the seller's price)
- If he is unable to buy even one stock, the same is repeated for the
next buyer.
- The transaction stopped after the first buyer who buys non zero
number of stocks.
- The price for that instant is fixed at the buyer's price.
- Return to step 1.
Using the Simulation
The screen displays two plots, a grid and an area for the user to input his parameter
selection. The top left graph is self explanatory and displays the stock price at each
instant. The top right graph displays the number of potential buyers (in
blue), sellers (in red) and holders (in
green) respectively. The grid in the left botton represents the status of the
traders, with each square representing a trader. as above, buyers are represented in blue, sellers in red and holders in black.
The size of each colored square is indicative of the amount of money held by the trader.
The bottom right represents the user input area and contains fields for the user to set
parameter values.
Number of Traders
Self-explanatory.
Period of Evaluation
Length over which the
trader observes trends. The traders are each assigned positive integers less than or equal
to the period of evaluation.
Threshold
Minimum required fractional change
in the stock price, that the trader considers significant. The traders are assigned
positive real numbers less than or equal to the threshold.
Total Number of Stocks
Sum of stocks owned
by all the traders. These stocks are distributed randomly amongst the traders.
Starting Seed
Reinitializes the distribution of stock,
money, time periods and thresholds of the different traders. For the same number of
traders, stocks, and money, changing starting seed results in a wide variety of behavior.
Future Improvements
The simulation presented here is a first step towards demonstrating the rich variety of
behaviors that can be exhibited by a group of agents governed by simple rules. It is seen
that, even without any online learning a dynamically changing behavior results. Some of
the interesting avenues that are currently being developed are:
- The incorporation of the cellular automata type rules, where
the behavior of each trader is influenced by the behavior of geographic neighbours, whose
effects would include magnification of current trends.
- The incorporation of a performance criterion, which would make the
trading decisions goal oriented. Currently, the traders simply try to follow the price
trends and do not directly optimize the expected profits.
- The incorporation of a learning tool such as a genetic algorithm to
tune the parameters of the traders and maximize the performance based on the performance
criterion defined earlier. It is expected that intelligent trading strategies can be
extracted from the parameters of the fittest trader that emerges from the above
optimization.
- To look for and/or to create phenomena such as speculative bubbles
and crashes, and other price variations seen in real stock markets.