November 2019
Beginner
394 pages
10h 31m
English
The for-loop backtester is a very simple infrastructure. It reads price updates line by line and calculates more metrics out of those prices (such as the moving average at the close). It then makes a decision on the trading direction. The profit and loss is calculated and displayed at the end of this backtester. The design is very simple and can quickly discern whether a trading idea is feasible.
An algorithm to picture how this kind of backtester works is shown here:
for each tick coming to the system (price update): create_metric_out_of_prices() buy_sell_or_hold_something() next_price()