We formulate a microscopic model of the stock market and study the res
ulting macroscopic phenomena via simulation. In a market of homogeneou
s investors periodic booms and crashes in stock price are obtained. Wh
en there are two types of investors in the market, differing only in t
heir memory spans, we observe sharp irregular transitions between eras
where one population dominates the market and eras where the other po
pulation dominates. When the number of investor subgroups is three the
market undergoes a dramatic qualitative change - it becomes complex.
We show that complexity is an intrinsic property of the stock market.
This suggests an alternative to the widely accepted but empirically qu
estionable random walk hypothesis.