array out of range on modified indicator

 

So I wanted to use Fractals indicator however I would like to see less Fractals by extending both the look-back and look-forward period from 2 to 5.

The only thing I've modified from the stock version of the iFractals indicator are the highlighted stuff below. I'm getting a message that says 'array out of range' which regards to the array in red below.

Do you know why this would be? I'm surprised it's kicking out for the low array but not for the high array.


   for(i=limit;i<rates_total-3 && !IsStopped();i++)

     {

      //---- Upper Fractal

      if(high[i]>high[i+1] && high[i]>high[i+2] && high[i]>high[i+3] && high[i]>high[i+4] && high[i]>high[i+5] && high[i]>=high[i-1] && high[i]>=high[i-2] && high[i]>=high[i-3] && high[i]>=high[i-4] && high[i]>=high[i-5])

         ExtUpperBuffer[i]=high[i];

      else ExtUpperBuffer[i]=EMPTY_VALUE;


      //---- Lower Fractal

      //Print("i ="+i);

      if(low[i]<low[i+1] && low[i]<low[i+2] && low[i]<low[i+3] && low[i]<low[i+4] && low[i]<low [i+5] && low[i]<=low[i-1] && low[i]<=low[i-2] && low[i]<=low[i-3] && low[i]<=low[i-4] && low[i]<=low[i-5])

         ExtLowerBuffer[i]=low[i];

      else ExtLowerBuffer[i]=EMPTY_VALUE;

     }