Taking a periodic screenshot in Mt4 (every 5 mins) - page 2

 

Hi thanks!!


I´m used 


void OnInit(){

  EventSetTimer(60);



}



void OnTimer()

  {

}  

But the file saved its:


This is the file saved


Its posible fail by id?

if i´m comment  //   ChartClose(chart_id);  i see that open the chart apply good template....All ok!!!! i dont understand!!!


Any help?


Thanks

 
Alejandro FG #: Its posible fail by id? i dont understand!!!
void OnTimer()
  {

    int result=0;

      long chart_id=ChartOpen(_Symbol,_Period);
      if(chart_id==0)

      ChartSetInteger(ChartID(),CHART_BRING_TO_TOP,true);
  1. Until you return from OnTimer, nothing will happen. Your sleeps are just delaying everything.
  2. Why are you opening a second chart? It takes time to open a second chart; you can't do those modifications until the chart actually exists.
 
William Roeder #:
  1. Until you return from OnTimer, nothing will happen. Your sleeps are just delaying everything.
  2. Why are you opening a second chart? It takes time to open a second chart; you can't do those modifications until the chart actually exists.



Hello again: Thank you very much for writing. 

About 1- Jejejej are you right :D.Depending on the template, it may take time to apply it, in this case it is not necessary, it can be eliminated.

About 2 -: The intention is to have this indicator so that it opens 3 charts and makes its capture, so in this way I have a single open chart with said indicator and every x time I send said screenshot with the selected template. I still don't understand why what I've programmed doesn't work, because it opens said graph, applies the template, but when launching the saved image it seems to hang


I try your code and think why not work me....


         ChartApplyTemplate(chart_id_1, Plantilla); //Template       
         ChartScreenShot(chart_id_1,"DE40PIVOTS.gif",1280,768,ALIGN_RIGHT);            
         ChartClose(chart_id_1);



For example its the most simple well it cant be save screenshot with template...i dont understand....


Thanks again for your help!

 

Well!!!


I found it!!!



void OnTimer()



Cant be save screenshot with templates if you open a new chart!!!


Now its work if i´m use chart OnChartEvent and make a sleep conversion(Minutes to milisec)


I make a EA and work perfect open 3 charts!!!save screenshot with my template and send to another rute local disk


THanks!!!!!