Calling Sleep() in OnCalculate(...) function

 

Good day,


What happens when I call the Sleep function in the OnCalculate method in my Indicator?


The reason I'm asking is due to an issue I'm picking up in multiple Symbol trading m(on a single PC) with my EA which seems to make erroneous trades (luckily not too often) that are not according to its prescribed rules, but when I run the EA with the same input variables in the back tester, it works fine.

I have a feeling this has to do with the lack of threading/multi-core capability of MT5 causing some glitch, and want to test my assumption with a "Sleep(ChartID()%10000)" [to randomize the processing time between charts] in the OnCalculate() function.

So, when Sleep is called, does it 'pause' the execution of the next OnCalculate on price change, or does OnCalculate override the Sleep to perform the next iteration on price change?


Thank you   

 
Arieman:

What happens when I call the Sleep function in the OnCalculate method in my Indicator?

Nothing! The Sleep function is ignored in indicators.

 
Indicators can not stop — no sleep, no trading.
Reason: