How to add notifications?

 
//+------------------------------------------------------------------+
//|                                                        i-GAP.mq4
//+------------------------------------------------------------------+
indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 LightBlue
#property indicator_color2 Salmon
//------- Âíåøíèå ïàðàìåòðû èíäèêàòîðà -------------------------------
extern int SizeGAP     =5;      // Ðàçìåð ÃÝÏà
extern int NumberOfBars=10000;  // Êîëè÷åñòâî áàðîâ îáñ÷¸òà (0-âñå)
//------- Ãëîáàëüíûå ïåðåìåííûå --------------------------------------
int ArrowInterval;
//------- Ïîêëþ÷åíèå âíåøíèõ ìîäóëåé ---------------------------------
//------- Áóôåðû èíäèêàòîðà ------------------------------------------
double SigBuy[];
double SigSell[];
bool SendNotification;//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void init()
  {
   SetIndexBuffer(0,SigBuy);
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,233);
   SetIndexEmptyValue(0,EMPTY_VALUE);
//
   SetIndexBuffer(1,SigSell);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,234);
   SetIndexEmptyValue(1,EMPTY_VALUE);
   ArrowInterval=GetArrowInterval();
   SendNotification(Symbol());
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
void start()
  {
   double ms[2];
   int    LoopBegin,sh;
//----
   int counted_bars=IndicatorCounted();
   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
   int limit=Bars-counted_bars;
   if(counted_bars==0) limit-=1+1;
//----
   for(sh=limit; sh>=0; sh--)
     {
      ms[0]=EMPTY_VALUE;
      ms[1]=EMPTY_VALUE;
      GetSignals(sh,ms);
      SigBuy[sh]=ms[0];
      SigSell[sh]=ms[1];
     }
  }
//+------------------------------------------------------------------+
//| Âîçâðàùàåò ñèãíàëû                                               |
//+------------------------------------------------------------------+
void GetSignals(int nb,double &ms[])
  {
   double Cl1=Close[nb+1];
   double Op0=Open [nb];
//----
   if(Cl1>Op0+SizeGAP*Point) ms[0]=Low[nb]-ArrowInterval*Point;
   if(Cl1<Op0-SizeGAP*Point) ms[1]=High[nb]+ArrowInterval*Point;
  }
//+------------------------------------------------------------------+
//| Âîçâðàùàåò èíòåðâàë óñòàíîâêè ñèãíàëüíûõ óêàçàòåëåé              |
//+------------------------------------------------------------------+
int GetArrowInterval()
  {
   int p=Period();
   switch(p)
     {
      case 1:     return(3);
      case 5:     return(5);
      case 15:    return(7);
      case 30:    return(10);
      case 60:    return(15);
      case 240:   return(20);
      case 1440:  return(50);
      case 10080: return(100);
      case 43200: return(200);
     }
  }
//+------------------------------------------------------------------+
 
Your topic has been moved to the section: MQL4 and MetaTrader 4
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 
Filip Ilich:

Insert:

SendNotification("some text content");

below:

      SigBuy[sh]=ms[0];

and then again below:

      SigSell[sh]=ms[1];
SendNotification - Common Functions - MQL4 Reference
SendNotification - Common Functions - MQL4 Reference
SendNotification - Common Functions - MQL4 Reference
  • docs.mql4.com
SendNotification - Common Functions - MQL4 Reference