EndValue
- value of the array at the end of the selected range

Date/Time
(AFL 2.3)


SYNTAX EndValue( ARRAY )
RETURNS NUMBER
FUNCTION This function gives the single value (number) of the ARRAY at the end of the selected range. If no range is marked then the value at the last bar is returned.

To select the range you have to double click in the chart at the beginning of the range and then double click in the chart at the end of the range. Then > < markers will appear above date axis.

EXAMPLE 1. Simple commentary:

WriteVal( BeginValue( DateTime() ), formatDateTime );
WriteVal( EndValue( DateTime() ), formatDateTime );
"Precentage change of close is " +
WriteVal( 100 * (EndValue( Close ) - BeginValue( Close ))/BeginValue( Close ) ) + "%";

2. Get the number of bars in the range and calculate some stats for that range:

Period = EndValue( BarIndex() ) - BeginValue( BarIndex() );
StandardDeviationInTheRange = EndValue( StDev( Close, Period ) );

SEE ALSO BEGINVALUE() function

References:

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

More information:

Updated on-line reference