How to backtest using tick data with Metatrader 4
If you’re trying to follow this guide, you must have gone through acquiring tick data and converting it for Metatrader 4 usage and as a result you should have the HST files in your history\[your broker's name] folder and the FXT in your tester\history folder. If you’re not at this stage, please revise the guides linked above.
This guide is split in several sections:
- Enabling tick data backtesting
- How to verify it worked
- Running multiple Metatrader 4 instances from the same folder
Enabling tick data backtesting
Since the recent Metatrader 4 client builds no longer offer the ability to use custom FXT files, you need to run a special software that enables it to do that.
At this point, you have two options:
- You can use the Tick Data Suite, which is a commercial (aka paid) software that has more features than the free script and is fully supported. A trial version is available.
- Alternatively, you can use the completely free Birt’s patch script which has some limitations*. No support is available.
*The limitations that apply to the free script include but are not limited to:
For a more in-depth comparison table, please head to the Feature matrix page.
Depending on your choice above, please follow the relevant guide:
How to verify it worked
If your backtest is running and the file in tester\history was not recreated, it usually means everything is ok. Naturally, it’ll skip the “Collecting M??” and “Using M??” steps. At the end of the backtest, you should see a red bar (it’s normal) in the results tab and modeling quality 99% in both the results tab as well as on the balance chart.
If you run into any problems, please head to the FAQ & Troubleshooting page.
Running multiple Metatrader 4 instances from the same folder
If you’re using the Tick Data Suite, this is done automatically and you can start as many MT4 terminal instances you wish from the same folder.
Otherwise, if you are using the Birt’s patch script and you need to run multiple instances from the same folder you can use one of the loaders available in the loader archive on the tick data downloads in the Miscellaneous section. These loaders are working with builds 225-409; the generic loader in the main folder works with builds 405-409 while the generic loader inside the old folder will work with older versions. There are also individual loaders for several older builds but the generic loaders should work for pretty much everyone as long as the build used is not above 409. Please note that no support is available for these loaders.
Keep in mind that the generic loaders will need to configure themselves for your particular build so they will display a series of messages and close your terminal once the relevant offsets are found. This only happens the first time you run them and it is perfectly normal.
Regarding the crashes, it sounds like something is seriously wrong with your computer.
If you followed the download and process instructions correctly, you should have ended with an FXT file for the currency pair and timeframe that you want to backtest on. For instance, if you want to backtest on EURUSD M1, you should have EURUSD1_0.FXT in your tester/history folder. Assuming you have that FXT there, you’d need to select EURUSD as currency pair and M1 as timeframe for your backtest.
Also note that it’s not necessary to enable “visual mode” and you shouldn’t enable “use date” until you’re comfortable with the whole procedure. Finally, I would recommend not backtesting the EA you intend to backtest but starting with the MACD Sample and getting that one with 99% modeling quality before you move on to yours.