A backtest is a simulation of a model-driven investment strategy's response to historical data. The purpose of performing experiments with backtests is to make discoveries about a process or system and to compute various factors related to either risk or return. The factors are typically used together to find a combination that is predictive of the return.
While working on designing and developing a backtest, it would be helpful to think in terms of the concept of creating video games. In a virtual trading environment, components are needed for the simulation of price feeds, the order-matching engine, the order book management, as well as functions for account and position updates. To achieve these functionalities, we can explore the concept of an event-driven backtesting system.
In this chapter, we designed and implemented a backtesting system that interacts with...