SelectedValue
- retrieves value of the array at currently selected date/time point

Exploration / Indicators
(AmiBroker 4.10)


SYNTAX SelectedValue( ARRAY )
RETURNS NUMBER
FUNCTION Retrieves array value at currently selected bar. Main purpose: commentary and interpreration code.
EXAMPLE selectedvalue( close )
SEE ALSO  

Comments:

Tomasz Janeczko
tj --at-- amibroker.com
2003-05-11 06:02:38
SelectedValue(array) is a function that retrieves 'selected element' of the array.
Since 'selection line' is available only for CHARTS. SelectedValue gives
the value of array at bar that is currently selected in chart by vertical line.
This is how it works in INDICATORS, INTERPRETATION and CHART COMMENTARY
(because they are relative to selected bar)

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 the bar corresponding to "End Date" when using "From-To" range.

So if you choose range: "all quotes" in AA
SelectedValue function is equivalent to

array[ BarCount - 1 ]

References:

The SelectedValue function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.