• Overview
  • Reviews (1)
  • Comments (7)

HistoryShifter

This simple tool allows you to shift MT4 history data by some years to check that an EA does not filter out losing days in backtests.
You can check any EA you want.
1) I recommend doing a 28-year shift as it results in the exact same distribution of the weekdays over the year because 28 years contain 7 leap years. For example, if July 1 is a Monday in 2019, then it was also a Monday in 1991.
So an EA that does not use any special date filters, should, in theory, have the exact same trades if the same data is shifted by 28 years.

2) Open the History Center. Go to MT4 terminal Toolbar -> Tools -> History center or simply press F2.

3) Select the symbol (currency pair) you wish to use and click on the 'Download' button to download the historical data (Figure 1).

4) Double-click on each timeframe. The number of records is shown at the top of the History Center window (Figure 2).

5) Open Strategy Tester and set the desired value for the YearsToShift parameter. I recommend using YearsToShift=28 (Figure 3).

6) To export historical data, run a backtest on the selected symbol using 'Every Tick' method and period M1. Set the spread tо 0 (Figure 4).
Wait until the test is over. It may take a long time (depends on your PC speed).
It's necessary to export/import all timeframes (M1....MN1) because an EA can use several timeframes at once.
7) The exported/shifted data (in MT4 format) is located in the 'Common\Files' directory. This is a common directory for all MT4 and MT5 terminals (Figure 5). To open it, go to File -> Open Data Folder -> Up to 'Terminal'-> Common\Files

You can also find it by this path: C:\Users\%USERPROFILE%\AppData\Roaming\MetaQuotes\Terminal\Common\Files

8) Remove old historical data. Go to File -> Open Data Folder, close MT4 and make a backup of 'history' directory, then delete it (Figure 6).

9) Restart MT4. 

10) Open the History Center, double-click on the symbol, then double-click on each period (1 Minute...Monthly), and import the shifted data (all timeframes!) into MT4 (Figure 7).

11) Backtest an EA and compare results. If there is a large difference, there might be the EA filters out losing days in the backtests (Figure 8).


Recommended products
Filter:
Sergey Zhuravkov
1793
Sergey Zhuravkov 2020.07.22 14:03 
 

К сожалению я так и не смог протестировать, что то пошло не так (((