MT5 slower than MT4?

 

Hello everybody,

I have an Expert Advisor that is written in MQL4 and MQL5.
Metatrader 5 needs more CPU-Power than Metatrader 4, same EA. (More = way way way more power)

I thought Metatrader 5 is much better than Metatrader 4?

I do not know what I am doing wrong.


Has someone an idea what are the reasons are?


Changes in code are:
- CTrade & its functions (Buy and Sell)
- run over Positions instead of only "Orders"
- "ENUM_TIMEFRAMES" instead of "int"

My thoughts:

I think the code is not the problem. I guess the problem is the history data.
My EA uses the whole history-data. And I think at Metatrader 4 the history data is limited - and in Metatrader 5 it runs over every M1-Candle, could this be possible?


Thanks.


EDIT:

I changed the timeframe calculation and now it is faster. So, if someone has the same problem, now you know how to fix it: Change your historical data calculation

Trade Operations in MQL5 - It's Easy
Trade Operations in MQL5 - It's Easy
  • www.mql5.com
Almost all traders come to market to make money but some traders also enjoy the process itself. However, it is not only manual trading that can provide you with an exciting experience. Automated trading systems development can also be quite absorbing. Creating a trading robot can be as interesting as reading a good mystery novel.
 

EDIT:

I changed the timeframe calculation and now it is faster. So, if someone has the same problem, now you know how to fix it: Change your historical data calculation

if you want to help others say what you've actually done to solve it..

 
Christoph Karl Peter Engelhardt: I changed the timeframe calculation and now it is faster. So, if someone has the same problem, now you know how to fix it: Change your historical data calculation

Don't do that. Someone searching might find this thread and still be clueless. What was the problem? What solved what?

How To Ask Questions The Smart Way. (2004)
     When You Ask.
          Follow up with a brief note on the solution.

 

HI,

I am finding MT5 slower than MT4 regarding trailing stops. MT4 was instant updates, but MT5 updates the trailing stop once every 8-10 seconds  according to spec. I can see a trade run big into profit then go back down again before the stop has even activated. also it just seems more clunky than MT4, any tips on how to speed up MT5 or use a scripted one ?

thanks

 
brokentoy #:

HI,

I am finding MT5 slower than MT4 regarding trailing stops. MT4 was instant updates, but MT5 updates the trailing stop once every 8-10 seconds  according to spec. I can see a trade run big into profit then go back down again before the stop has even activated. also it just seems more clunky than MT4, any tips on how to speed up MT5 or use a scripted one ?

thanks

I’ve never had that issue, even though many of my bots are scalping using very quick trailing stops.
This might be related to your code, feel free to share it if you want us to have a look.
It might also be related to latency from your broker / internet connection. 
 

I think at Metatrader 4 the history data is limited - and in Metatrader 5 it runs over every M1-Candle, could this be possible?

It depends on simulation mode you choose.

Reason: