BeginValue
- Value of the array at the begin of the range

Date/Time
(AmiBroker 4.30)


SYNTAX BeginValue( ARRAY )
RETURNS NUMBER
FUNCTION This function gives the single value (number) of the ARRAY at the beginning of the selected range. If no range is marked then the value at the first 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 ENDVALUE() function

References:

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

More information:

See updated/extended version on-line.