How to make MT4 auto refresh - page 7

 

I already solved it with the following code:

bool NewBar()

{

   static datetime previous_time=0;

   datetime current_time = iTime(Symbol(),PERIOD_H1,0);

   if(previous_time!= current_time)

   {

      previous_time = current_time;

      return true;

   }

   return false;

}

//+------------------------------------------------------------------+

//| indicator initialization function

//+------------------------------------------------------------------+

int init()

{

  hWindow = WindowHandle( Symbol(), Period() ); //Period()

  NewBar();

  

//  oldBars = Bars; // we need that for 



return (0);

}

//+------------------------------------------------------------------+

//| indicator start function

//+------------------------------------------------------------------+

int start()

{

  if (NewBar())
 
smika #: I already solved it with the following code:

Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
          General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
          Messages Editor

Reason: