getValueAbsolute()

eSignal EFS 2

getValueAbsolute()

Top  Previous  Next

 

getValueAbsolute( barType, barIndex [, numBars] [, symbol] )

 

Returns the value of the specified type at the specified bar index relative to the most recent bar in the series, regardless of the bar currently being processed.

 

Parameters

 

barType

type of value to retrieve: "open", "high", "low", "close", "time", "rawtime", "volume", "oi", "year", "month", "day", "hour", "minute", "second"

barIndex

bar index of series to retrieve

numBars

optional. number of bars of data to return

symbol

optional. specify a symbol to use

 

Note: using getValue( "time" ) can be very processor-intensive and, for that reason, its use is not recommended. Instead you should use getValue( "rawtime" ) which returns the number of seconds elapsed since 1/1/1970, or the getYear(), getMonth(), getDay(), getHour(), getMinute(), getSecond() functions.

 

Usage

 

function main() {

 

       ...

       ...

       //retrieve the close from 10 bars ago

       myVar = getValueAbsolute( "close", -10 );

       //retrieve the rawtime of the current bar

       myVar = getValueAbsolute( "rawtime", 0 );

       //retrieve the 20 most recent high values into an array

       myArray = getValueAbsolute( "high", 0, -20 );

 

 

}