MetaTrader 4 and MetaTrader 5 Memory and Data Loading Management Comparison - page 6

 
Fernando Carreiro:

Please stop getting emotional about it. If you want MetaQuotes to listen and make changes to MT5 then you have to be methodical and logical about it, just as @Alain Verleyen has done in these tests.

You can't go about it half-cocked and ranting about your problems without backing your claims. Things only get solved if you can provide scenarios that can be replicated by others so that the developers can study it properly.

The work that was done here by @Alain Verleyen should have actually been carried out by you in order to back you claims.

I personally am no fan of MT5 and prefer MT4 myself, but when comparing the two, you can't just base it on personal preferences. You have to be scientific about it and substantiate your reasoning.

Don't let emotion cloud your judgement!


Memory peak was proven to be there even in the testing result by Alan. I am not sure what emotion you are talking about when the result proved peak is there.

I wrote the code to test and passed to Alan. Of course, I tested these before anyone else.

This is just one calling function inside timer to make the problem simple. I have several functions inside timer like that. The peak is really trouble some. You might test with calling the same function couple of times. One of the function being written the data to file.


To improve the platform you need to test them in realistic environment outside lab condition. It is even much better if we assume that average users do not know or not willing to control virtual memory or installing other app to controll memory, etc. 90% of users are average and not tech savvy.

Often I get 2 GB memory fluctuations at the start of MetaTrader 5. First five minutes i can not do anything in my computer until it finally settle down.

The same code is fine in MetaTrader 4.


 
Alain Verleyen:

EDIT : I realized that the results I posted yesterday concerning CPU/RAM was flawed because the MT4 platform I was running was on a SSD. So I updated the results, running both platforms on the same hard disk.

After 10 iterations, memory usage is

MT5 use less memory !

This is after starting MT4 and MT5, with the indicator already attached to the chart.

I also decided for this first test to check that all 10 symbols have all the data downloaded already before starting the indicator. An other test should be done with no data to see what will happen.


A second remark about MT5 when the test is initiated by starting the platform :

2018.12.08 20:19:35.533    293936    Counter: 0, Symbol: CADCHF, M1: -1, M5: -1, M15: -1, M30: -1, H1: -1, H4: -1, D1: -1, W1: -1, MN1: -1
2018.12.08 20:19:35.555    293936    Counter: 0, Symbol: EURGBP, M1: -1, M5: -1, M15: -1, M30: -1, H1: -1, H4: -1, D1: -1, W1: -1, MN1: -1
2018.12.08 20:19:35.561    293936    Counter: 0, Symbol: EURJPY, M1: -1, M5: -1, M15: -1, M30: -1, H1: -1, H4: -1, D1: -1, W1: -1, MN1: -1
2018.12.08 20:19:35.561    293936    Counter: 0, Symbol: EURUSD, M1: 500, M5: -1, M15: -1, M30: -1, H1: -1, H4: -1, D1: -1, W1: -1, MN1: -1
2018.12.08 20:19:35.575    293936    Counter: 0, Symbol: GBPJPY, M1: -1, M5: -1, M15: -1, M30: -1, H1: -1, H4: -1, D1: -1, W1: -1, MN1: -1
2018.12.08 20:19:35.585    293936    Counter: 0, Symbol: GBPUSD, M1: -1, M5: -1, M15: -1, M30: -1, H1: -1, H4: -1, D1: -1, W1: -1, MN1: -1
2018.12.08 20:19:35.593    293936    Counter: 0, Symbol: NZDCAD, M1: -1, M5: -1, M15: -1, M30: -1, H1: -1, H4: -1, D1: -1, W1: -1, MN1: -1
2018.12.08 20:19:35.610    293936    Counter: 0, Symbol: USDCAD, M1: -1, M5: -1, M15: -1, M30: -1, H1: -1, H4: -1, D1: -1, W1: -1, MN1: -1
2018.12.08 20:19:35.622    293936    Counter: 0, Symbol: USDCHF, M1: -1, M5: -1, M15: -1, M30: -1, H1: -1, H4: -1, D1: -1, W1: -1, MN1: -1
2018.12.08 20:19:35.632    293936    Counter: 0, Symbol: USDJPY, M1: -1, M5: -1, M15: -1, M30: -1, H1: -1, H4: -1, D1: -1, W1: -1, MN1: -1

