hello, new to mt4 programming, please lend a hand

 
i found this fractal script on the web, could someone point me to how i could modify this to sound an alert when the fractal is created? also is it possible to get the alert 5 seconds before the candle closes? (the first candle that starts the creation of the fractal)







//+------------------------------------------------------------------+
//|                                                  wlxFractals.mq4 |
//|         Copyright ? 2004, by konKop, GOODMAN, Mstera, af + wellx |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 2004, by wellx"
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- input parameters
extern int       Equals=5;
extern int       nLeftUp=2;
extern int       nRightUp=2;
extern int       nLeftDown=2;
extern int       nRightDown=2;
//---- buffers
double FractalsUp[];
double FractalsDown[];

int pos=0, cntup=0, cntdown=0, cnt=0;
int r=0,l=0,e=0;
int fup=0,fdown=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_ARROW,1,1);
   SetIndexArrow(0,234);
   SetIndexBuffer(0,FractalsUp);
   SetIndexEmptyValue(0,0.0);
   SetIndexStyle(1,DRAW_ARROW,1,1);
   SetIndexArrow(1,233);
   SetIndexBuffer(1,FractalsDown);
   SetIndexEmptyValue(1,0.0);
   
   cntup=nLeftUp+nRightUp+Equals+1;
   cntdown=nLeftDown+Equals+1;
   if (cntup>=cntdown) cnt=cntup;
   if (cntup<cntdown)  cnt=cntdown; 
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int i=0, j=0;
   int cbars=IndicatorCounted();
   if  (cbars<0) return(-1);
   if  (cbars>0) cbars--;
   
   pos=0;
    
   if (cbars > (Bars-cnt-1)) pos=(Bars-cnt-1);
   else pos=cbars+nRightUp;
      
   while (pos>=nRightUp)
    {
     FractalsUp[pos]  =NULL;
     FractalsDown[pos]=NULL;
     
     //??????? ?????
     r=nRightUp; //???a??&#729;?&#283; ???a&#243;? &#324;&#328;???&#237;&#243; ????&#328;???
     for (i=1;i<=r;i++)
     {
      if (High[pos]<=High[pos-i]) break;
     }
     
     //?&#324;?? &#324;???a? a&#324;? ?? &#328;? i ????&#237;? &#225;?&#328;&#252; ??a&#237;? r+1
     if (i==r+1) //FractalsUp[pos]=High[pos];
     {
      l=nLeftUp;  //???a??&#729;?&#283; ??a&#243;? &#324;&#328;???&#237;&#243; ????&#328;???
      e=Equals;
      for (j=1;j<=l+Equals;j++)
       {
      
        if (High[pos] < High[pos+j]) break;
        if (High[pos] >= High[pos+j]) l--;
        if (High[pos] == High[pos+j])e--;
        if (l==0) 
         {
           FractalsUp[pos]=High[pos]+ Point*2;
           break;
         }
        if (e<0) break;
       }
     }
     
     //??????? ?&#237;??
     r=nRightDown; //???a??&#729;?&#283; ???a&#243;? &#324;&#328;???&#237;&#243; ????&#328;???
     for (i=1;i<=r;i++)
     {
      if (Low[pos]>=Low[pos-i]) break;
     }  
   
     if (i==r+1) //FractalsUp[pos]=High[pos];
     {
      l=nLeftDown;  //???a??&#729;?&#283; ??a&#243;? &#324;&#328;???&#237;&#243; ????&#328;???
      e=Equals;
      for (j=1;j<=l+Equals;j++)
       {
      
        if (Low[pos] > Low[pos+j]) break;
        if (Low[pos] <= Low[pos+j]) l--;
        if (Low[pos] == Low[pos+j])e--;
        if (l==0) 
         {
           FractalsDown[pos]=Low[pos]-Point*2;
           break;
         }
        if (e<0) break;
       }
     }
    pos--;
    }
//----
   return(0);
  }
//+------------------------------------------------------------------+



any input would be extremely appreciated. thank you

 
[that post didn't quite work out for you did it?]

do a search here on "mql tutorial" and go visit mql4.com
 
which post? ?? ?

i did do searches before asking for help. the simple code for alert was found, but not the alert 5 seconds before. also, when i put the alert code in, it doesnt work properly, seems to sound randomly. i am hoping someone could help me with the code
thanks
Reason: