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

Re: [amibroker] AFL out of bounds error?



PureBytes Links

Trading Reference Links

Hi Marty,

Would it be possible for you to post the code as it stands. Your code
is attempting to access an array element which is currently not within
the bounds of the array.



Regards,
William Peters
http://www.amitools.com




Sunday, October 9, 2005, 2:28:48 PM, you wrote:
m>    Hi,

m>  Last week I asked how AFL runs with real time data coming in.  I
m>  assumed that every time a new piece of data is obtained that the
m>  entire AFL program runs from the first line to the last.  But
m>  something else seems to be happening.

m>  I have an AFL program that determines Swing Highs and Lows.  Most of
m>  the programming uses array processing.  But I needed to use a for loop
m>  through the array to find where multiple swing highs occurred without
m>  a swing low between them. I then modify the array to only keep the
m>  highest swing high or the last swing high if the highs are equal.  I
m>  am using BarIndex() to identify the bars on which the swing highs occur. 

m>  The program works fine the first time I drop it on the chart.  But
m>  then, if I click to select a bar on the chart, I get an error that
m>  array subscript is out of bounds.

m>  If the program is running from the first line to the last line every
m>  time there is new data (or when I select a bar on the chart), then
m>  this would not be possible.  So something else must be going on where
m>  only a portion of the code is being executed.

m>  It seems that this might have something to do with QuickAFL mentioned
m>  on the BarIndex() help screen, but I could not find any information
m>  about QuickAFL or what is necessary to work around it.

m>  How exactly does QuickAFL work if that is what is my problem?  Are
m>  only some parts of the AFL program being run while other parts are
m>  ignored/skipped because the values are thought to not have changed?
m>  Does QuickAFL affect both array and loop processing?

m>  Any other tips or thoughts that I need to consider?

m>  Thank-you,

m>  Marty.








------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/