What are you searching for?  Here is what came up with a QuickAFL search.
 
Bill
 
==========================================
 
Added chart timing display (you can turn it on via Tools->Preferences->Display chart timing)

when turned on, in the bottom of each chart the following information is displayed:
Total time X sec, AFL exec time Y sec (Z %), # extra bars back Q, fwd R

where
X - is total time in second spent during chart refresh ( this includes AFL execution and actual screen painting/drawing, grid / scale calculations, etc)
Y - is time spent in chart AFL execution only (without any actual screen painting, grid / scale calcs)
Z - is percentage of time that AFL execution takes compared to total time required for refresh
Q - is a number of previous bars (before first visible bar) that are needed to calculate the indicator (QuickAFL estimation)
R - is the number of future bars (after last visible bar) that are needed to calculate the indicator (QuickAFL estimation)
 
=====================================
 
 

BARINDEX
- get zero-based bar number

Date/Time
(AFL 2.3)


SYNTAX BarIndex()
RETURNS ARRAY
FUNCTION returns zero-based bar number - the same as Cum(1)-1 but it is much faster than Cum(1) when used in Indicators
EXAMPLE ThisIsLastBar = BarIndex() == LastValue( BarIndex() );
SEE ALSO CUM() function

Comments:

Tomasz Janeczko
tj --at-- amibroker.com
2004-07-23 07:07:29
When QuickAFL is ON, the BarIndex() may not be equal with array item index.

Actual array item
corresponding to bar index can be found this way:

bi = BarIndex();
arrayitem = SelectedValue( bi ) - bi[ 0 ];
"Close at selected bar:" + Close[ arrayitem ];
 
======================================
 

SETBARSREQUIRED
- set number of previous and future bars needed for script/DLL to properly execute

Miscellaneous functions
(AFL 2.1)


SYNTAX setbarsrequired( backwardref = -1, forwardref = -1 )
RETURNS nothing
FUNCTION set number of previous and future bars needed for script/DLL to properly execute. If your formula is pure AFL you don't need to use this function at all, as AmiBroker automatically calculates number of bars required for all its built-in functions. But if you are using script or a DLL you may need to use this function to make sure that your indicators are properly calculated in QuickAFL mode. Specifying -1 means no change. For example if you are using the script that calculates 100 bar moving average you may need to call SetBarsRequired( 100, 0 ); at the very beginning of your formula. Please note that in most cases it is not necessary (even if you are using script or DLL) because AmiBroker always provides at least 30 past data bars more than needed.
EXAMPLE setbarsrequired( 100000, 100000 ) // require all past and all future bars
====================================

QuickAFL is turned ON always

(it does not affect regular AFL code, only may affect some loops and/or plugins but a graceful period of almost 2 years was given to every user to get used to it and adjust the code if necessary, note: if particular formula needs all bars use SetBarsRequired function)


----- Original Message -----
From: "wlandry01" <[EMAIL PROTECTED]>
To: <amibroker@yahoogroups.com>
Sent: Friday, September 01, 2006 3:10 PM
Subject: [amibroker] Re: Need Help With FirstVisibleBarIndex

