Just replicated the following paper which implements an artificial stock market by means of multi-agent simulation: http://www.uni-bamberg.de/fileadmin/uni/fakultaeten/sowi_lehrstuehle/vwl_finanzwissenschaft/Forschung/BERG/Nr.61_F.Westerhoff.pdf
There are two types of traders: technical and fundamental traders who interact in two ways: They trade through the stock exchange and they talk to each other so that they can see which strategy is superior. This raises their propensity to reconsider their trading style. It is interesting to see the dynamics of the market: That e.g. technical tradings (basically trend followers or momentum traders) destabilize the market while fundamental traders stabilize it by their rebalancing (=contrarian) behavior.
What is also interesting to see is that many well known stylized facts can be reproduced like excess volatility, volatility clustering, fat tails, no autocorrelation in returns but significant autocorrelation in absolute returns.
I used NetLogo to run the model which was controlled by R (through the excellent RNetLogo package) so that I could use the full power or R to analyze and plot the resulting data.
That was fun! I always wanted to have something like that :-)
(...but the real work starts now!)