PureBytes Links
Trading Reference Links
|
>From AmiBroker help file:
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 ];
rollyzhang@xxxxxxxxxxx
2007-11-03 14:12:22 BarIndex() returns an array and LastValue()
returns a number. The API's example compares the two to give the
boolean ThisIsLastBar. How could an array be compared with a number?
How could it work? Please explain.
Tomasz Janeczko
tj at amibroker dot com
2007-11-04 09:14:21 That's simple - it compares each array element to
a number and produces array as a result. Detailed explanation in
User's Guide: Tutorial: Understanding AFL
--- In amibroker@xxxxxxxxxxxxxxx, "af_1000000" <af_1000000@xxx> wrote:
>
> The following simple code works only ones, when I double click on
the
> indicator (called TEST). The plot is perfect.
>
> bi = BarIndex();
> dt_array = DateTime();
> Trade_dt=dt_array[SelectedValue(bi)];
> Trade_dt_text = DateTimeToStr(Trade_dt);
>
> Trade_flag = IIf(dt_array == Trade_dt,1,0);
> Plot(Trade_flag,"F",colorRed);
>
> The moment I click on the chart or indicator (refresh) there is an
error:
> Error 10
> Substrict out of range.
> You must not access array elements outside 0..(Barcount -1) range.
> Error is at Trade_dt_text .....
>
> I know how to fix it. Just insert in the very beginning
> SetBarsRequired(100000,0);, but that's not the point.
>
> 1.Why does it work the first time , but not the second and the
> following refreshes ?
> 2.There is a price to pay for it. Execution time increases
> dramatically. The SelectedValue is almost in every case at the very
> end of the chart. Quick AFL should cover such cases, but it seems
that
> DateTime() is excluded from quick AFL. Is it true?
>
> I will appreciate some explanation, so I can write more efficient
> software. Thank you in advance.
>
> AF
>
------------------------------------
**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
*********************
TO GET TECHNICAL 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/
|