PureBytes Links
Trading Reference Links
|
Hello,
FIRST category
firstvisiblebar / lastvisiblebar give you bar item number that can be used
to iterate arrays. It is in the range of 0..BarCount-1 (if you do not have blank bars in the right)
or 0..BarCount -1 + NumberOfBlankBars (if you have them).
SECOND category
firstvisiblebarindex / lastvisiblebar index give you bar index which is ABSOLUTE
position in the quotation database (like BarIndex()).
FIRST should be used if you want to reference array elements for example:
CloseAtFirstVisibleBar = Close[ Status("firstvisiblebar" ) ];
SECOND should be used if you want to compare to numbers returned by BarIndex(), for example:
CloseAtFirstVisibleBar = LastValue( ValueWhen( BarIndex() == Status("firstvisiblebarindex"), Close ) );
Those two things may be different but may be the same depending on how your formula is written
and how many previous/future bars are referenced.
The difference between the two is bi[ 0 ] term, i.e.:
bi = BarIndex();
firstvisblebarindex == firstvisiblebar + bi[ 0 ];
lastvisblebarindex == lastvisiblebar + bi[ 0 ];
This is already explained in the User's Guide:
http://www.amibroker.com/f?barindex
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "Corey Saxe" <res1wgwl@xxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, September 04, 2004 2:28 AM
Subject: Re: [amibroker] Status("firstvisiblebarindex") vs Status("firstvisiblebar")
> Appears that QuickAFL rears its ugly head again.
> Put setbarsrequired at the top.
>
> BTW, you don't need any numtostr.
>
> Title ="\nfirstvisiblebarindex= "+firstvisiblebarindex+
> "\nfirstvisiblebar= "+firstvisiblebar+
> "\nLastvisiblebar= "+lastvisiblebar+
> "\nLastvisiblebarindex= "+Lastvisiblebarindex+
> "\nBarindex= "+BarIndex()+
> "\nBarcount= "+BarCount;
>
> works fine.
>
> -CS
> ----- Original Message -----
> From: Herman van den Bergen
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Friday, September 03, 2004 4:16 PM
> Subject: RE: [amibroker] Status("firstvisiblebarindex") vs Status("firstvisiblebar")
>
>
> [TJ] The difference is the same as between BarIndex() and BarCount.
> Barindex() and barcount work as expected, but these new functions do not.
> Please try the code below.
>
> [stepane] click on the chart and the results will be diferent...
> That is what i expected, but nothing changes... did you try? PLEASE try the
> code below, the barcount and BarIndex() work as expected but the others do
> not. No matter what/where I click the first four numbers do not change, they
> do change with chart scrolling.
>
> firstvisiblebar = Status("firstvisiblebar");
> firstvisiblebarindex = Status("firstvisiblebarindex");
> lastvisiblebar = Status("lastvisiblebar");
> Lastvisiblebarindex = Status("Lastvisiblebarindex");
> Title =
> "\nfirstvisiblebarindex= "+NumToStr(firstvisiblebarindex,1.0,False)+
> "\nfirstvisiblebar= "+NumToStr(firstvisiblebar,1.0,False)+
> "\nLastvisiblebar= "+NumToStr(lastvisiblebar,1.0,False)+
> "\nLastvisiblebarindex= "+NumToStr(Lastvisiblebarindex,1.0,False)+
> "\nBarindex= "+NumToStr(BarIndex(),1.0,False)+
> "\nBarcount= "+NumToStr(BarCount,1.0,False);
>
> What do i do wrong?
> herman
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> Yahoo! Groups Links
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> 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/
|