Overload

 

I did a script that has a loop

while(true)

Sleep(10) ;

Is it possible that it overloads e.g. MT4 cache or so that

adversely affects the program. If so, is there a

solution?

Thanks.

 

no, as long as there is a Sleep() in your loop nothing bad will happen. You just have to make sure you do not do this in an indicator, it will freeze MT4, this is only allowed in scripts and EAs and only in the start() function, NOT in init().

Also you should change it to:


while (!IsStopped()){
   ...
   ...
   Sleep(10);
}
Because this will exit the loop cleanly and immediately when you try to remove the script or EA without needing to force a timeout.
Reason: