Bingo!   

Thanks kindly, TJ, for putting our attention directly on the heart of it.

--- In [email protected], Tomasz Janeczko <gro...@...> wrote:

> Plot( IIf( BarIndex() >= BarCount - EMABarsVisible21, EMA( C,21), Null 
> ), "", colorViolet,styleNoLabel |5 );

> is INCORRECT because BarCount DEPENDS ON ZOOM FACTOR !

> because it assumes that BarCount has any relationship with BarIndex().
> IT DOES NOT!

> http://www.amibroker.com/kb/2008/07/03/quickafl/

> Short advice:
> DO NOT use BarCount for ANYTHING else than building a for loop that 
> iterates through array elements like
> this:
> for( i = 0 ; i < BarCount; i++ )
> {
>    array[ i ] = H[ i ] + L[ i ];
> }
> 
> This is one and the only one use of BarCount (at least for people 
> without proper understanding of what was described in the
> article pointed out above).


Reply via email to