This pioneering book describes the applications of agent-based modeling to financial markets. It presents a new paradigm for finance, where markets are treated as complex systems whose behavior emerges as a result of interactions of market participants, market institutions, and market rules. This includes both a presentation of the conceptual model and its software implementation. It also summarises the result of the profound research on the successful practical application of this new approach to answer questions regarding the NASDAQ Stock Market's decimalization that was implemented in 2001.The book presents conceptual foundations for modeling markets as complex systems. It describes the agent-based model of the NASDAQ stock market, including strategies used by market-makers and investors, market participants interactions, and impacts of rules and regulations. It includes analyses of simulation behavior, comparison with the behaviors observed in the real-world markets (existence of fat tails, spread clustering, etc.), and predictions about possible outcomes of decimalization. A framework for calibrating the market behavior and individual market-makers strategies to historical data is also presented.