Of course it does. You access a symbol, which isn't current, the terminal starts to download data for it. And you do this 600 times.
On MT5: Unless the chart is that specific pair/TF, you must Synchronize the terminal Data from the Server.
Timeseries and Indicators Access / Data Access -
Reference on algorithmic/automated trading language for MetaTrader 5
Hi whroeder1,
Thanks for your response!
I've looked at the link you attached, I'm not bad at MQL4 but MQL5 is new to me...
Why then does the equivalent function call in MQL4............... iBars(symbol,timeFrame) , not cause the same problem ?
Does MQL4 iBars not request that information from the server and instead pulls it from the terminal ?
This still doesn't explain why all CPU cores go to 100%... with affinity set to 1 core and that core limited to 25% of Max the EA still runs well...
Thanks Again!
Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum
It's just less evident because MT4 only downloads that TF whereas MT5 downloads M1 data and generates all others.
Mate, your a legend!
I'll change my approach and only call these functions once per trading session...
I'll store their results in variable arrays thus not needing to re-call the data every time the timer executes.
The CPU will crank for 3 minutes while it generates the data and fills the arrays but after that the EA will only need to monitor the BID and ASK for the rest of the trading session / per day.
Thanks Sincerely for your help!
Cheers
I'll change my approach and only call these functions once per trading session...
I'll store their results in variable arrays thus not needing to re-call the data every time the timer executes.

- 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 all,
I have written and currently run a mulit-symbol EA in MT4 which monitors and trades a portfolio of appox 300 stock-CFD’s.
I have effectively re-written it for MT5 because the broker I now prefer, uses MT5 instead.
The code uses a timer initiated For Loop which cycles through the symbols, tests conditions and skips ones that don’t meet requirements using the continue; statement.
.......................................................................
Symbols[] = { “AAPL”,”GOOGLE”,………., + 600 symbols }
For ( i = 1 : i < arraysize(Symbols): i++ )
{
If (number of bars < 300)
continue;
}
.....................................................................
Now this is a simplification of what’s going on but here’s the thing!
Running this basic For-Loop which executes on the MT5 platform in less than a second, sends all the cores on my i7 8700k CPU into 100% usage for up to 3 minutes after the loop is completed.
I can set the CPU affinity to one core and the loop still completes in a second or two… but that core is running at 100% afterwards for what looks like no reason at all…
This exact For-Loop and system when running on MT4 still completes in the same time but doesn’t have this effect on my CPU.
Can someone explain what is happening and / or what I am doing wrong….?
The above code is only a snippet of the whole EA, I placed a time capture around the For Loop which shows that the for loop is completed without error with a second or two.
I have isolated this particular call ... Bars( symbol, timeFrame ) ... as one of the culprits for my HIGH CPU usage (simply using a process of elimination) ...
Since the fully coded EA is otherwise running flawlessly... my current solution is to set CPU affinity to ONE CORE and then use a 3rd party program ( BES ) to physically restrict MT5 from using more than 25% of that core...
I'd truly appreciate any advice...
Cheers