MetaTrader 4 and MetaTrader 5 Memory and Data Loading Management Comparison

 

I have built an indicator with MQL5 and MQL4 language compatible.

I put the same indicator from the same code on both MetaTrader 4 and MetaTrader 5 (Build 1958).

The results is surprisingly controversy showing MetaTrader 5 can have some memory peak potentially squeezing the available memory in your computer.

This screenshot explains that memory peak might be the potential source of freeze, crash and slow down of your computer especially if you have small memory in your computer.

Another related issue is the delays in data loading in multiple timeframe and multiple symbols in MT5.

This might be the separate or the same problem from the memory peak issue.  

Can you please focus more on stability side for your future work with MetaTrader 5 instead of adding new features to MT5 ?


As one of the big fan of MetaTrader, this is my very wish to see the improvement in these two issues in the near future.

1. Controlling memory peaks as discussed in this post

2. Efficient data loading of MT5 as in MT4 for multiple timeframe and multiple symbols.

 
Young Ho Seo:

I have built an indicator with MQL5 and MQL4 language compatible.

I put the same indicator from the same code on both MetaTrader 4 and MetaTrader 5 (Build 1958).

The results is surprisingly controversy showing MetaTrader 5 is unstable.

This screenshot explains how difficult we feel  when we work with MetaTrader 5 at the moment.

Static array memory management seems unstable. In addition, I might think there is some memory leak with dynamic array with MetaTrader 5 too.

This code was fine tuned to get rid of all the dynamic array because MetaTrader 5 keep increasing Memory with them.


The question is when can we expect to have the same stability with MetaTrader 5 as in MetaTrader 4?

Can you please focus more on stability side for your future work with MetaTrader 5 instead of new features ?


I am afraid this post is completely useless.

Why ? Because even if you are right (which is perfectly possible), you make several assumptions without giving any clues how to reproduce them. How can we know the problem is not in your code ?

Don't get me wrong, I agree with your request to more stability and reliability, but if we want to be heard we need more scientific approach. Please provide test case to reproduce the problem(s).

By the way Build 1958 is a beta, you should not use it if you don't want to be a beta tester. Just in case you don't know.

 

This problem with MT5 in not new.  It was like this from the first version in 2010.  And the fact that MetaQuotes did not fix these problems for so many years means that there is some major flaw in the architecture of the platform.

My guess is that they can't fix the problems! Probably they don't even know what causes these problems.

It will be easier to rebuild the whole platform block by block.

Currently MT5 is slower than MT4  in almost every aspect and it consumes more resources.

I also notice that the trade execution in real time takes on average 2.5 times longer on MT5 using the same broker.

Only the tester is better because it allows you to trade portfolios with multiple symbols using real tick data.

 
Tsvetan Tsvetanov:

This problem with MT5 in not new.  It was like this from the first version in 2010.  And the fact that MetaQuotes did not fix these problems for so many years means that there is some major flaw in the architecture of the platform.

My guess is that they can't fix the problems! Probably they don't even know what causes these problems.

It will be easier to rebuild the whole platform block by block.

Currently MT5 is slower than MT4  in almost every aspect and it consumes more resources.

I also notice that the trade execution in real time takes on average 2.5 times longer on MT5 using the same broker.

All wrong. Doesn't even deserve a detailed answer about such rantings. All important bugs have always been fixed and you obviously don't know what you are talking about when talking about speed. You should try to prove 1 of your claim.

Main problem of MT5 is the continuous development leading to instability, and their way to mix official release and beta versions.

 
Alain Verleyen:

I am afraid this post is completely useless.

Why ? Because even if you are right (which is perfectly possible), you make several assumptions without giving any clues how to reproduce them. How can we know the problem is not in your code ?

Don't get me wrong, I agree with your request to more stability and reliability, but if we want to be heard we need more scientific approach. Please provide test case to reproduce the problem(s).

By the way Build 1958 is a beta, you should not use it if you don't want to be a beta tester. Just in case you don't know.


You know that MQL4 language and MQL5 language is compatible.

I used the exactly same code  for both MeteTrader 4 and MetaTrader 5. Not even changed any single character in it.

In this experiment I used only static arrays. No single dynamic array was used for fair comparison.

So I applied the same number of arrays and calculation for this entire experiment between MT4 and MT5.

When you build small code, you might not notice. However, when you build medium to large code with many arrays, you will notice that there is big difference in MetaTrader 4 and MetaTrader 5.

MT5 does not clear up the memory thoroughly. Even after I closed the chart, the Memory is not reduced to the level before I open the chart meaning that the memory is not returned after use.

