The Sleep function in the EA is a big evil. If you use this function, it means your code contains an error.
I'm doing this EA translation from code that I did not develop. The original developer gave me the source code and permission to migrate it to MQL5.
I'm not quite sure what you mean by "your code contains an error" because I have all the source code converted to MQL5 and it compiles and runs fine both with and without using the Sleep() Function.
I don't know the reason the original developer used the Sleep() Function. It appeared to me to be waiting 2 seconds for connection to the data server.
By saying it's a "big evil" are you advising to eliminate it from the source code?
I'm doing this EA translation from code that I did not develop. The original developer gave me the source code and permission to migrate it to MQL5.
I'm not quite sure what you mean by "your code contains an error" because I have all the source code converted to MQL5 and it compiles and runs fine both with and without using the Sleep() Function.
I don't know the reason the original developer used the Sleep() Function. It appeared to me to be waiting 2 seconds for connection to the data server.
By saying it's a "big evil" are you advising to eliminate it from the source code?
i found an article about sleep() function here which could be useful to you

- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
The Procedures that are called immediately before calling the Sleep() Functions are used to write data into .csv files.
Thank you for any suggestions!