I always thought that Barcount would give me the number of bars, as 
in "LastValue", available for the current active array, according to 
the manual:

" . . . BarCount is a numeric variable that holds just one number 
(the count of elements in array). . ."

as well as:

" . . .  if you choose range: "all quotes" in AA
SelectedValue function is equivalent to array[ BarCount - 1 ] . . ."

Why is it then that if I use the following code:

MaxBar=BarCount-1;
ChBar=LastValue(Min(MaxBar,SelectedValue(BarIndex())));

printf("\nChBar: " + NumToStr(ChBar,1.0));
printf("\nMaxBar: " + NumToStr(MaxBar,1.0));

I get the same number for ChBar and Maxbar as output in my 
Interpretation for a randomly selected bar in the chart:

ChBar: 640
MaxBar: 640

If I select another bar, the numbers are again the same:

ChBar: 881
MaxBar: 881

Should MaxBar not reflect a fixed number, namely (LastValue(BarIndex
())- "Blank Bars"?

Or do I need to re-interpreted Barcount as:

Barcount = SelectedValue(BarIndex())+1; ????

I use AB 5.08

Thx,

PS (Deja-vu-ing, feeling like a beginner again)


Reply via email to