Topic: MT5 backtesting error

Dear community,

I recently created an EA with the Expert Advisor Studio and received errors that likely distorted the backtesting results. You can read the errors in the log that I uploaded. From what I understand the MT5 software has an issue with the ticks, prices and bars being supposedly absent.

HP    3    16:29:55.924    Core 1    EURUSD : 2015.12.24 23:59 - real ticks discarded for 4 minutes out of 1138 total minute bars within a day
LN    3    16:29:55.924    Core 1    EURUSD : 2015.12.24 23:59 - 520 tick prices mismatch for 4 minute bars
LD    3    16:29:55.924    Core 1    EURUSD : 2016.01.11 23:59 - real ticks discarded for 1 minutes out of 1439 total minute bars within a day
FH    3    16:29:55.924    Core 1    EURUSD : 2016.01.11 23:59 - 72 tick prices mismatch for 1 minute bars
JD    3    16:29:55.924    Core 1    EURUSD : 2016.03.22 15:37 - 2016.03.22 23:59  36 minute bars absent within a day while real ticks present
QG    3    16:29:55.924    Core 1    EURUSD : 2016.03.23 17:30 - 2016.03.23 23:59  1 minute bars absent within a day while real ticks present
KJ    3    16:29:55.924    Core 1    EURUSD : 2016.03.24 23:59 - real ticks discarded for 1 minutes out of 1436 total minute bars within a day
GG    3    16:29:55.924    Core 1    EURUSD : 2016.03.24 23:59 - 48 tick prices mismatch for 1 minute bars
HP    3    16:30:08.131    Core 1    EURUSD : 2016.10.13 15:42 - 2016.10.13 23:59  3 minute bars absent within a day while real ticks present
MO    3    16:30:08.131    Core 1    EURUSD : 2016.11.29 23:59 - real ticks discarded for 1 minutes out of 1430 total minute bars within a day
GR    3    16:30:08.131    Core 1    EURUSD : 2016.11.29 11:16 - 2016.11.29 23:59  10 minute bars absent within a day while real ticks present
LF    3    16:30:08.131    Core 1    EURUSD : 2016.11.29 23:59 - 184 tick prices mismatch for 1 minute bars
MQ    3    16:30:26.441    Core 1    EURUSD : 2017.06.05 00:01 - 2017.06.05 23:59  18 minute bars absent within a day while real ticks present
FQ    3    16:30:26.441    Core 1    EURUSD : 2017.06.06 00:00 - 2017.06.06 23:59  18 minute bars absent within a day while real ticks present
DP    3    16:30:26.441    Core 1    EURUSD : 2017.06.07 00:03 - 2017.06.07 23:59  11 minute bars absent within a day while real ticks present
MP    3    16:30:26.441    Core 1    EURUSD : 2017.06.08 00:00 - 2017.06.08 23:59  11 minute bars absent within a day while real ticks present
JP    3    16:30:32.545    Core 1    EURUSD : 2017.09.12 23:59 - real ticks absent for 176 minutes out of 1421 total minute bars within a day
Post's attachments

20220721.log 15.06 kb, 1 downloads since 2022-07-21 

You don't have the permssions to download the attachments of this post.

Re: MT5 backtesting error

The experts created with EA Studio trade at the bar's Open price (except Take Profit and Stop Loss).

The fastest way to test them in MT is to use the "Open price only" option.

https://image-holder.forexsb.com/store/mt5-backtest-open-price-only-thumb.png


> From what I understand the MT5 software has an issue with the ticks, prices and bars being supposedly absent.

Yes, you are right. Therefore, we created EA Studio to trade on the only fixed price - Bar Open.


> received errors that likely distorted the backtesting results

The backtest should match. MT uses ticks to trace the price within the bar. It doesn't affect the Open price.

If you see a deviation between MT and EA studio results, it must be due to differences in the data, the account or trade settings, or the testing interval.

Re: MT5 backtesting error

Thank you very much for the quick answer Popov.

Popov wrote:

If you see a deviation between MT and EA studio results, it must be due to differences in the data, the account or trade settings, or the testing interval.

I used MetaTrader-Demo as the data source when creating the EA and therefore backtested it on a MT-Demo account. The account uses a 10k balance and a leverage of 1:100 (matching the account setting of the EA Studio). So the issue must be in either the trade settings or the testing interval as you say. How can I find out which one of those is causing the deviation?

Re: MT5 backtesting error

> I used MetaTrader-Demo as the data source when creating the EA and therefore backtested it on a MT-Demo account.

There is a considerable difference between the data sets of the different brokers.

The provided "MetaTrader-Demo" data were used only for quick testing of EA Studio. We are going to remove them soon from the application. The included "Premium Data" are more reliable.

You have to import data from MT to achieve the best performance correspondence.

Go to the "Data" -> "Data Import" page of EA Studio.
Use the scripts (the one for MT5) to export files from your broker and Drag / Drop them in EA Studio.
The imported files contain most of the required settings.

There is a help article for the Data Import under the "Help" tab of EA Studio.

The usual testing workflow is:
- export data from MT and import them into EA Studio
- generate strategies
- export experts or a Portfolio expert
- backtest them in MT to see if everything is OK
- run the best experts on a demo for 3,4 weeks for forward-testing
- repeat

5 (edited by kstoltenberg 2022-07-24 22:50:35)

Re: MT5 backtesting error

Thank you, it works now as intended. Is there a way to integrate a news filter in the EA Studio? I'm currently planning on editing an M15 EA and want it to stop trading during high impact news in order to minimize risk.