Backtesting Limitations

When using the backtest/optimizer it is important to understand that it is not able to replicate exactly what will happen in a real world environment. This is not a fault with the software specifically, but the results do tend to present an optimistic result (there are some options that you can use to change this, see below). Below are some important things to consider when running a strategy based on information generated from the backtest/optimizer. As always we recommend you run forward tests on a broker demo account, we do not recommend going straight to a live account.

Market Order Fills In order case, the strategy is placing market orders for entry and exit of positions. The behavior of a market order is that it guarantees that your order will be filled, but the fill price is not guaranteed. This is perhaps the most crucial difference between the optimizer environment and the exchange (real world). In the real world, you need to consider the following factors:

  • Speed of the Market – In a fast moving market the current bid and ask values are going to jump very quickly making the fill price much more unpredictable (especially if it is trending).

  • Physical Location – Depending on your physical location and network routing, the delay between the software placing the order and the exchange receiving the order can significantly affect the fill price (since the best bid/ask values may have shifted).

  • Exchange Fill Policy and Place in Queue – In most cases, its probably safe to say that you are not the first order to be filled when the order is submitted. Most (if not all) exchanges implement a queue for filling orders. Some exchanges may even give priority to volume customers filling their orders first. This of course will affect the fill price for your market order.

Historical Data Settings Minute bars versus tick data. Each minute bar will only have 4 ticks (open, high, low, close). This will have a big effect on how the strategy executes. A more realistic environment would be to use tick data.

Order Fill Settings By default the optimizer will fill on last price. This is very optimistic, consider filling on the Bid/Ask instead. The tick data can include the bid and ask values when the tick occurred. Please note that this is still optimistic (see Market Order Fills section above). You could also choose a slippage value (instead of Bid/Ask). This will fill your orders by the given number of ticks away from the last price. It will probably be harder to optimize the strategy for profit, but at least it will be more realistic.

Commissions Are you configuring your commissions before your backtest/optimize. Commissions can reduce net profit by a significant margin.

Last updated