Using virtual stock markets with artificial interacting software investors,
aka agent-based models (ABMs), we present a method to reverse engineer
real-world financial time series. We model financial markets as made of a large
number of interacting boundedly rational agents. By optimizing the similarity
between the actual data and that generated by the reconstructed virtual stock
market, we obtain parameters and strategies, which reveal some of the inner
workings of the target stock market. We validate our approach by out-of-sample
predictions of directional moves of the Nasdaq Composite Index.