A backtest is a simulation of a model-driven investment strategy's response to historical data. While working on designing and developing a backtest, it would be helpful to think in terms of the concept of creating video games.
In this chapter, we will design and implement an event-driven backtesting system using an object-oriented approach. The resulting profits and losses of our trading model may be plotted on to a graph to help visualize the performance of our trading strategy. However, is this sufficient enough to determine whether it is a good model?
There are many concerns to be addressed in backtesting—for example, the effects of transaction costs, execution latency of orders, access to detailed transactions, and quality of historical data. Notwithstanding these factors, the primary goal of creating a backtesting system is to...