Need help with this push notification code. 'Send Notification'- wrong perimeter count

 
#property copyright ""
#property link      ""

#property indicator_chart_window

extern int Pips = 50;
extern bool Alerts = true;
extern bool PushNotification = false;

double point;

datetime alerttime;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   if (Digits==1)point=0.1;
   if (Digits==2)point=0.01;
   if (Digits==3)point=0.01;
   if (Digits==4)point=0.0001;
   if (Digits==5)point=0.0001;
  
   Comments();
   
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   Comment("");
   
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   if (Bars<100)return;
  
   if (Bid>=Open[0]+Pips*point)Alerts("up ");
   if (Bid<=Open[0]-Pips*point)Alerts("down ");
   
   return(0);
  }
//+------------------------------------------------------------------+

void Alerts(string dir)
 {
  if (alerttime>=Time[0])return;
 
  if (Alerts)
   {
    Alert("Price has moved " + dir + Pips + " pips on the " + Symbol() + TFName(Period()));
   }
  if (PushNotification)
  {
   SendNotification("Candle Pips Alerter", "Price has moved " + dir + Pips + " pips on the " + Symbol() + TFName(Period()));
  }
   
  alerttime=Time[0];
  
  return;
 }

string TFName( int tf )
 {
  switch(tf) 
   {
      case PERIOD_M1: return(" M1"); break;
case PERIOD_M5: return(" M5"); break;
case PERIOD_M15: return(" M15"); break;
case PERIOD_M30: return(" M30"); break;
case PERIOD_H1: return(" H1"); break;
case PERIOD_H4: return(" H4"); break;
case PERIOD_D1: return(" Daily"); break;
case PERIOD_W1: return(" Weekly"); break;
default: return(" Monthly");
}
  return;
}


void Comments()
 {
  Comment("");
  
  return;
 }
 
Darin De Neng:
#property copyright ""
#property link      ""

#property indicator_chart_window

extern int Pips = 50;
extern bool Alerts = true;
extern bool PushNotification = false;

double point;

datetime alerttime;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   if (Digits==1)point=0.1;
   if (Digits==2)point=0.01;
   if (Digits==3)point=0.01;
   if (Digits==4)point=0.0001;
   if (Digits==5)point=0.0001;
  
   Comments();
   
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   Comment("");
   
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   if (Bars<100)return;
  
   if (Bid>=Open[0]+Pips*point)Alerts("up ");
   if (Bid<=Open[0]-Pips*point)Alerts("down ");
   
   return(0);
  }
//+------------------------------------------------------------------+

void Alerts(string dir)
 {
  if (alerttime>=Time[0])return;
 
  if (Alerts)
   {
    Alert("Price has moved " + dir + Pips + " pips on the " + Symbol() + TFName(Period()));
   }
  if (PushNotification)
  {
   SendNotification("Candle Pips Alerter", "Price has moved " + dir + Pips + " pips on the " + Symbol() + TFName(Period()));
  }
   
  alerttime=Time[0];
  
  return;
 }

string TFName( int tf )
 {
  switch(tf) 
   {
      case PERIOD_M1: return(" M1"); break;
case PERIOD_M5: return(" M5"); break;
case PERIOD_M15: return(" M15"); break;
case PERIOD_M30: return(" M30"); break;
case PERIOD_H1: return(" H1"); break;
case PERIOD_H4: return(" H4"); break;
case PERIOD_D1: return(" Daily"); break;
case PERIOD_W1: return(" Weekly"); break;
default: return(" Monthly");
}
  return;
}


void Comments()
 {
  Comment("");
  
  return;
 }

Change this :

  SendNotification("Candle Pips Alerter", "Price has moved " + dir + Pips + " pips on the " + Symbol() + TFName(Period()));

to this :

  SendNotification("Candle Pips Alerter price has moved " + dir + Pips + " pips on the " + Symbol() + TFName(Period()));
 
Mladen Rakic:

Change this :

to this :


Awesome, thank!

 
Mladen Rakic:

Change this :

to this :

 
When you post code please use the SRC button! Please edit your post.
          General rules and best pratices of the Forum. - General - MQL5 programming forum
Reason: