Help for SendNotification() problem

 

Hello everyone

I designed an indicator , I put the same code for Alert and  for sending notification, there is no error for Alert, but SendNotification() doen't work at all. I am not sure if this function works in indicator generally!?

Can anyone help me ?

Thanks

if(SendNotify == true)
              {
               if(CheckNewBar(_Symbol,timeframe))// in the new bar
                 {
                  SendNotification("BUY ALERT "+(string)InpFastMAPeriod+" MA is above "+ (string)InpSlowMAPeriod+" MA");
                 }
              }
 
saeed Golshenas: I designed an indicator , I put the same code for Alert and  for sending notification, there is no error for Alert, but SendNotification() doen't work at all. I am not sure if this function works in indicator generally!? Can anyone help me ?

Have you enabled and configured push notification in MetaTrader's options?

 
saeed Golshenas: but SendNotification() doen't work at all.
               if(CheckNewBar(_Symbol,timeframe))// in the new bar

For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
          MT4: New candle - MQL4 programming forum #3 (2014)
          MT5: Accessing variables - MQL4 programming forum #3 (2022)

I disagree with making a new bar function, because it can only be called once per tick (second call returns false). A variable can be tested multiple times.
          Running EA once at the start of each bar - MQL4 programming forum (2011)

 
Fernando Carreiro #:

Have you enabled and configured push notification in MetaTrader's options?

Yes , I have
 
William Roeder #:

For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
          MT4: New candle - MQL4 programming forum #3 (2014)
          MT5: Accessing variables - MQL4 programming forum #3 (2022)

I disagree with making a new bar function, because it can only be called once per tick (second call returns false). A variable can be tested multiple times.
          Running EA once at the start of each bar - MQL4 programming forum (2011)

I want to notify only once in a new candle, so I have to create a function
Reason: