Ошибка в коде!

 

Взял готовый индикатор ROC, решил добавить его скользящую среднюю. При компиляции выдается ошибка:

'[' - assignment expected C:\Program Files\Alpari NZ MT4\experts\indicators\123.mq4 (72, 19)

']' - assignment expected C:\Program Files\Alpari NZ MT4\experts\indicators\123.mq4 (72, 21)

'=' - unexpected token C:\Program Files\Alpari NZ MT4\experts\indicators\123.mq4 (72, 23)

'100' - unexpected token C:\Program Files\Alpari NZ MT4\experts\indicators\123.mq4 (72, 25)

'*' - assignment expected C:\Program Files\Alpari NZ MT4\experts\indicators\123.mq4 (72, 29) и т.д.

Не подскажете, в чем причина?

//+------------------------------------------------------------------+
//|                                                          ROC.mq4 |
//|                                    Copyright © 2006, Robert Hill |
//+------------------------------------------------------------------+

#property  copyright "Copyright © 2006, Robert Hill"
//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 1
#property  indicator_color1  Red
//---- indicator parameters
extern int RPeriod = 12;
extern bool UsePercent = false;
//---- indicator buffers
double RateOfChange[], MMM[];<---  переменная объявлена тут
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- drawing settings
   SetIndexStyle(0, DRAW_LINE);
   SetIndexDrawBegin(0, RPeriod);
   IndicatorDigits(Digits + 1);
//---- indicator buffers mapping
   if(!SetIndexBuffer(0, RateOfChange))
       Print("cannot set indicator buffers!");
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("ROC(" + RPeriod + ")");
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence                           |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   double ROC, CurrentClose, PrevClose, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, MMM;<---  и с таким же именем переменная объявлена тут
   int counted_bars = IndicatorCounted();
//---- check for possible errors
   if(counted_bars < 0) 
       return(-1);
//---- last counted bar will be recounted
   if(counted_bars > 0) 
       counted_bars--;
   limit = Bars - counted_bars - RPeriod - 6;
//---- ROC calculation
   for(int i = 0; i < limit; i++)
     {
       {CurrentClose = iClose(NULL, 0, i);
       PrevClose = iClose(NULL, 0, i + RPeriod);
       C1 = iClose(NULL, 0, i + RPeriod + 6);
       C2 = iClose(NULL, 0, i + RPeriod + 5);
       C3 = iClose(NULL, 0, i + RPeriod + 4);
       C4 = iClose(NULL, 0, i + RPeriod + 3);
       C5 = iClose(NULL, 0, i + RPeriod + 2);
       C6 = iClose(NULL, 0, i + RPeriod + 1);
       C7 = iClose(NULL, 0, i + RPeriod - 1);
       C8 = iClose(NULL, 0, i + RPeriod - 2);
       C9 = iClose(NULL, 0, i + RPeriod - 3);
       C10 = iClose(NULL, 0, i + RPeriod - 4);
       C11 = iClose(NULL, 0, i + RPeriod - 5);
       C12 = iClose(NULL, 0, i + RPeriod - 6);
       ROC = CurrentClose - PrevClose;
       MMM=(C7+C8+C9+C10+C11+C12+CurrentClose-C1-C2-C3-C4-C5-C6-PrevClose)/7;} <--- компилятор не понимает к какой конкретно переменной ему обращаться. к массиву или к обычной
       //----
       if(UsePercent)
         {
           if(PrevClose != 0)
               {RateOfChange[i] = 100 * ROC / PrevClose;
               MMM[i] = 100 * MMM / PrevClose;}<--- компилятор не понимает к какой конкретно переменной ему обращаться. к массиву или к обычной
         }
       else
           {RateOfChange[i] = ROC;
           MMM[i] = MMM;}<--- компилятор не понимает к какой конкретно переменной ему обращаться. к массиву или к обычной
     }   
//---- done
   return(0);
  }
//+------------------------------------------------------------------+
 
sergeev:

хвастаетесь?


вам же написали

причина в 72 строке

'[' - assignment expected C:\Program Files\Alpari NZ MT4\experts\indicators\123.mq4 (72, 19)


я понимаю, что в 72 строке. но не понимаю как исправить. пробовал переделать - ошибка остается
 
Спасибо за помощь!
Причина обращения: