Retrieve array value for bar within “From-To” range in an exploration

I run Amibroker exploration using "From-To" range in AA window. To retrieve the last date in the range, SelectedValue( ARRAY ) works fine. How can I get the bar for the dates within the "From-To" range that are not the last date in an exploration? SelectedValue() cannot be used to retrieve the bars for these dates.

https://www.amibroker.com/guide/afl/selectedvalue.html

In AA window 'selected element' means THE LAST BAR of currently selected analysis range. It is the last available bar for "all quotes" and "last n quotes" range. It is the bar corresponding to "End Date" when using "From-To" range.

I am using Amibroker v6.28.0

@thankyou18, I think that you'll benefit studying this sample code that was posted in another thread by @fxshrat:

In particular, focus on the following lines of code and how the variables are subsequently used:

bir     = Status( "BarInRange" );
fbr     = Status( "FirstBarInRange" );
lbr     = Status( "LastBarInRange" );

A search in the forum will also find other threads looking for similar questions.
IMHO it is always a good thing to use it looking for different keywords and sentences.
I use it a lot, and many times it brings me to related subjects, and this helps me to expand my AFL knowledge further.

2 Likes