I am not very familiar with loops so to understand it I ran exploration after that so I can understand how the values changes after each bar.
myema[ 0 ] = Close[ 0 ];
for( i = 1; i < BarCount-1; i++ )
{
myema[ i ] = 0.1 * Close[ i ] + 0.9 * myema[ i - 1 ];
}
Plot(i,"i",colorWhite);
Filter =1 ;
AddColumn(myema,"myema",1.22);
AddColumn(i,"i",1.22);
AddColumn(Close,"Close",1.22);
AddColumn(BarCount,"BarCount",1.22);
In the exploration, the value of "i" is fixed at 2464. I was expecting it to be 1 on the first bar and then increasing 1 by 1.
Please guide me