>
> Bill,
>
> Thanks!  I think you've identified the problem that I'm having.
> I would like to read up on QuickAFL, but I'm not having any luck
> finding anything.  I've searched the AmiB User's Guide, the
> AmiB website, the AFL Reference and a number of other places.
> The only mention I find of it is where a reference to it is
> included in an indicator (e.g., BarIndex()).  Do you happen to
> know where some information on it is located?
>
> I also haven't found anything that explains what Display Timing
> means.  Are you aware of any references on it, as well?
>
> Thanks,
>
>
> Wayne
>
>
> --- In
amibroker@yahoogroups.com, "wavemechanic" <[EMAIL PROTECTED]> wrote:
>>
>> Put SetBarsRequired(10000,0) at the beginning of the code (overrides
> QuickAFL) and both sets will return the same values.  Note, if blank
> right bars are visible they are counted.  However, for your
> application of finding highest C, etc. look at the code and charts
> that I posted before and you will see that it is not needed in that
> case because the blank bars do not change the highest C, etc.  Read
> about QuickAFL and turn on the chart timing display (Tools >
> Preferences > Display Timing).  Play with this stuff and all will
> become crystal clear - sort of.
>>
>> Bill
>>
>>
>> ----- Original Message -----
>> From: "wlandry01" <[EMAIL PROTECTED]>
>> To: <
amibroker@yahoogroups.com>
>> Sent: Friday, September 01, 2006 11:59 AM
>> Subject: [amibroker] Re: Need Help With FirstVisibleBarIndex
>>
>>
>> >
>> > Graham,
>> >
>> > According to the AFL Reference, "FirstVisibleBar" returns the bar
>> > number while "FirstVisibleBarIndex" returns the bar index.
>> >
>> > With respect to Fred's comments, the AFL Reference indicates that both
>> > are available in Indicator mode only, so checking them in Exploration
>> > mode is not an option.  That's consistent with my experience.
>> >
>> > I copied Fred's code and displayed it on a chart and I find that the
>> > "FirstVisibleBar" and "LastVisibleBar" indicators give me non-zero
>> > values that do not change as I change the chart time frame.  The
>> > numbers don't appear to correspond to anything on the chart.  That
>> > part I don't understand. 
>> >
>> > The "FirstVisibleBarIndex" and "LastVisibleBarIndex" give the index
>> > numbers and they do change with the chart.  That part is consistent
>> > with the AFL Reference.  I'm not familiar with the use of _Trace so I
>> > don't know how to use that to check on this question.
>> >
>> > If would be helpful if someone could advise as to what the
>> > "FirstVisibleBar" and "LastVisibleBar" indicators are showing in the
>> > code that Fred provided (see below).
>> >
>> > Thanks,
>> >
>> >
>> > Wayne
>> >
>> >
>> >
>> >
>> >
>> > Wayne
>> >
>> >
>> >
>> >
>> > --- In
amibroker@yahoogroups.com, Graham <kavemanperth@> wrote:
>> >>
>> >> Thanks Fred. So FirstVisibleBar delivers the barindex() value as well
>> >> FirstVisibleBarIndex. I would have thought that they would be
> different
>> >> otherwise why have the both of them
>> >> That is gong to require reworking of all existing AFL that use
>> >> FirstVisibleBar as a 0 or 1 value
>> >>
>> >>
>> >> --
>> >> Cheers
>> >> Graham
>> >> AB-Write >< Professional AFL Writing Service
>> >> Yes, I write AFL code to your requirements
>> >>
http://e-wire.net.au/~eb_kavan/ab_write.htm
>> >>
>> >> On 01/09/06, Fred <ftonetti@> wrote:
>> >> >
>> >> > Apparently ? Appears to ?
>> >> >
>> >> > When in doubt use Explore or Plot or _Trace ...
>> >> >
>> >> > Plot(Status("FirstVisibleBar"), "FVB", colorWhite);
>> >> > Plot(Status("FirstVisibleBarIndex"), "FVBI", colorYellow);
>> >> > Plot(Status("LastVisibleBar"), "FVB", colorGreen);
>> >> > Plot(Status("LastVisibleBarIndex"), "FVBI", colorRed);
>> >> >
>> >> > --- In
amibroker@yahoogroups.com, "wlandry01" <wlandry01@> wrote:
>> >> > >
>> >> > > Graham,
>> >> > >
>> >> > > I've seen conflicting comments on that point so I
>> >> > > checked the AFL reference for "Status" online.  It shows the
>> >> > > following;
>> >> > >
>> >> > > "firstvisiblebar", "lastvisiblebar", "firstvisiblebarindex",
>> >> > > "lastvisiblebarindex" - return bar number or bar index of
>> >> > > first/last visible bar. Available in indicator mode only.
>> >> > >
>> >> > > I used to think "firstvisiblebar" returned a "1", but it does,
>> >> > > apparently, return the bar number, as the following code
>> >> > > appears to work fine:
>> >> > >
>> >> > > HVC = Highest(ValueWhen(BarIndex() >= Status("FirstVisibleBar")
>> >> > > AND BarIndex() <= Status("LastVisibleBar"), Check));
>> >> > >
>> >> > > If you have more recent information, of if I've misinterpreted
>> >> > > something, please let me know as I've had some difficulty
>> >> > > completely understanding the Status indicators.
>> >> > >
>> >> > > Thanks,
>> >> > >
>> >> > >
>> >> > > Wayne
>> >> > >
>> >> > >
>> >> > >
>> >> > >
>> >> > >
>> >> > >
>> >> > >
>> >> > >
>> >> > >
>> >> > > --- In
amibroker@yahoogroups.com, Graham <kavemanperth@> wrote:
>> >> > > >
>> >> > > > fistrvisiblebar returns a value of 1 on the first bar on
> screen.
>> >> > So you
>> >> > > > would need to use
>> >> > > lastvalue(valuewhen(status("firstvisiblebar"),barindex()))
>> >> > > >
>> >> > > > however I believe there is now status("firstvisiblebarindex")
>> >> > which will
>> >> > > > give you the value of barindex
>> >> > > >
>> >> > > >
>> >> > > >
>> >> > > > --
>> >> > > > Cheers
>> >> > > > Graham
>> >> > > > AB-Write >< Professional AFL Writing Service
>> >> > > > Yes, I write AFL code to your requirements
>> >> > > >
http://e-wire.net.au/~eb_kavan/ab_write.htm
>> >> > > >
>> >> > > > On 01/09/06, wlandry01 <wlandry01@> wrote:
>> >> > > > >
>> >> > > > > Herman,
>> >> > > > >
>> >> > > > > Many thanks to you and all the others who provided input on
>> >> > this.
>> >> > > > > Sorry for the delay in responding but I decided to shut the
>> >> > > > > computer down while waiting for Ernesto to work his way
> through
>> >> > > > > South Florida.
>> >> > > > >
>> >> > > > > In any case, I now have my study working!  I do have a
> question,
>> >> > > > > however, on the code that you listed:
>> >> > > > >
>> >> > > > > Plot(C,"",1,128);
>> >> > > > > SetBarsRequired(1000000,1000000);
>> >> > > > > BlankBarsInRightMargin = 4;
>> >> > > > >
>> >> > > > > Plot(BarIndex()==Status("FirstVisibleBar"),"",5,styleArea|
>> >> > > > > styleOwnScale,-10,10);
>> >> > > > >
>> >> > > > > Plot(BarIndex()==Status("LastVisibleBar")-
>> >> > BlankBarsInRightMargin,"",
>> >> > > > > 4,styleArea|styleOwnScale,-10,10);
>> >> > > > >
>> >> > > > > When I chart this I get a light green line running from
> left to
>> >> > > > > right on the chart.  At the far left there's a small,
> vertical
>> >> > > > > green bar and on the far left there is a red bar.  On the far
>> >> > > > > right of the chart "0.00000" is shown in both red and green.
>> >> > > > > I've discovered that I can "separate" the red and green bars
>> >> > > > > (and lines) by adjusting the minimum and maximum setpoints.
>> >> > > > >
>> >> > > > > I don't understand, however, what generates the green line
>> >> > > > > between the two bars (or the red line, for that matter).
>> >> > > > > The Plot statement seems to call for a plot when BarIndex()
>> >> > > > > is equal to a specific value (the endpoints).  I reset the
>> >> > > > > Plot statement to show BarIndex()>=Status("FirstVisibleBar")
>> >> > > > > and the green bar expands to fill the entire screen,
> which makes
>> >> > > > > sense to me, but I don't see what's generating the line
> in the
>> >> > > > > original code.  Does the Plot statement assume a zero
> value if
>> >> > > > > the statement returns false?
>> >> > > > >
>> >> > > > > Thanks,
>> >> > > > >
>> >> > > > >
>> >> > > > > Wayne
>> >> > > > >
>> >> > > > >
>> >> > > > > --- In
amibroker@yahoogroups.com, Herman <psytek@> wrote:
>> >> > > > > >
>> >> > > > > > Fred, my post did not refer to your code; your code is fine
>> >> > and does
>> >> > > > > > what it is supposed to do. I just outlined some
> problems one
>> >> > may
>> >> > > > > > encounter when working with First/LastVisibleBar.
>> >> > > > > >
>> >> > > > > > The problems I eluded to have all happened to me at one
> time
>> >> > or
>> >> > > another
>> >> > > > > > and resulted in a waste of my time. I use RT however I
> assume
>> >> > the
>> >> > > > > > problems can occur in EOD just the same. The problems can
>> >> > easily be
>> >> > > > > > confirmed by right-justifying your chart, running my code,
>> >> > > > > > adding/removing the SetBarsRequired() and/or changing the
>> >> > number of
>> >> > > > > > Blank bars in Preferences. You will note that
> LastVisibleBar
>> >> > marker
>> >> > > > > > appears and disappears depending on what one might have
>> >> > assumed
>> >> > > to be
>> >> > > > > > unrelated conditions.
>> >> > > > > >
>> >> > > > > > best regards,
>> >> > > > > > herman
>> >> > > > > >
>> >> > > > > > Fred wrote:
>> >> > > > > > > Herman,
>> >> > > > > > >
>> >> > > > > > > While I'd admit that the statement I posted really should
>> >> > take the
>> >> > > > > > > LastValue i.e.
>> >> > > > > > >
>> >> > > > > > > HVC = LastValue(Highest(ValueWhen(BarIndex() >= Status
>> >> > > > > > > ("FirstVisibleBar") AND BarIndex() <=
>> >> > > Status("LastVisibleBar"), C)));
>> >> > > > > > >
>> >> > > > > > > I don't follow the rest of your post ... With or without
>> >> > bars
>> >> > > in the
>> >> > > > > > > right margin I seem to get the correct result when HVC is
>> >> > > plotted ...
>> >> > > > > > >
>> >> > > > > > > Under what conditions do you not get the correct
> result ...
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > > 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 other support material please check also:
>> >> > > > > > >
http://www.amibroker.com/support.html
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > > Yahoo! Groups Links
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > > 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 other support material please check also:
>> >> > > > >
http://www.amibroker.com/support.html
>> >> > > > >
>> >> > > > >
>> >> > > > > Yahoo! Groups Links
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > >
>> >> > >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > 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 other support material please check also:
>> >> >
http://www.amibroker.com/support.html
>> >> >
>> >> >
>> >> > Yahoo! Groups Links
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >>
>> >
>> >
>> >
>> >
>> >
>> >
>> > 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 other support material please check also:
>> >
http://www.amibroker.com/support.html
>> >
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > --
>> > No virus found in this incoming message.
>> > Checked by AVG Free Edition.
>> > Version: 7.1.405 / Virus Database: 268.11.7/435 - Release Date:
> 08/31/06
>> >
>> >
>>
>
>
>
>
>
>
> 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 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/
>
> <*> To unsubscribe from this group, send an email to:
>   
[EMAIL PROTECTED]
>
> <*> Your use of Yahoo! Groups is subject to:
>   
http://docs.yahoo.com/info/terms/

>
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.405 / Virus Database: 268.11.7/435 - Release Date: 08/31/06
>
>
__._,_.___

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 other support material please check also:
http://www.amibroker.com/support.html






SPONSORED LINKS
Software support Small business finance Business finance online
Business finance training Business finance course


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to