Phone notification for canlde size alerter

 
Hey guys, can anyone please help me just edit this simple MQ4 indicator to send notifications to my phone when the size of the candle exceeds the set value. I will really appreciate it in advance.
Files:
 
Ismail Lemin can anyone please help me just edit this simple MQ4 indicator to send notifications to my phone when the size of the candle exceeds the set value.
  1. Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
              No free help (2017)

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum (2018)

    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
              No free help (2017)

  2.    if (Bid>=Open[0]+Pips*point)Alerts("up ");
       if (Bid<=Open[0]-Pips*point)Alerts("down ");

    Replace the criterion with what you want.

 
William Roeder #:
  1. Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
              No free help (2017)

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum (2018)

    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
              No free help (2017)

  2. Replace the criterion with what you want.

Am really sorry if I stated it wrongly and it came out rudely. I need help with adding a code line for sending push notifications to phone. It already has alerts on the terminal. Again am sorry if I said it the wrong way. 
 
Ismail Lemin:
Hey guys, can anyone please help me just edit this simple MQ4 indicator to send notifications to my phone when the size of the candle exceeds the set value. I will really appreciate it in advance.

It is quite simple to do.

You know how to do a pop up alert already

   string message="Signal";
   Alert(message);

For a push notification

   string message="Signal";
   SendNotification(message);
 
Keith Watford #:

It is quite simple to do.

You know how to do a pop up alert already

For a push notification

Thanks a lot Keith let me edit and compile the file. I appreciate your help. 
 
William Roeder #:
  1. Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
              No free help (2017)

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum (2018)

    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
              No free help (2017)

  2. Replace the criterion with what you want.

hello there am sorry to bother you again, but I did try to edit the script of the indicator and added some lines for notifications and got an error while debugging. Please help me with the correct line for the mq4 file.




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

//|                                          Candle Pips Alerter.mq4 |

//|                          Copyright © 2011, Forex-Programming.com |

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

#property copyright "Copyright © 2011, Forex-Programming.com"


#property indicator_chart_window


extern int Pips = 50;

extern bool Alerts = true;

extern bool PushNotification = true;


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 ");

   if (Bid>=Open[0]+Pips*point)PushNotification("up ");

   if (Bid<=Open[0]-Pips*point)PushNotification("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()

 {

  

  return;

 }

 
Keith Watford #:

It is quite simple to do.

You know how to do a pop up alert already

For a push notification

Hello Keith, I tried to edit the script but got errors while debugging it. Above is the whole edited lines not sure where I did wrong. Please help find the error.

 
Ismail Lemin #:


Please edit your post and use the code button (Alt+S) when pasting code.

EDIT your original post, please do not just post the code correctly in a new post.

 
Ismail Lemin #: and got an error while debugging.

"Got an error" is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless.
     How To Ask Questions The Smart Way. (2004)
          When asking about code
          Be precise and informative about your problem

Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the source file.

 
William Roeder #:

"Got an error" is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless.
     How To Ask Questions The Smart Way. (2004)
          When asking about code

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("www.forex-programming.com");

 

  return;

}


          Be precise and informative about your problem

Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the source file.

Yes  there were 3 errors which showed when debugging the codes. I had tried to add notification as an external boolean. 

 
Ismail Lemin #: Yes  there were 3 errors which showed when debugging the codes. I had tried to add notification as an external boolean. 
  1. What part of "EDIT your original post, please do not just post the code correctly in a new post " was unclear to you? You did the exact opposite.

  2. string TFName( int tf ){
    ⋮
                  } // switch
      return;        Function returns a string. What string are you returning here?
    } // TFName