The first iteration only grab some data for the current open chart.

It's only at the 4th iterations, that all data are available. It's clearly a weakness of MT5.

2018.12.08 20:20:05.501    293936    Counter: 3, Symbol: CADCHF, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 143
2018.12.08 20:20:05.501    293936    Counter: 3, Symbol: EURGBP, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 308
2018.12.08 20:20:05.501    293936    Counter: 3, Symbol: EURJPY, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 240
2018.12.08 20:20:05.501    293936    Counter: 3, Symbol: EURUSD, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 240
2018.12.08 20:20:05.501    293936    Counter: 3, Symbol: GBPJPY, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 240
2018.12.08 20:20:05.502    293936    Counter: 3, Symbol: GBPUSD, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 240
2018.12.08 20:20:05.502    293936    Counter: 3, Symbol: NZDCAD, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 137
2018.12.08 20:20:05.502    293936    Counter: 3, Symbol: USDCAD, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 240
2018.12.08 20:20:05.502    293936    Counter: 3, Symbol: USDCHF, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 240
2018.12.08 20:20:05.502    293936    Counter: 3, Symbol: USDJPY, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 240

This clearly doesn't happen on MT4 :

2018.12.08 20:20:12.638    293936 EURUSD,M1: Counter: 0, Symbol: CADCHF, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 256
2018.12.08 20:20:12.638    293936 EURUSD,M1: Counter: 0, Symbol: EURGBP, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 256
2018.12.08 20:20:12.638    293936 EURUSD,M1: Counter: 0, Symbol: EURJPY, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 256
2018.12.08 20:20:12.638    293936 EURUSD,M1: Counter: 0, Symbol: EURUSD, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 256
2018.12.08 20:20:12.638    293936 EURUSD,M1: Counter: 0, Symbol: GBPJPY, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 379, MN1: 88
2018.12.08 20:20:12.638    293936 EURUSD,M1: Counter: 0, Symbol: GBPUSD, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 256
2018.12.08 20:20:12.654    293936 EURUSD,M1: Counter: 0, Symbol: NZDCAD, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 454, MN1: 107
2018.12.08 20:20:12.654    293936 EURUSD,M1: Counter: 0, Symbol: USDCAD, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 256
2018.12.08 20:20:12.654    293936 EURUSD,M1: Counter: 0, Symbol: USDCHF, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 256
2018.12.08 20:20:12.654    293936 EURUSD,M1: Counter: 0, Symbol: USDJPY, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 256

However, we have to take all into account, if we check the time needed from the start of the platforms to the first data result, according to the logs, we have:

MT5 : 11.151 seconds

2018.12.08 20:21:12.259    Terminal    Alpari MT5 x64 build 1959 started (Alpari International Limited)
2018.12.08 20:21:23.410    293936    Counter: 0, Symbol: CADCHF, M1: -1, M5: -1, M15: -1, M30: -1, H1: -1, H4: -1, D1: -1, W1: -1, MN1: -1

MT4 : 12.346 seconds

2018.12.08 20:21:15.896    Alpari Limited MT4 build 1090 started (Alpari Limited)
2018.12.08 20:21:28.242    293936 EURUSD,M1: Counter: 0, Symbol: CADCHF, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 256

So if we would modify the script to try again when it doesn't grab the data the first time, there will be no real difference between the platforms.



One remark here is when the data is downloaded, MT5 does not have the problem and it can run like MT4 smoothly.

This is also what I observed too and agreeable.

Howerver when the data is not loaded it is totally different story.

This is why I asked you to check the memory before and after starting the MetaTrader 5 and with completely new chart opened at start. Because this is the moment when MetaTrader 5 become unstable with memory peak.




 

Could you precise the hardware's spec' for which these rates applies please ? 

 
The fact here is that MT4 returned the 500 data reliably whereas MT5 did not return any data. The 1 second being faster in MT5 will not compromise the fact that MT4 reliably loaded all data in its first iteration. Data loaded reliably and only slow by 1 second, it is in fact good job for developer of MT4.

