Hi there,
New to MQL5, have coded using MQL4 in the past.
I'm trying to create an EA that detects a specific pattern based off high's and lows. And then draw lines on the chart to visualize these patterns. The code goes through lots of iterations to calculate the end result, and when it gets there the result is correct. However, the speed is extremely slow.
I am aware that I am forcing it to do thousands of calculations, but I noticed that the EA seems to "pause" randomly. This is noticeable when watching the "comment" in the top left. It runs for a while processing the calcs quicky, and then pauses for about 20-30 seconds. And then continues.
I am trying to understand why this happens? Does MT5 "throttle" the EA if too many calculations are requested? Or what else could be causing this? Appreciate the help! Code pasted here:
Create / modify objects outside the loop.
Create / modify objects outside the loop.
Thank you! 100x Better.
Thank you! 100x Better.
If you need to optimize your code further use the code profiler (Debug -> Start Profiling...).
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi there,
New to MQL5, have coded using MQL4 in the past.
I'm trying to create an EA that detects a specific pattern based off high's and lows. And then draw lines on the chart to visualize these patterns. The code goes through lots of iterations to calculate the end result, and when it gets there the result is correct. However, the speed is extremely slow.
I am aware that I am forcing it to do thousands of calculations, but I noticed that the EA seems to "pause" randomly. This is noticeable when watching the "comment" in the top left. It runs for a while processing the calcs quicky, and then pauses for about 20-30 seconds. And then continues.
I am trying to understand why this happens? Does MT5 "throttle" the EA if too many calculations are requested? Or what else could be causing this? Appreciate the help! Code pasted here: