indicator line 's difference because of a very little different code

 

Below code comes from an indicator's code, and I think the red codes and blue codes are the same, but in the fact very different.

 i=Bars-MAPeriod-1;

   if(counted_bars>=MAPeriod) i=Bars-counted_bars-1;

   while(i>=0)

    {
   ind_buffer[i]=iMA(NULL,0,MAPeriod,0,MODE_SMA,PRICE_CLOSE,i);

    BiasBuffer[i]=(Close[i]-ind_buffer[i])/Close[i];

      
    /* 
    int x=iMA(NULL,0,MAPeriod,0,MODE_SMA,PRICE_CLOSE,i);

    BiasBuffer[i]=(Close[i]-x)/Close[i];
    */

      i--;

     }

the red code gets the line as 'A' and blue code gets the line as 'B':

A:

B:

in addition, i find add label by two methods as below:

"IndicatorShortName("BIAS("+MAPeriod+")"); SetIndexLabel(0,"BIAS"); "

"IndicatorShortName("BIAS("+MAPeriod+")"); " always works, but "SetIndexLabel(0,"BIAS"); " not. I don;t know why, because i think they should all work well.

 
Do you realise the difference between an integer and a double?
 
GumRai:
Do you realise the difference between an integer and a double?

Haha, thanks
Reason: