crash script overflow ?

 

hi guys  anyone  now  why this is  script  crashed ???

//+-----------------------------------------------------------+
//| MT4 CUSTOM INDICATOR                   123PatternsV7.MQ4  |
//| copy to [experts\\indicators] and recompile or restart MT4 |
//+-----------------------------------------------------------+
//| Free software for personal non-commercial use only.       |
//| No guarantees are expressed or implied.                   |
//| Feedback welcome via Forex Factory private message.       |
//+-----------------------------------------------------------+
#property copyright "Copyright © 2011 Robert Dee"
#property link      "www.forexfactory.com/robdee"

#define INDICATOR_VERSION    20111211         // VERSION 7 complete new approach focused on aggressive entries
#define INDICATOR_NAME       "123PatternsV7 BETA"
#define RELEASE_LEVEL        "Public BETA"
#define MT4_BUILD            409

#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1  DodgerBlue   // BuyLine
#property indicator_color2  OrangeRed    // SellLine
#property indicator_color3  DodgerBlue   // BullCandle
#property indicator_color4  OrangeRed    // BearCandle
#property indicator_color5  DodgerBlue   // BlueDot
#property indicator_color6  OrangeRed    // RedDot
#property indicator_width1  1            // BuyLine
#property indicator_width2  1            // SellLine
#property indicator_width3  3            // BullCandle
#property indicator_width4  3            // BearCandle
#property indicator_width5  2            // BlueDot
#property indicator_width6  2            // RedDot

extern string Notes           = "BETA TEST EURUSD M5 Setup";
extern int    ZigZagDepth     = 1;
extern bool   CCIFilter       = True;
extern int    CCIPeriod       = 144;
extern bool   VolFilter       = True;
extern int    VolMaFast       = 12;
extern int    VolMaSlow       = 144;

// indicator buffers
double BuyLine[];
double SellLine[];
double BullCandle[];
double BearCandle[];
double BlueDot[];
double RedDot[];

int     signal;
#define NOSIG   0
#define BUYSIG  10
#define SELLSIG 20

int     lastpeak;
#define NONE     0
#define BULLISH  10
#define BEARISH  20

datetime signaltime, redrawtime, upperpeaktime, lowerpeaktime;
double   signalprice, upperpeak, lowerpeak, prevupperpeak, prevlowerpeak;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexStyle(2,DRAW_HISTOGRAM);
   SetIndexStyle(3,DRAW_HISTOGRAM);
   SetIndexStyle(4,DRAW_ARROW);
   SetIndexArrow(4,142); // BullDot (WingDings character)
   SetIndexStyle(5,DRAW_ARROW);
   SetIndexArrow(5,142); // BearDot (WingDings character)
   SetIndexBuffer(0,BuyLine);
   SetIndexBuffer(1,SellLine);
   SetIndexBuffer(2,BullCandle);
   SetIndexBuffer(3,BearCandle);
   SetIndexBuffer(4,BlueDot);
   SetIndexBuffer(5,RedDot);
   SetIndexEmptyValue(0,EMPTY_VALUE);
   SetIndexEmptyValue(1,EMPTY_VALUE);
   SetIndexEmptyValue(2,EMPTY_VALUE);
   SetIndexEmptyValue(3,EMPTY_VALUE);
   SetIndexEmptyValue(4,EMPTY_VALUE);
   SetIndexEmptyValue(5,EMPTY_VALUE);
   SetIndexLabel(0,"BuyLine");
   SetIndexLabel(1,"SellLine");
   SetIndexLabel(2,"");
   SetIndexLabel(3,"");
   SetIndexLabel(4,"");
   SetIndexLabel(5,"");
   IndicatorShortName(INDICATOR_NAME);
   IndicatorDigits(Digits);
   if(IsTesting() == False)
     {
      Print("Copyright © 2011 Robert Dee, All Rights Reserved");
      Print("Free software for personal non-commercial use only. No guarantees are expressed or implied.");
      Print(INDICATOR_NAME+" indicator version "+INDICATOR_VERSION+" for "+RELEASE_LEVEL+" release, compiled with MetaTrader4 Build "+MT4_BUILD);
     }
   return 0;
  } // end of init()

