If you use Quick-AFL, i.e., if you are NOT using the SetBarsRequired() the barcount will change depending on your amount of zooming. If you need the absolute number of bars (zero based) then you should use LastValue(BarIndex(). Note that barcount starts with "1" while barindex starts with "0". Play with this code to see how it works:
Plot(C,"",1,128);
//SetBarsRequired(1000000,1000);
Title = "\n"+
" BarCount: "+(BarCount-1)+"\n"+
"Last BarIndex: "+LastValue(BarIndex())+"\n";
UnComment the SetBarsRequired() to se how things change.
best regards,
herman
For tips on developing Real-Time Auto-Trading systems visit:
http://www.amibroker.org/userkb/
Sunday, January 13, 2008, 7:49:03 PM, you wrote:
> BarCount is a single value that indicates the total number of bars
> available for the current stock. It will likely change from stock to
> stock.
> If you change nNumBarsToScan to BarCount-1, then assuming curBar is
> valid bar index, the loop will only run once when curBar = BarCount-1.
> I don't know what the rest of the code is doing, but that would make
> curBar a fairly redundant variable.
> Regards,
> GP
> --- In amibroker@xxxxxxxxxxxxxxx, "mytakeismine" <mytakeismine@xxx> wrote:
>> Hi, need a little help or an explanation.
>> While using one of the Zig Zag afl's (GordonWrose)in the AA explorer I
>> wasn't getting what I wanted when I realized that I was only looking
>> at 120 days?
>> nNumBarsToScan = 120;
>> if (curBar >= nNumBarsToScan ) {
>> for (i=0; i<nNumBarsToScan; i++) {
>> So I switched the 120 with " barcount - 1 " Wouldn't that be a fixed
>> number and not an array?
> 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
__,_._,___
|