Hello,
Thank you very much for your e-mail.
As written in the article, you should not make assumptions on how many bars you
get because different symbols may use different counts.
AFL editor for "Syntax Check" uses not more than 200 bars for two reasons:
1. To catch coding mistakes exactly like this one, i.e. making assumptions on number of bars
2. To make syntax checks faster for very complex formulas
Best regards,
Tomasz Janeczko
amibroker.com
The last line triggers the error ONLY from the Editor. Makes sense if inthe editor the barcount is only 200.In my code I use something like:Thank you for the link TJ.I think this answers my question:
"during AFL Editor's Verify Syntax not more than 200 most recent bars are used"
SetBarsRequired( -2, -2 );
.....
AbsBarcount = Status( "quickaflfirstdatabar" ) + BarCount;
.....
TFdatetime[AbsBarCount - 1] =
On Mon, Apr 25, 2016 at 9:21 AM, Tomasz Janeczko groups@amibroker.com [amibroker] <amibroker@yahoogroups.com> wrote:
Hello,
"I am pretty sure my indexes are not out of range"
If program says it is out of range you can be 100% sure that it really *is* out of range.
As always everything is covered by documentation:
http://www.amibroker.com/kb/2014/09/22/do-not-make-assumptions-on-number-of-bars/
Best regards,
Tomasz Janeczko
amibroker.com
HelloHere is a typical error message I get:
I am having "Error 10" (subscript out of range), but I am pretty sure my indexes are not out of range. The problems occurs only in the editor, when I click the Apply button. The script runs without any problems and produces correct results when I run it normally.
Error 10. Array subscript out of range. You must not access array elements outside 0..(BarCount-1) range. You attempted to access non-existing 11454-th element of array.
However the BARCOUNT is 11491 (bigger than 11457).
I checked this guide and it is definetely not my case:
http://www.amibroker.com/guide/errors/10.html
I assume it is some setting in the editor or cache that I need to set? I searched all of them and increased them to over 20.000.
Posted by: Tomasz Janeczko <groups@amibroker.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (5) |
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/
EmoticonEmoticon