Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
The Sleep() function has no effect in Indicators.
The Sleep() function can't be called for custom indicators, because indicators are executed in the interface thread and must not slow down it. The function has the built-in check of EA halt flag every 0.1 seconds.

- www.mql5.com
Hello guys,
I am testing in custom indicator to get screenshots of all currency pairs and all time frames in a chart open. I used CharOpen() function. But some price charts take too long time to load prices and bar data. I only got the "Loading" message in screenshot. I use Sleep(5000); to wait for a moment. But it is not enough especially when Metatrader 5 app is just started. So, I'm wondering to hold till the chart is properly set up. Sorry for my English. Thank you.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello guys,
I am testing in custom indicator to get screenshots of all currency pairs and all time frames in a chart open. I used CharOpen() function. But some price charts take too long time to load prices and bar data. I only got the "Loading" message in screenshot. I use Sleep(5000); to wait for a moment. But it is not enough especially when Metatrader 5 app is just started. So, I'm wondering to hold till the chart is properly set up. Sorry for my English. Thank you.