Last updated on December 12, 2018 by Kornel Mazur

Test strategy in MetaTrader 4 with tick precision

New Strategy Quant X Data Manager as well as QuantDataManager now allows you to export special FXT & HST files for MetaTrader 4 that allow you to test your strategies in MT4 with the highest possible modeling quality.

It does it by exporting tick data from StrategyQuant and using them in MT4 Strategy Tester.

Step 1: Export FXT & HST data to MetaTrader4

Go to Data manager, choose some tick data and click on Export to MT4 (FXT & HST) button on the toolbar.

This will open a new dialog where you must specify more details.

First of all you should specify the date range to be exported.

If you are doing it for the very first time, you also must specify the path to your MetaTrader4 installation. SQ X needs it so that it generates the files in the appropriate folders.

The last thing is to choose the correct MT4 symbol and its setting on the lower half of the dialog.
The symbol is usually recognized automatically, but if you use some exotic forex symbol you might need to choose the symbol yourself and even perhaps export the actual settings of your MetaTrader. This is explained more in the Troubleshooting section.

When everything is configured properly click on Start export. Data Manager will now start generation of FXT & HST files that will be used in MT4 Strategy Tester to achieve high quality backtest.

Note! You must turn off MetaTrader before export, otherwise there might be errors in the exported files.

Step 2: Start MetaTrader and run strategy backtest

Start your MetaTrader, open Strategy Tester, choose some strategy to be tested and the symbol you just exported. You can leave the Use date unchecked – it will perform test on the whole exported data.
When your backtest finishes go to Report and you should see that the backtest was made with 99% modeling quality.

Possible issue – Custom MT4 settings or missing symbol

When you use some exotic symbol or you want to use exactly the same trading settings as in your MT4 installation you can use our script to export your MT4 symbols details.

To do that you have to run our specila script that exports MT4 symbol detalt to a file for use in Data manager.

The custom script is in folder {SQ installation}/custom_indicators/MetaTrader4/Scripts, it is named ExportProperties.mq4

Copy this script to your {MT4 Data folder}/MQL4/Scripts folder and restart MetaTrader.

Then go to Tools -> MetaQuotes Language Editor and open this script. By default it exports properties for the symbols: EURUSD,GBPUSD,AUDUSD,NZDUSD,USDCAD,USDCHF,USDJPY spedified in the array in the beginning of the script. If yout broker uses different symbol names or you want to test another symbols add them to this array.

Then click on Compile to compile the updated script.

Now you must start the script on any open chart. You can do this by going back to MetaTrader, finding the script in the Navigator and drag & drop it to some chart.

Make sure that your MetaTrader is connected to the broker, otherwise it wouldn’t work.

When the script finishes it will export the properties of configured symbols to a file {MT4 Data folder}/MQL4/Files/

Copy this file to some folder where you can easily find it later.

Now in the Step 1 where you configure your export click on the link Load other MT4 data specification file and find your file.

It will load your newly generated file with the current properties for every symbol in your MetaTrader. Then just chose the right symbol, click Export and it is done.

Possible issue – Backtest doesn’t produce trades or there are errors in the Journal

Backtest doesn’t produce trades or there are many errors in the Journal.

Most probable reason is that the properties of the symbol used during FXT export don’t match settings of your broker. You have to export your own symbol properties from MT4 and use them in Data manager using the steps described in Possible problem 1.

Possible issue – Modelling quality is n/a

Sometimes the modeling quality in MT4 results page isn’t shown as 99%, but as n/a.

This is less serious than it seems, it means that MetaTrader is unable to determine the modeling quality. We haven’t found a reason why it sometimes happens, it seems it is related to particular MT4 installation.

However, as we see in the picture above, despite modelling quality being n/a there are no errors, and the whole modeling bar is green.
So it means the backtesting worked on real tick data with no errors, it is a problem of MetaTrader that it cannot compute the correct modelling quality for some reason.

It is usually an issue in the particular MetaTrader installation, another installation of MetaTrader running on the same FXT data will return 99% modeling quality.

Above is a screenshot of two different MT4 installations testing the same strategy on the same data.
First has modeling quality 99%, second hs n/a, but as you can see the ticks modelled and strategy results are exactly the same.

To sum it up – you don’t need to worry about n/a modeling quality if there are no chart errors and the whole bar is green.

Was this article helpful? The article was useful The article was not useful

Newest Most Voted
Inline Feedbacks
View all comments
June 26, 2019 12:17 pm

I Can’t find ExportProperties.mq4. Can someone share that file with me? Thanks in advance.

Mark Fric
Mark Fric
Reply to  kingsman
July 2, 2019 10:22 am

this script is located in folder {StrategyQuant}\custom_indicators\MetaTrader4\scripts in your StrategyQuant X installation.

December 4, 2019 6:28 am

Hi admin

After buying the software, I wrote mail to the Hong Kong support team in yesterday, but I haven’t received a reply yet. I wonder if we can get a solution here.
Fault description:
After import, the following failure information appears in the log file with MT4 sample EA.
19:00:05 MACD Sample USDCHF,M1: OrderModify error 130
19:00:10 MACD Sample USDCHF,M1: OrderModify error 130
19:00:10 MACD Sample USDCHF,M1: OrderModify error 130
Although I found the description of the problem on the official website, I could not find the solution.So can you give me a solution?
thank you

Reply to  zhuzhiqiang
January 22, 2020 8:27 pm

Hello, the error 130 means: “invalids stops” and is more related to the strategy than data used. You can provide the strategy to us and we can check [email protected]

Lukasz Bajor
Lukasz Bajor
January 24, 2020 2:03 am

I Can’t find ExportProperties.mq4. Can someone share that file with me? Thanks in advance. I have only got QDM pro license and not strategy quant

Reply to  Lukasz Bajor
January 24, 2020 9:50 pm

Hi, this script is located in folder {QuantDataManager}\custom_indicators\MetaTrader4\scripts in your QuantDataManager installation.

February 11, 2020 5:33 pm

Why the error “Invalid MT4 data specification file.” ? How to fix? What am I doing wrong?

Reply to  MacMil
February 11, 2020 9:17 pm

Hello, did you create the MT4 data specification file using the ExportProperties.mq4 script?

Reply to  tomas262
February 12, 2020 8:03 am

yes I created. Here is my appeal . I did everything according to the instructions .

Reply to  MacMil
February 12, 2020 8:16 am

rechecked everything. It turned out that the wrong file was uploaded. you have to be careful! =)))

September 6, 2021 2:01 pm

Pls advise how to export the tick data to Mac version MT4, Thanks!

November 15, 2021 12:43 am

Hello. Talking about QDM Pro version, is it possible to export multiple symbols in a time in MT4? Thanks in advance.

Heta Saputra
Heta Saputra(@hetasaputra)
December 22, 2021 11:09 am

Can I copy the downloaded historical data from one MT4 for use in MT4 from another broker?

Reply to  Heta Saputra
December 22, 2021 11:53 am

We have not tested this but it could work. Simply move all HST and FXT files from one to another MT copy

January 15, 2022 1:56 pm

Здравствуйте! Как почистить память диска? 24 гигабайта заняла информация за 2.5 года тиков

Reply to  Алексей
January 17, 2022 9:57 pm

Hi, it is very normal. Tick data is huge. Unless really necessary use M1 data instead
Привет, это очень нормально. Тиковые данные огромны. Если это действительно необходимо, используйте вместо этого данные M1.

Reply to  tomas262
January 19, 2022 7:35 pm

Не, нужны именно тиковые данные. Но как потом почистить память? Где всё сохраняется?