MQL4 - automated forex trading   /  

Forum

Overload

Back to topics list To post a new topic, please log in or register

avatar
130
Brygada 2010.11.15 22:01 

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.

Mathematics in Trading: How to Estimate Trade Results

Mathematics in Trading: How to Estimate Trade Results

We all are aware of that "No profit obtained in the past will guarantee any success in future". However, it is still very actual to be able to estimate trading systems. This article deals with some simple and convenient methods that will help to estimate trade results.


avatar
876
7bit 2010.11.15 22:47 

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.
Back to topics list  

To add comments, please log in or register