what my code 's error

 
//+------------------------------------------------------------------+
//|                                                x.mq4 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Red
#property indicator_color3 Yellow
#property indicator_color4 Yellow




extern int MaxTimeFrame=240;
extern int MaxPeriod=20;
extern int MaxDeviation=0;
extern int MaxShift=2;
extern int Maxapplied_price=0;


extern int MinTimeFrame=60;
extern int MinPeriod=20;
extern int MinDeviation=0;
extern int MinShift=2;
extern int Minapplied_price=0;





//--- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,ExtMapBuffer3);
   SetIndexStyle(3,DRAW_LINE);
   SetIndexBuffer(3,ExtMapBuffer4);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
      int limit;
      int counted_bars=IndicatorCounted();
      if(counted_bars>0) counted_bars--;
      limit=Bars-counted_bars;
      for(int i=0;i<limit;i++)
         {
            int cc=iBarShift(Symbol(),MaxTimeFrame,Time[i]);
            
           ExtMapBuffer1[i]=iBands(Symbol(),MaxTimeFrame,MaxPeriod,MaxDeviation,MaxShift,Maxapplied_price,MODE_UPPER,cc);
           ExtMapBuffer2[i]=iBands(Symbol(),MaxTimeFrame,MaxPeriod,MaxDeviation,MaxShift,Maxapplied_price,MODE_LOWER,cc);
            
            
            
            int dd=iBarShift(Symbol(),MinTimeFrame,Time[i]);
           ExtMapBuffer3[i]=iBands(Symbol(),MinTimeFrame,MinPeriod,MinDeviation,MinShift,Minapplied_price,MODE_UPPER,dd);
           ExtMapBuffer4[i]=iBands(Symbol(),MinTimeFrame,MinPeriod,MinDeviation,MinShift,Minapplied_price,MODE_LOWER,dd);
         }
   
  
   return(0);
  }
//+------------------------------------------------------------------+

the indicator run have a error ,just display two line,why
 
zdj231: the indicator run have a error,just display two line,why
  1. Why do you expect upper and lower to be different when you ask for ZERO deviations?
  2. No need for decrement counted. Always count down. Don't look past starting values.
    int counted_bars=IndicatorCounted();
    if(counted_bars>0) counted_bars--;
    limit=Bars-counted_bars;
    for(int i=0;i<limit;i++)
    
    int counted_bars=IndicatorCounted(),
        maxLookBack = MathMax(MaxPeriod, MinPeriod);
    if(counted_bars < maxLookBack) counted_bars = maxLookBack;
    for(int i=Bars-1-counted_bars;i>=0;i--)

Reason: