Problem with the delay of ChartSetSymbolPeriod()

Back to topics list To post a new topic, please log in or register
avatar
371
mar 2016.03.20 19:44
 

Hi coders,

the H1 chart is open. Now I would like to have screenshots from H1, M15 and H4. I do it this way:

ChartScreenShot(0, _Symbol+(string)_Period+".png", 1280, 720);
ChartSetSymbolPeriod(0, NULL, PERIOD_H4);
ChartScreenShot(0, _Symbol+(string)_Period+".png", 1280, 720);
ChartSetSymbolPeriod(0, NULL, PERIOD_M15);
ChartScreenShot(0, _Symbol+(string)_Period+".png", 1280, 720);

As you surely know, that doesn't work because ChartSetSymbolPeriod() works asynchronous and doesn't wait for the timeframe to be changed before continuing with the code. So the result is only one screenshot of the current timeframe.

Can someone help me to solve this problem in any other way?

Thanks in advance! 

avatar
12985
WHRoeder 2016.03.20 20:59 #
 
Change the period and return. After the terminal switches, then take the next screenshot.
avatar
371
mar 2016.03.20 22:58 #
 

Ok, then I can't do a script with this. If I need to return it then it can only be done with an indicator or EA.

Thanks mate! 

Back to topics list  

To add comments, please log in or register