Помогите отстаёт линия CCI от следующего бара _CCI_SMA

 
//+------------------------------------------------------------------+
//| CCI_SMA.mq4 |
//| Copyright © 2006, MetaQuotes Software Corp. |
//| https://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, Дмитрий Альхимович "" переработан Igor konoves "
#property link "http://www.selfprofit.com"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Chartreuse
#property indicator_color2 DeepSkyBlue

extern int MA_Period = 9;
extern int CCI = 14;
//---- buffers
double NormPrice[];
double MA[];

//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
ObjectsRedraw();
//---- return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{


SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,NormPrice);

SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,MA);


string short_name ="CCI";

IndicatorShortName(short_name);





int counted_bars=IndicatorCounted();
int i = 0;
int
barsToCount = Bars - counted_bars;
while(i <= barsToCount)

{
NormPrice[i] = iCCI(Symbol(),0,CCI,PRICE_MEDIAN,i);
//Close[i] ;
double sum = 0;
if(i >= MA_Period)

{
for(int j=0;
j < MA_Period;
j++)

{
sum = sum + NormPrice[i-j];
}
{
MA[i-MA_Period] = sum / MA_Period;
}
}
i++; }

//----
return(0);
}
//+------------------------------------------------------------------+
Причина обращения: