Multi-symbols EA eating up all processor use | Processor leak

To add comments, please log in or register
__Matt__
7
__Matt__  

Hello,

I have an EA that is set to check on a hundred of symbols but the problem is that it seems the more symbols I set the EA to work on, the more the processor is being eaten up. To the point that the processor has barely any % left in the task manager and it frozes the computer if I put it to work on more than 150 symbols or even less sometimes. I don't understand what's causing the processor leak.

My EA works this way:

for(int symbol = 0; symbol < 150&&!IsStopped(); symbol++)
{string Pair=SymbolName(symbol,true);
 Stuff checking bars value etc}

Or working from a symbol list:

//Putting all symbols in an array to work with
int handle = FileOpen("Symbol_list.txt",FILE_READ|FILE_CSV|FILE_ANSI);
string array[150];int incr=0;
while(!FileIsEnding(handle)&&!IsStopped())
{array[incr] = FileReadString(handle);incr++;}FileClose(handle);

for(int line = 0; line < ArraySize(array)&&!IsStopped(); line++)
{string Pair = array[line];SymbolSelect(Pair,true);
 Stuff checking bars values etc}

This being in an OnTimer event which trigger every 5 secondes.

I have tried to figure out what's the problem in every way you could think of .. I have a script that add 1 day history before each symbol calculation stuff but it isn't the problem as if I remove it it end up the same. I have also tried changing the 'Max bars in chart' parameter.

I think it's a matter of the HCC files and HC files in cache because if I remove the EA the processus use of the MT5 instance doesn't reduce at all and have to start it back to get it back at 5-6% of processor use.

Though it's not about memory ram as it states in the documentation, it's the processor usage being eating up ..

Any ideas what's causing this processor leak? ......

Also, is it possible to manually remove a symbol history currently in cache so I might figure out if that's the problem.

To add comments, please log in or register