MetaTrader 5 Strategy Tester: bugs, bugs, suggestions for improvement

 

The MetaTrader 5 Strategy Tester is currently undergoing an in-depth revision by the MQ team. Despite the fact that over the past two years a lot of work has been done (thanks to the MetaQuotes team), this tester raises a lot of questions. Unfortunately, the most recent changes are aimed more at the visual appearance of the tester, so that beginners could work easier with it, while the mechanisms of its work still cause questions for more experienced users.

I propose to dedicate this thread to the constructive criticism of the MetaTrader 5 tester and turn it into a place where you can reach the immediate developers.

All statements/discussions/criticism/rebuttals should be supported with clear arguments and reproducible results. I ask to focus the discussion on the mechanism of performance and pricing. Requests about frills, icons and spherical horses in a vacuum (I want all cores to be loaded, I want multi-threading for a single run, etc.) are not welcome, although not prohibited.

So, let's go.


The MetaTrader 5 tester skips execution of Limit orders

1. Given custom ticks as an array MqlTisk in a binary file (attached to the post).

2. The custom data are processed by a special script and loaded into the symbol history. The script is also attached to the message.

An Expert Advisor is launched on the resulting chart and it performs deals according to its logic. The Expert Advisor works in the real ticks mode.

4. At the moment of 00:11:05:085, a limit order was placed at the price of 10422.5. The current price at the moment of placing is 10422.0.

5. At the moment of time 00:11:06.179 Last price occurred at 10424.0. According to the rules of exchange pricing, the SellLimit order should be executed at the price of 10422.5, but this does not happen. The limit order seems to hang in the air, showing complete surrender: the deals take place with someone else offering prices worse than ours!

6. But the miracles begin to continue. The price reverses and falls from 1024.0 to 10419. I.e., the limit order sell level is penetrating from top to bottom. However, the limit order also hangs in the air.

Unfortunately, I could not find any logs showing what is going on. It feels like the tester's logs are just turned off and printf doesn't work. Output to the tester log is off:

In short, it seems to be another problem that wasn't there before.

In this regard, I recorded a video in which you can clearly see what happens (the most interesting starts from about 30 seconds. At the top of the screen the current time is accurate to the millisecond):



The video clearly shows that the range of the bar penetrates the level of the limit order, but the execution does not happen.

There are other questions to the tester. But for now I think we need to deal with it.

Files:
 

MetaTrader 5 Tester does not build bars correctly

This is the custom symbol from the previous post (same data). Thebars are drawn at Last price, which is specified in the symbol settings.

To the left is the bars drawn in the tester. On the right, you can see the initial bars.

You can see that the charts do not coincide completely. The left one has some shit on it.

S.w. Thought it was build by Bid, but look at the deals list - it turns out that such prices were not even in Bid, nor in Last or Ask. I'm attaching the deal feed in text form below.

Files:
deribit_csv.zip  735 kb
 

What build number are you using?

Very strange time in the log 0000.00.00 00:00:00.000

What operating system do you have?

Are files with a log extension saved in the data folder of the tester?

 

1. You did not give the file "deribit1.out.bin". In the attached archive "deribit1.out".

2. You didn't give custom character settings

 
I build bars by Bid. Execution of Limits by Bid/Ask takes place. Everything works (2093 to be exact, I did not check further) correctly.
 
Vasiliy Sokolov:

A good function you are ignoring

MqlTick tiks[];

if (FileLoad("deribit1.out.bin", ticks))
{
// ....
 
Slava:

1. You did not give the file "deribit1.out.bin". In the attached archive "deribit1.out".

2. You didn't give the custom character setting

Pardon me.

 
fxsaber:

A good feature you're ignoring.

Good to know.

 
Slava:

What build number are you using?

Very strange time in the log 0000.00.00 00:00:00.000

What operating system do you have?

Are files with a log extension saved in the tester data folder?

The build is the most recent. 2136. I always use the latest one.

Windows 7 SP1

Logs are saved. Logs appear in the strategy tester log. But nothing is displayed in the visualizer log in the strategy tester.


 
Vasiliy Sokolov:

Pardon me.

Thank you. (chuckles) We'll take care of it.

 

The main suggestion is undoubtedly to automate testing.

Do walk-forward optimisation or something like that. Testing should be on several periods and instruments.

And if you don't want to do that, then let people who don't have a degree in programming engineering (or a degree?) do it with MQL tools.

To do so we need the possibility to read and write (Get__ \Set__) the beginning and the end of the testing period, the beginning of the forward period and the possibility to restart the tester with a new testing period.

In addition, the available frame processing facilities do not work properly. Enough has already been written about this here.

Another bug: When restarting the tester with the forward period enabled and the previous parameters, it hangs. We have to change instances, timeframe, instrument or recompile the Expert Advisor.

The last publicly available build is still 2085.