Problem in simple custom indicator!

 

What is the problem here (last bar do not draw):

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1  Red
#property indicator_width1  1
//---- input parameters
extern int PERIOD  =12;
//---- indicator buffer
double Buffer[];

int init()
  {
   SetIndexBuffer(0,Buffer);
   SetIndexStyle(0,DRAW_LINE);
  }
//+------------------------------------------------------------------+
int start()
  {
   int limit=Bars-1-IndicatorCounted();
//----

   
   for(int i=0; i < limit; i++)
     {
      Buffer[i]=Buffer[i-1]+(Close[i]-Close[i-PERIOD])/PERIOD;
     }
//----
  
//----
   return(0);
  }

//+------------------------------------------------------------------+
 

Correct simple one (if someone know the name of this, please, tell me):


#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1  Red
#property indicator_width1  1
//---- input parameters
extern int PERIOD  =12;
//---- indicator buffer
double Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexBuffer(0,Buffer);
   SetIndexStyle(0,DRAW_LINE);
  }
//+------------------------------------------------------------------+
int start()
  {
   int i=Bars-1-IndicatorCounted();
//----

   while(i>=0)
     {
      Buffer[i]=Buffer[i+1]+(Close[i]-Close[i+PERIOD])/PERIOD;      
      i--;
     }
//----
  
//----
   return(0);
  }

//+------------------------------------------------------------------+