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

[amibroker] Re: SetBarsRequired()...?



PureBytes Links

Trading Reference Links

Steve,

Thanks for your response. Very helpful.
I have seen the term 'Quick AFL' banded around and never really known
what it was... So is there a way to turn Quick AFL on/off...? Or is
SetBarsRequired() THE way to do so...??

To give a little more info... I only notice the bar on which the cross
occurs change when it's at the LEFT most edge of the window. i.e. it's
just about to go out of view... to me that is no coincidence and does
point the finger at it not having enough bars perhaps to calculate
correctly. Maybe.

If I run a check on the code without SetBarsRequired() defined it says
it requires 35 bars to calc correctly. However, if I
SetBarsRequired(50,0) of course the check now says it needs 55 bars...
and if I replot the indicator then I no longer see the problem on the
LHS of the screen.

I think that's pretty conclusive that this is the problem.

Steve, as an aside... what is defined as 'script'...?? Do for..next
loops (which are now natively supported in AFL) count as script...?

If so, I guess one has to be careful when using for...next loops of
any kind...??

Thanks for your help.

--- In amibroker@xxxxxxxxxxxxxxx, "Steve Dugas" <sjdugas@xxx> wrote:
>
> Hi - Probably best to start at the beginning. TJ invented QuickAFL
to reduce 
> the time it takes charting code to execute. It is turned on by
default in 
> charting ( AA does not currently use it ). It works by creating smaller 
> arrays from your full arrays and operating on them instead. The smaller 
> arrays consist of the bars you can see plus some number of bars
immediately 
> preceding them which are used to "initialize" the arrays so correct
values 
> are achieved by the time they reach the first visible bar. But certain 
> applications/formulas need to use more bars so TJ provided
SetBarsRequired() 
> so you can specify more bars if you need to. As a practical matter,
I think 
> most people use it to just "shut off" QuickAFL by using numbers
larger than 
> the size of their entire array, then AB will just use all bars. So
yes it 
> will slow down code execution as it defeats the purpose that
QuickAFL was 
> invented for.
> 
> Re crosses changing bars, I don't think that should happen, I would
guess it 
> probably means you are not using enough bars. Tough to know what is 
> happening without your code, and not sure I would know what is
happening 
> behind the scene even if I did have it. You could try playing around
with 
> different values to see what happens...
> 
> Steve
> 
> ----- Original Message ----- 
> From: "sidhartha70" <sidhartha70@xxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Wednesday, June 04, 2008 2:10 PM
> Subject: [amibroker] SetBarsRequired()...?
> 
> 
> > Hi All,
> >
> > I'm a little confused about the use of SetBarsRquired()... How do I
> > know specifically when I need to use it...? And How do I know how many
> > bars to specify IF I do need to use it...??
> >
> > Also, doesn't it really very significantly slow code execution
> > down...? From my experimentation, it seems to.
> >
> > I currently have some indicators plotting (e.g. fast and slow lines
> > crossing) and the exact bar on which a cross occurs seems to move as I
> > scroll backwards and forwards along a chart....
> >
> > Any ideas...?
> >
> >
> > ------------------------------------
> >
> > 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
> >
> >
> >
> >
>



------------------------------------

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/