Download MetaTrader 5

How to wait for all bars to be loaded before taking a screenshot? - page 2

To add comments, please log in or register
mar 2015.02.05 16:15  

Ok, now I had exactly this endless-loop-problem. I changed to a profile with all charts using the screenshot-indicator and the MT4 crashed.

But I still haven't found a solution. So I am still happy if someone has an idea.. 

Carl Schreiber
Carl Schreiber 2015.02.05 18:47  

I haven't tried it but Windows' kernel32.dll seems to have Sleep().

MAY BE (!) if you want to use this Windows function try:

#import "kernel32.dll"
   void Sleep(int mSec);


I haven't tested it and most probably the whole terminal falls asleep for that period!

But I think only the particular chart will absent.

MAY BE if you now want to use mt4's Sleep() you have to you write ::Sleep() - but I am not sure!!

Would you mind to check it out and post your results?

mar 2015.02.06 09:38  

I have tried both ideas but none of them works. There are always 2 seconds between the first and second screenshot and even if I wait for 3 seconds, I get always the same result. So obviously there is no possibility to wait for all data to be loaded before the indicator continues. I also tried Refeshrates() but that also didn't work.

Nevertheless thank you for your ideas! 

To add comments, please log in or register