The point is that if I used dynamic arrays, MetaTrader 5 would performed even worse, I guess.

I wrote this to emphasise the stability is important in development stage because they seems not focusing on the stability.

 
Tsvetan Tsvetanov:

This problem with MT5 in not new.  It was like this from the first version in 2010.  And the fact that MetaQuotes did not fix these problems for so many years means that there is some major flaw in the architecture of the platform.

My guess is that they can't fix the problems! Probably they don't even know what causes these problems.

It will be easier to rebuild the whole platform block by block.

Currently MT5 is slower than MT4  in almost every aspect and it consumes more resources.

I also notice that the trade execution in real time takes on average 2.5 times longer on MT5 using the same broker.

Only the tester is better because it allows you to trade portfolios with multiple symbols using real tick data.

For dynamic array, there is maybe more chance of memory leak or memory corruption, etc.

When the static array does not work efficiently, what does this mean ?

This is something I can not really think of anything.

 
Young Ho Seo:


You know that MQL4 language and MQL5 language is compatible.

I used the exactly same code  for both MeteTrader 4 and MetaTrader 5. Not even changed any single character in it.

That could be a problem as compatible doesn't mean the same. There are a lot of difference between mql4 and mql5 even sometimes for the same function.

In this experiment I used only static arrays. No single dynamic array was used for fair comparison.

So I applied the same number of arrays and calculation for this entire experiment between MT4 and MT5.

When you build small code, you might not notice. However, when you build medium to large code with many arrays, you will notice that there is big difference in MetaTrader 4 and MetaTrader 5.

MT5 does not clear up the memory thoroughly. Even after I closed the chart, the Memory is not reduced to the level before I open the chart meaning that the memory is not returned after use.

The point is that if I used dynamic arrays, MetaTrader 5 would performed even worse, I guess.

I wrote this to emphasise the stability is important in development stage because they seems not focusing on the stability.

Sorry but you just repeat the same as previously without any concrete elements (source code to reproduce the issues). It will not help to improve things, it's a pity.

 
Alain Verleyen:
That could be a problem as compatible doesn't mean the same. There are a lot of difference between mql4 and mql5 even sometimes for the same function.

Sorry but you just repeat the same as previously without any concrete elements (source code to reproduce the issues). It will not help to improve things, it's a pity.

 This is how many developers feel when we work with MT5 in comparison to MT4. What I  pointed out is not new problem but the old problem as Tsvetan indicated.


 
Young Ho Seo:
 This is how many developers feel when we work with MT5 in comparison to MT4. What I  pointed out is not new problem but the old problem as Tsvetan indicated.


Post your darn code and performance comparisons to make it a case!  This is help!  Ranting to the sky will not help anyone.

I once used MT4 while ago, but I love MT5, I have a couple of EAs and running perfectly, maybe because I never ran a farm of bots or something like that...

Make your case solid... MT5's new approach is different from MT4, maybe in your tests, let's say that in the minute 15, you start seeing that MT5 starts its Memory Garbage Collection, who knows...

;)

 
Young Ho Seo:
 This is how many developers feel when we work with MT5 in comparison to MT4. What I  pointed out is not new problem but the old problem as Tsvetan indicated.


Old non-existent problems.

There is no problem with arrays on mql5/MT5 I ever noticed. I am working actively with mql5 since January, 2013.

There are enough real problems, prove your claims or stop complaining and whining.

 
Young Ho Seo:

I have built an indicator with MQL5 and MQL4 language compatible.

I put the same indicator from the same code on both MetaTrader 4 and MetaTrader 5 (Build 1958).

The results is surprisingly controversy showing MetaTrader 5 is unstable.

This screenshot explains how difficult we feel  when we work with MetaTrader 5 at the moment.

Static array memory management seems unstable. In addition, I might think there is some memory leak with dynamic array with MetaTrader 5 too.

This code was fine tuned to get rid of all the dynamic array because MetaTrader 5 keep increasing Memory with them.


The question is when can we expect to have the same stability with MetaTrader 5 as in MetaTrader 4?

Can you please focus more on stability side for your future work with MetaTrader 5 instead of new features ?


Got 3+ freezes & hard reboot with MT 1957 today, just received the 1958 and reading that there's still that overloaded cpu issue with ; so I can confirm you it's very specific to 1957-1958.

Reassuring to know that I'm not the only one in that case.

I gonna wait for few versions before finalizing my project, likely you'll have to wait also @Young Ho Seo :-D

Reason: