Hello,
Best regards, Tomasz Janeczko amibroker.com ----- Original Message ----- From: "vlanschot" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Thursday, April 17, 2008 2:05 PM Subject: [amibroker] Barcount vs Barindex() >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) > > > > ------------------------------------ > > Please note that this group is for discussion between users only. > > To get support from AmiBroker please send an e-mail directly to > SUPPORT {at} amibroker.com > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > http://www.amibroker.com/devlog/ > > For other support material please check also: > http://www.amibroker.com/support.html > Yahoo! Groups Links > > >
<<Capture2.gif>>
