[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Barcount vs Barindex()



PureBytes Links

Trading Reference Links

Hello,

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "vlanschot" <vlanschot@xxxxxxxxx>
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
>
> <*> To visit your group on the web, go to:
>   
http://groups.yahoo.com/group/amibroker/
>
> <*> Your email settings:
>    Individual Email | Traditional
>
> <*> To change settings online go to:
>   
http://groups.yahoo.com/group/amibroker/join
>    (Yahoo! ID required)
>
> <*> To change settings via email:
>   
mailto:amibroker-digest@xxxxxxxxxxxxxxx
>   
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
>
> <*> To unsubscribe from this group, send an email to:
>   
amibroker-unsubscribe@xxxxxxxxxxxxxxx
>
> <*> Your use of Yahoo! Groups is subject to:
>   
http://docs.yahoo.com/info/terms/
> __._,_.___

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




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___