Download MetaTrader 5
To add comments, please log in or register
Launch agents on an idle PC. It is profitable!
Ramon Sobrevals Arce
Ramon Sobrevals Arce 2015.05.06 11:29 
Is there any easy automatic way to can stop the calculating process in one indicator?

Supose we attach one indicator in one chart with many bars. If the indicator needs 10-20 seconds to be loaded and perfectly calculated, Metatrader will look frozen during this 10-20 seconds.
I have already found many indicators with this kind of problems, Indicators which are calculating many things or maybe not perfectly optimizated and the calculating process takes a while before it's executed. 

I wonder if there is any way to can add micro-stops of the process (kinda like the function Sleep) so the indicator can rest, not freeze Metatrader, and even start to show few indicator results without need to be completed.
For example, if we would apply that in one simple average and we do zoom out, when we attach the indicator, we would see slowly the moving average being created from the starting Bar until the End.

I guess something already functional like that could be done with internal functions which just run little parts of the indicator each X miliseconds. For example:
One long bucle like that::
we could do instead:
//that is not functional, but you will have one idea of what I mean.
if(Second()!=LastSec) {
for(i=k;i<k+100;i++) blabla;
else return;
That, for example, would already work kinda like I'm telling, but with some logical limitations I'll not explain now.

Someone has any idea or knows anything (like a MQL function) I don't know?
To add comments, please log in or register