Tomasz,

Thanks for your reply and advice.  This should definitely help.

Ara,

You mean
bi = barindex();
ai = bi - bi[0];

Yeah, this would be needed prior to version 5.30.  With the version 5.30 
change, ai becomes equal to bi.

Regards,
Don


--- In [email protected], Tomasz Janeczko <gro...@...> wrote:
>
>   Hello,
> 
> In the past BarIndex() not starting from zero was a source of endless 
> confusion among users.
> 
> Now it is easier to understand and use.
> 
> If you for some reason need to know what absolute number of bars is you can 
> use
> Status() function
> http://www.amibroker.com/guide/afl/afl_view.php?status
> that now features new info:
> "quickaflfirstdatabar", "quickafllastdatabar" - This feature is for internal 
> use only. These are bar indexes of actual underlying compressed quotation 
> array 
> that make up AFL's array[ 0 ] and array[ BarCount - 1]
> 
> Just add Status("quickaflfirstdatabar") to what you are getting from 
> BarIndex() now and you will get
> old-style result.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> 
> On 2010-07-27 23:52, dturtle887 wrote:
> > Hi All,
> >
> > My AFL code that I use for charting/explorations/signal generation and 
> > real-time trading relies on the BarIndex function as implemented in AB 
> > versions prior to 5.30.  Upgrading to 5.30 broke my code and I found out 
> > with surprise that the reason for that was the new behavior of the BarIndex 
> > command.  To quote from the User's Guide: "BarIndex() now returns values 
> > always starting from zero (even if QuickAFL is turned on)" which means that 
> > BarIndex no longer returns absolute bar numbers.  For example, LastValue( 
> > BarIndex()) is now ALwAYS equal BarCount- 1 (which makes it useless for new 
> > bar detection, for example).
> >
> > The recommended workaroud is to use SetBarsRequired( sbrAll).  However, 
> > this is not a good option because it can slow down execution considerably 
> > for a formula of any complexity and a database size>  some 1000 bars.
> >
> > In my opinion, the old behavior of the BarIndex function was exactly what 
> > was needed because it made possible to use QuickAFL and to access absolute 
> > bar numbers at the same time.
> >
> > So I am just wondering whether I am the only one impacted by the change or 
> > maybe not enough users tried to upgrade to ver 5.30 to find out yet?
> >
> > Regards,
> > Don
> >
> >
> >
> >
> > ------------------------------------
> >
> > **** IMPORTANT PLEASE READ ****
> > This group is for the discussion between users only.
> > This is *NOT* technical support channel.
> >
> > TO GET TECHNICAL SUPPORT send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> > http://www.amibroker.com/feedback/
> > (submissions sent via other channels won't be considered)
> >
> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>


Reply via email to