//+------------------------------------------------------------------+
//| Status Message prints below OHLC upper left of chart window
//+------------------------------------------------------------------+
void StatusMessage()
  {
   if(IsTesting() == True)
      return; // do no more

   double multi = MathPow(10,Digits-1);
   double dayhigh = iHigh(NULL,PERIOD_D1,0);
   double daylow = iLow(NULL,PERIOD_D1,0);
   double range = dayhigh - daylow;
   double retrace = (Bid - daylow) / range;
   string msg = INDICATOR_NAME+"  "+TimeToStr(TimeCurrent(),TIME_MINUTES)+"  ";

   if(signal == NOSIG)
      msg = msg + "NOSIG  ";
   if(signal == BUYSIG)
      msg = msg + "BUYSIG  "+ TimeToStr(signaltime,TIME_MINUTES)+"  "+DoubleToStr(signalprice,Digits)+"  ";
   if(signal == SELLSIG)
      msg = msg + "SELLSIG  "+ TimeToStr(signaltime,TIME_MINUTES)+"  "+DoubleToStr(signalprice,Digits)+"  ";

   msg = msg + "ZigZagDepth="+ZigZagDepth+"  ";
   msg = msg + "Range="+DoubleToStr(range*multi,1)+"  ";
//msg = msg + "Retrace="+DoubleToStr(retrace,2)+"  ";
   msg = msg + "Spread="+DoubleToStr((Ask-Bid)*multi,1)+"  ";
   Comment(msg);
  }

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
// REDRAW ONLY ONE TIME PER CANDLE
   if(redrawtime == Time[0])
     {
      StatusMessage();   // if already redrawn on this candle then do no more
      return(0);
     }
   redrawtime = Time[0];

   int      shift;
   double   zigzag, range1;

   if(CCIFilter == True) // load cci[] array
     {
      double ccima, ccima6;
      double cci[100];
      ArrayResize(cci,Bars);
      ArrayInitialize(cci,EMPTY_VALUE);
      ArraySetAsSeries(cci,True);
      shift = Bars-1;
      while(shift >= 0)
        {
         cci[shift] = iCCI(NULL,0,CCIPeriod,PRICE_CLOSE,shift);
         shift--;
        }
     }

   if(VolFilter == True) // load vol[] array
     {
      double volmafast, volmaslow;
      double vol[100];
      ArrayResize(vol,Bars);
      ArrayInitialize(vol,EMPTY_VALUE);
      ArraySetAsSeries(vol,True);
      shift = Bars-1;
      while(shift >= 0)
        {
         vol[shift] = Volume[shift];
         shift--;
        }
     }

   shift = Bars-1; // redraw entire chart
   while(shift >= 0)
     {
      if(CCIFilter == True)
        {
         ccima = iMAOnArray(cci,0,12,0,MODE_SMA,shift);
         ccima6 = iMAOnArray(cci,0,12,0,MODE_SMA,shift+6);
        }
      if(VolFilter == True)
        {
         volmafast = NormalizeDouble(iMAOnArray(vol,0,VolMaFast,0,MODE_SMA,shift),0);
         volmaslow = NormalizeDouble(iMAOnArray(vol,0,VolMaSlow,0,MODE_SMA,shift),0);
        }
      zigzag = iCustom(NULL,0,"ZigZag",ZigZagDepth,5,3,0,shift+1);
      if(zigzag == High[shift+1])
        {
         prevupperpeak = upperpeak;
         upperpeak = zigzag;
         upperpeaktime = Time[shift+1];
         lastpeak = BEARISH;
         signal = NONE;
        }
      if(zigzag == Low[shift+1])
        {
         prevlowerpeak = lowerpeak;
         lowerpeak = zigzag;
         lowerpeaktime = Time[shift+1];
         lastpeak = BULLISH;
         signal = NONE;
        }
      range1 = High[shift+1]-Low[shift+1];

      /////////////////
      // RED DOTS
      if(upperpeak < prevupperpeak)
         RedDot[iBarShift(NULL,0,upperpeaktime)] = upperpeak+10*Point;
      //RedDot[shift] = High[shift];

      /////////////////
      // BLUE DOTS
      if(lowerpeak > prevlowerpeak)
         BlueDot[iBarShift(NULL,0,lowerpeaktime)] = lowerpeak-10*Point;
      //BlueDot[shift] = Low[shift];

      /////////////////
      // BEARISH PEAK
      if(signal != SELLSIG)
         if(lastpeak == BEARISH)
            if(upperpeak < prevupperpeak)
               if(CCIFilter == False || ccima > -125)
                  if(VolFilter == False || volmafast > volmaslow)
                     if(Low[shift+1] < Low[shift+2])
                        if(Close[shift+1] < Open[shift+1])
                           if(Close[shift+1] < Low[shift+1]+(range1/6) || Close[shift+1] < lowerpeak)
                             {
                              BearCandle[shift+1] = Open[shift+1];
                              BullCandle[shift+1] = Close[shift+1];
                              SellLine[shift+1] = Close[shift+1];
                              SellLine[shift+2] = EMPTY_VALUE;
                              BuyLine[shift+1] = EMPTY_VALUE; // cancel the buy line
                              BuyLine[shift] = EMPTY_VALUE; // cancel the buy line
                              signal = SELLSIG;
                              signalprice = SellLine[shift+1];
                              signaltime = Time[shift+1];
                             }
      SellLine[shift] = SellLine[shift+1];

      /////////////////
      // BULLISH PEAK
      if(signal != BUYSIG)
         if(lastpeak == BULLISH)
            if(lowerpeak > prevlowerpeak)
               if(CCIFilter == False || ccima < 125)
                  if(VolFilter == False || volmafast > volmaslow)
                     if(High[shift+1] > High[shift+2])
                        if(Close[shift+1] > Open[shift+1])
                           if(Close[shift+1] > High[shift+1]-(range1/6) || Close[shift+1] > upperpeak)
                             {
                              BearCandle[shift+1] = Open[shift+1];
                              BullCandle[shift+1] = Close[shift+1];
                              BuyLine[shift+1] = Close[shift+1];
                              BuyLine[shift+2] = EMPTY_VALUE;
                              SellLine[shift+1] = EMPTY_VALUE; // cancel the sell line
                              SellLine[shift] = EMPTY_VALUE; // cancel the sell line
                              signal = BUYSIG;
                              signalprice = BuyLine[shift+1];
                              signaltime = Time[shift+1];
                             }
      BuyLine[shift] = BuyLine[shift+1];

      shift--; // move ahead one candle
     }

// debug data to Experts log
   if(CCIFilter == True)
      Print("cci "+cci[0]+"  ccima "+ccima);
   if(VolFilter == True)
      Print("vol "+vol[0]+"  volmafast "+volmafast+"  volmaslow "+volmaslow);
   return 0;
  }// end of start()

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
// cleanup display buffers
   for(int i=0; i<Bars; i++)
     {
      BuyLine[i] = EMPTY_VALUE;
      SellLine[i] = EMPTY_VALUE;
      BullCandle[i] = EMPTY_VALUE;
      BearCandle[i] = EMPTY_VALUE;
      BlueDot[i] = EMPTY_VALUE;
      RedDot[i] = EMPTY_VALUE;
     }
   Comment("");
   return 0;
  }// end of deinit()


//+------------------------------------------------------------------+
Reason: