Download MetaTrader 5

Alert delay 10 seconds

To add comments, please log in or register
fly7680
599
fly7680  
My custom indicator has an audible and visual alert that works properly but time in the pop-up is delayed by 10 seconds.

How is it possible?

datetime time_alert; //used when sending alert
double   myPoint;    //initialized in OnInit

void myAlert(string type, string message)
  {
   if(type == "print")
      Print(message);
   else if(type == "error")
     {
      Print(type+" | Myindicator @ "+Symbol()+","+Period()+" | "+message);
     }
   else if(type == "order")
     {
     }
   else if(type == "modify")
     {
     }
   else if(type == "indicator")
     {
      if(Audible_Alerts) Alert(type+" | Myindicator @ "+Symbol()+","+Period()+" | "+message);
     }
  }

// this code, in the buffer for Audible_Alerts

        {
         Buffer3[i] = High[i] + 1 * myPoint;
         if(i == 0 && Time[0] != time_alert) { myAlert("indicator", "Sell"); time_alert = Time[0]; } //Instant alert, only once per bar
        }
To add comments, please log in or register