by Abhishek Mistry

For decades financial market research has focused around analytic frameworks based on the assumption of rational behavior. The most notable result of this research is the efficient markets hypothesis, which states that if a market is fully efficient then prices fully reflect all available information. More recently, however, many have pointed out that actual markets do not seem to show rational behavior. Rational models do not account for such market characteristics as volatility clustering and excess volume. Furthermore, so-called noise traders who do not follow any price-fundamental approach to trading seem to persist, despite what the efficient markets hypothesis would have us believe.

Several new paths of research have branched from the realization that agents in financial markets are not fully rational. One promising technique is the use of agent-based simulations. The idea is to model a market constructively using intelligent agents. These agents can represent various entities in a market, such as traders, market makers, research analysts, investors, and so on. The agents will interact in a manner analogous to the real world, thus enabling us to simulate market dynamics.

- Build a market.
The first goal of my project is to build a flexible, extensible financial market simulation. At first the simulation will consist only of traders and market makers with the traders buying and selling at random. Later, the simulation will include a price-fundamental approach where technical analysis and intelligent behavior is possible. The framework must allow study of the effects of various kinds of trading behavior.

- Study market characteristics
I want to use this simulation to study market microstructure. By trying different kinds of traders and clearing mechanisms, we can determine properties of markets. For example, suppose all traders are of type t

_{1}. We see a market with no volatility clustering. Now we change the trading algorithm to t_{2}and as a result, volatility clustering appears. We have discovered that something about t_{2}causes volatility clustering in this setting. Another interesting features is the effects of these changes on the traders themselves. Suppose in the above example that another trader, t_{3}, exists in both markets. In the first market he makes money, but in the second market he loses. We have now discovered that trader t_{2}causes t_{3}to lose. By using this kind of comparative analysis, we can study financial markets. - Bridge gap between computer science and economics
Few computer scientists know anything of financial market theory. Few economists know much of computer science theory. Much of my work has focused on developing a framework upon which other economists may build simulations. I bridge this gap by creating a mathematical framework for simulations based on artificial intelligence research and computation theory. I then develop a program based on the framework and extend it to the task at hand, namely studying financial markets. It is my hope that this can serve as a guide to others who wish to study social science by using a computer simulation.

So far I have built two kinds of simulations using this model.

SimpleMarket - In this market, traders buy and sell at random with equal probability. As we would expect, little can be predicted about the behavior of the price. It appears to follow a random walk, that is, prices may fluctuate up or down, but on average they will have the same value as the initial value. This makes sense because of the random behavior of the traders.

- FundamentalMarket - This is where the simulation becomes
interesting. In this market, a corporation agent periodically resets
the price to the fundamental value (the true value) of its stock. This
introduces defined trading periods. In each period, the traders buy
and sell according to their expectation of the true value of the
stock. If their expectation is correct, they will make money.
Conversely, if they predict incorrectly, they will lose money.
Within this simulation, I introduced two new kinds of traders. One type of trader, the technical trader, will examine the past 3 prices of a given stock to determine if other traders are buying or selling. He assumes that whichever trend he finds, this trend will continue. So, if the pattern is selling, he will sell. The trader will in isolation bid down the price by his selling and so he will gain from his actions.

Another trader is a "smarter" trader. He determines the same kind of trend; however, if he sees a selling pattern he figures the technical trader will sell even when the true value is above the price. Thus, he will take the opposite position and buy. By doing the exact opposite of the technical trader, he gains and actually forces the technical traders to lose.

Finally, here are some screenshots of the program:

The program can output data in comma-delimited format (.csv) so that the user can perform data analysis.