where i can add alert line in this code ?

 

 i need to add alert when the signal appear 

this is the code

 

 //+------------------------------------------------------------------+
//| lukas1 arrows & curves.mq4 v.14 |
//| Èçìåíåíèÿ: | 
//| 1. Óáðàíû íåíóæíûå (ëèøíèå) êîýôôèöèåíû, íå ó÷àñòâóþùèå |
//| â ðàñ÷åòàõ Kmin, Kmax, RISK |
//| 2. Ìàòåìàòèêà èíäèêàòîðà âñå ðàñ÷åòû âûïîëíÿåò |
//| âíóòðè îäíîãî öèêëà, ýòî óâåëè÷èëî ñêîðîñòü îáñ÷¸òà. |
//| 3. Âûêëþ÷åíî ìåðöàíèå ñòðåëîê. |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, lukas1"
#property link "http://www.alpari-idc.ru/"
//----
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Green
#property indicator_color4 Green
//---- input parameters
extern int SSP = 6; //ïåðèîä ëèíåéíîãî ðàçâîðîòà èíäèêàòîðà
extern int CountBars = 2250; //ðàñ÷åòíûé ïåðèîä 
extern int SkyCh = 13; //÷óâñòâèòåëüíîñòü ê ïðîáîþ êàíàëà 
//Äîëæíà áûòü â äèàïàçîíå 0-50. 0 - íåò ñòðåëîê. Áîëüøå 50 - ïåðåðåãóëèðîâàíèå
int i;
double high, low, smin, smax;
double val1[]; // áóôåð äëÿ áàé
double val2[]; // áóôåð äëÿ ñåëë
double Sky_BufferH[];
double Sky_BufferL[];
bool uptrend, old;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
 {
 SetIndexStyle(0, DRAW_ARROW);
 SetIndexArrow(0, 233); // ñòðåëêà äëÿ áàé
 SetIndexBuffer(0, val1); // èíäåêñ áóôåðà äëÿ áàé
 SetIndexDrawBegin(0, 2*SSP);
 //
 SetIndexStyle(1, DRAW_ARROW);
 SetIndexArrow(1, 234); // ñòðåëêà äëÿ ñåëë
 SetIndexBuffer(1, val2); // èíäåêñ áóôåðà äëÿ ñåëë
 SetIndexDrawBegin(1, 2*SSP);
 //
 SetIndexStyle(2, DRAW_LINE);
 SetIndexBuffer(2, Sky_BufferH);
 SetIndexLabel(2, "High");
 SetIndexDrawBegin(2, 2*SSP);
 //
 SetIndexStyle(3, DRAW_LINE);
 SetIndexBuffer(3, Sky_BufferL);
 SetIndexLabel(3, "Low");
 SetIndexDrawBegin(3, 2*SSP);
//----
 return(0);
 }
//+------------------------------------------------------------------+
//| Calculation of SilverTrend lines | 
//+------------------------------------------------------------------+
int start()
 { 
 int counted_bars = IndicatorCounted();
//---- ïîñëåäíèé ïîñ÷èòàííûé áàð áóäåò ïåðåñ÷èòàí
 if(counted_bars > 0) counted_bars--;
//----
 if(Bars <= SSP + 1) return(0);
//---- initial zero
 uptrend =false;
 old =false;
 GlobalVariableSet("goSELL", 0); // çàäàëè ñóùåñòâîâàíèå è îáíóëèëè goSELL=0
 GlobalVariableSet("goBUY", 0); // çàäàëè ñóùåñòâîâàíèå è îáíóëèëè goBUY =0
//----
 for(i = CountBars - SSP; i >= 0; i--) // óìåíüø çíà÷åíèå shift íà 1 çà ïðîõîä;
 { 
 high = High[iHighest(Symbol(),0,MODE_HIGH,SSP,i)]; 
 low = Low[iLowest(Symbol(),0,MODE_LOW,SSP,i)]; 
 smax = high - (high - low)*SkyCh / 100; // smax íèæå high ñ ó÷åòîì êîýôô.SkyCh
 smin = low + (high - low)*SkyCh / 100; // smin âûøå low ñ ó÷åòîì êîýôô.SkyCh
 val1[i] = 0; 
 val2[i] = 0;
 if(Close[i] < smin && i!=0 ) // âûêëþ÷åíî ìåðöàíèå ñòðåëîê (i!=0)
 {
 uptrend = false;
 }
 if(Close[i] > smax && i!=0 ) // âûêëþ÷åíî ìåðöàíèå ñòðåëîê (i!=0) 
 {
 uptrend = true; 
 } 
 if(uptrend != old && uptrend == false)
 {
 val2[i] = high; // åñëè óñëîâèÿ âûïîëíåíû òî ðèñóåì val1
 if(i == 0) GlobalVariableSet("goBUY",1);
 }
 if(uptrend != old && uptrend == true ) 
 {
 val1[i] = low; // åñëè óñëîâèÿ âûïîëíåíû òî ðèñóåì val2
 if(i == 0) GlobalVariableSet("goSELL",1);
 }
 old=uptrend;
 Sky_BufferH[i]=high - (high - low)*SkyCh / 100;
 Sky_BufferL[i]=low + (high - low)*SkyCh / 100;
 }
 return(0);
 }
//+------------------------------------------------------------------+


 
 
akram801:
i need to add alert when the signal appear
static datetime LastAlert;
if(i == 0){ GlobalVariableSet("goBUY",1);
   if (LastAlert != Time[0]){ LastAlert = Time[0]; Alert("BUY now"); }
}
 

thanks WHRoeder

based on the code is the signals of this indicator appear at the beginning or after the candle close ?

and is it a fixed signals ?? 

 
Alert appears the first time the signal occurs on the current bar (possibly mid candle) not first tick.
 

sorry WHRoeder ...

i add the lines But the on live the alert doesn't appear

can you modify the the code the get the correct alert indicator and share it here 

Reason: