Backtesting on the wrong data

Table of Contents

Understanding Backtesting

We all know backtesting is a must before going live with a trading strategy and this is obviously a good thing. You need to understand where your EA can go wrong and find solutions to avoid those situations in the future. Both MT4 and MT5 have good Backtesting modules which can add tremendous help for a strategy builder, having a multitude of features like visual tester, genetic re-construction of prices or even real ticks backtesting (on mt5).

One backtesting aspect that might ruin a good strategy

However, one would assume that all aspects of the backtest are taken care of, and the EA owner will just need to run the stragegy and see its results…but is is not like that. One potentially harmful aspect is data quality.

If you are testing your EA with an MT4, MT5 broker, you are, most probably, using that broker’s historical data. In some cases, that broker might have incorrect prices on a certain instrument, on certain timeframes, and in certain time periods.

One example is shown below, for a backtest on an mt4 platform, with the 1 min timeframe and the backtesting option: every tick. This is the most precise backtesting method available on mt4 (and I chose 1 min time-frame because my strategy is built this way).

On the left side you can see the normal price behavior and expected EA actions taken but on the right side on the chart you can clearly see quick price spikes that clearly were not happening at that time and though, unexpected EA behavior.

MT4 case:

Incorrect data for backtest

MT5 case:

Wrong history data mt5

If you are not backtesting with visual mode (which no one does, especially of you test longer time intervals) you will most probably, not see this issue in your testing. So you can get fake backtest results just because of this issue.

To be clear: this is your responsibility, the Broker is giving you the data as it is, they don’t have the clean data responsibility. Also, the backeterstar as a software is working with the data you feed it, so no blame on the mt4/mt5 backtester can be made here.

What can you do:

  1. know your strategy well enough to see that something is wrong in the results and then dig deeper to find the issue and fix it
  2. make separate backtests, on different time intervals and see if there are any bug discrepancies between the results (however there are strategies that do have very different results, depending on the market context we are in – in these cases the historic data could be correct)
  3. use a different broker’s data if you think/see that a broker has incorrect data
  4. import data from a trusted source and use the mt4/mt5 backtesting capabilities (see below screenshot for mt4)
IMport prices mt4

Conclusion:

Building a good strategy is never easy. However, it would be best if you made sure that the building blocks are solid. Some of these are:

  • starting from a good trading concept (something that makes sense in the markets)
  • all trading scenarios should be covered by your trading rules (ex: when do you open a trade, when do you close a trade, etc)
  • backtest your strategy (or the market will blow your account sooner or later)

Table of Contents

Products

Categories

Tags

Recent Posts

VBot Weekly Performance:

Time Period: 02.04 - 05.04.2024