Deleting Arrow

 
Hi all,

This is a small code to identify in a specific way Gap formation (as per my definition :) )
I've tried to delete the arrows after the identified GAP is closed. -The GAP is considered closed if any candle (high/low) reaches the gap-
after introducing else if dn[i+0] = 0 & up[i+0] = 0, the logic is messed up !

appreciate if you could guide on way forward to delete the arrow if GAP is closed & leave the other arrows until price closes them.
cheers



//+------------------------------------------------------------------+
#property copyright "Them"
#property link      "Them"
//---- indicator settings
#property  indicator_chart_window
#property indicator_buffers 2
 
#property indicator_color1  Red
#property indicator_color2  Green
 
#property indicator_width1  1
#property indicator_width2  1
 
//---- indicator buffers
 
double up[];
double dn[];
 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {  
   SetIndexBuffer(0,up);
   SetIndexBuffer(1,dn);
 
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexStyle(1,DRAW_ARROW);
 
   SetIndexArrow(0,233);
   SetIndexArrow(1,234);
   return(0);
  }
///////////////////////
  int deinit()
  {
   return(0);
  }
///////////////////////
int start()
  {
  int    i; //,Limit,Count_B=IndicatorCounted();
  // Limit=Bars-Count_B;
   for(i=70; i>=0; i--) // 70 = Limit
     {
           if(Close[i+0]>Close[i+1] && Open[i+0]>Close[i+1] && Open[i+0]>Open[i+1] )  
               {
                up[i+0]=High[i+0]-100*Point;
               } 
           if(Close[i+0]<Close[i+1] && Close[i+1]>Open[i+0]&& Open[i+0]<Open[i+1] )
              {             
                dn[i+0]=Low[i+0]+100*Point;
              }
     }        
   return(0);
  }
//+------------------------------------------------------------------+
 

try

   for(i=70; i>=0; i--) // 70 = Limit
   {
      if(Close[i+0]>Close[i+1] && Open[i+0]>Close[i+1] && Open[i+0]>Open[i+1] )  
      {
         up[i+0]=High[i+0]-100*Point;
      } 
      else if(Close[i+0]<Close[i+1] && Close[i+1]>Open[i+0]&& Open[i+0]<Open[i+1] )
      {             
         dn[i+0]=Low[i+0]+100*Point;
      }
      else dn[i+0]= EMPTY_VALUE;
     }        
   return(0);
  }
Reason: