include pushnotifications in this indicator

 

where the best place to include this code below?

i want to get phone notifications with the quantity of divergences, or names of the divergences (indicator attached

 

                          int timeframeInSeconds = Period();
                  string timeframe;
                  
                  switch (timeframeInSeconds)
                  {
                      case PERIOD_M15:
                          timeframe = "M15";
                          break;
                      case PERIOD_H1:
                          timeframe = "H1";
                          break;
                      case PERIOD_H4:
                          timeframe = "H4";
                          break;
                      case PERIOD_D1:
                          timeframe = "D1";
                          break;                         
                      // Add more cases for other timeframes as needed
                          
                      default:
                          timeframe = "Unknown";
                          break;
                  }
                  
                  SendNotification("DIV: " + Symbol() + "-" + timeframe );
Documentation on MQL5: Network Functions / SendNotification
Documentation on MQL5: Network Functions / SendNotification
  • www.mql5.com
SendNotification - Network Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
This website uses cookies. Learn more about our Cookies Policy.