This was my biggest concern with MetaTrader 5 on the other hands. Often with complex Algorithm or calculation, empty data will cause a lot of errors inside code.

When we have to code multiple timeframe algorithm, this is even tougher for developer.


Memory peak and data loading failure are two biggest concerns in MT5. These two might be two seperate or might be one problem.

I will be really looking to be improved soon in MT5 next version.

There is some other problems there too in MT5. But I will be spotting only after these two are fixed because these two are the main concern for most of developers.




MT5 : 11.151 seconds

2018.12.08 20:21:12.259    Terminal    Alpari MT5 x64 build 1959 started (Alpari International Limited)
2018.12.08 20:21:23.410    293936    Counter: 0, Symbol: CADCHF, M1: -1, M5: -1, M15: -1, M30: -1, H1: -1, H4: -1, D1: -1, W1: -1, MN1: -1

MT4 : 12.346 seconds

2018.12.08 20:21:15.896    Alpari Limited MT4 build 1090 started (Alpari Limited)
2018.12.08 20:21:28.242    293936 EURUSD,M1: Counter: 0, Symbol: CADCHF, M1: 500, M5: 500, M15: 500, M30: 500, H1: 500, H4: 500, D1: 500, W1: 500, MN1: 256

So if we would modify the script to try again when it doesn't grab the data the first time, there will be no real difference between the platforms.

 

My own experience ; as soon as many symbols are needed, data loading becomes problematic ; it requires a strict but not too stressful routine for the memory, not impossible, not easy nor convenient either. 

 

btw a parenthesis, on 1958, what is that ? 

cannot open file 'TestService.ex5'
-----
Services	loading of TestService failed [532]
LiveUpdate	download 'mt5clw64' failed

 

Just connected with one chart opened, no indicators, nothing. Don't tell me everything's alright, come on ! 

Gonna make a new fresh installation. The installer has been updated and changed too :)

 
Fernando Carreiro:

Please stop getting emotional about it. If you want MetaQuotes to listen and make changes to MT5 then you have to be methodical and logical about it, just as @Alain Verleyen has done in these tests.

You can't go about it half-cocked and ranting about your problems without backing your claims. Things only get solved if you can provide scenarios that can be replicated by others so that the developers can study it properly.

The work that was done here by @Alain Verleyen should have actually been carried out by you in order to back you claims.

I personally am no fan of MT5 and prefer MT4 myself, but when comparing the two, you can't just base it on personal preferences. You have to be scientific about it and substantiate your reasoning.

Don't let emotion cloud your judgement!

Thanks Fernando, as I am just tired about these whining.

I published objectives results and everyone can draw his own conclusions.

Mine is : in general there is no problem to code big and complex projects with MT5, they are running faster than with MT4. I have a lot of costumers using my code (even if they sometimes don't know it's my code) and I never get complaints about speed or crash or whatever. For sure MT4 is more stable and reliable, mainly as coder, which is perfectly logical given MT4 is no more developed.

mql5 language and MT5 platform are more difficult to master, that's not within reach of every amateur coder like was(is) MT4/mql4. And this last point is the main reason for most of the complaints.

For sure MT5 can be improved, but I demonstrated that MT5 uses less memory than MT5 in this specific test case. And here is the status of both platforms, several hours after the indicator was removed of the chart. Of course a memory peak is normal, what is the memory of a computer if not to be used !

If I made an error in the test I will be happy if someone can point it out. I posted the speed results on Russian forum, asking Metaquotes developers if it's normal. We will see if they answer.

 
Young Ho Seo:


One remark here is when the data is downloaded, MT5 does not have the problem and it can run like MT4 smoothly.

This is also what I observed too and agreeable.

Howerver when the data is not loaded it is totally different story.


Of course it is different. If data are not downloaded MT5 will download them automatically, while MT4 will not download them and stay with incomplete data !

I made to test with complete data intentionally, to have something comparable. If someone want to make the tests starting with 0 data, all information are available to do it.

Also I hope you don't use code like you posted in a real project, download 500 candles on 9 timeshares every 10 seconds is insane. But certainly you know that already.

 
Icham Aidibe:

Could you precise the hardware's spec' for which these rates applies please ? 

It was published.