getValueAbsolute() | Utility Functions |
Returns the value of the specified type at the specified bar index relative to bar 0, regardless of the bar currently being processed.
Syntax
getValueAbsolute( barType [, barIndex ][, numBars ][, Symbol ] )
Parameters
Parameter: Description: Default:
barType Required. String for type of value to retrieve: "open", "high", "low", "close", "time", "rawtime", "volume", "oi", "year", "month", "day", "hour", "minute", "second"
n/a barIndex [Optional] The number for the bar index (or beginning index) to retrieve.
0 numBars [Optional] Total number of bars of data to retrieve.
1 Symbol [Optional] String specifying a symbol to use, which may also include an interval (e.g., "IBM,5").
chart symbol
Return Value(s)
Returns a single value if numBars is not specified or is 1.Returns an array of values if numBars is specified and greater than 1.
Notes
Using getValueAbsolute( "time" ) can be very processor-intensive and, for that reason, its use is not recommended. Instead you should use getValueAbsolute( "rawtime" ) which returns the number of seconds elapsed since 1/1/1970.
Code Examples
function main() { //retrieve the close from bar -10 var myVar = getValueAbsolute(
"close"
,
-10
); //retrieve the rawtime of bar 0 var myVar = getValueAbsolute(
"rawtime"
,
0
); //retrieve 20 high values into an array starting at bar 0 //where the [0] element of myArray contains the high at bar 0. var myArray = getValueAbsolute(
"high"
,
0
,
-20
); // more common method //retrieve 20 high values into an array starting at bar -19 //where the [0] element of myArray contains the high at bar -19. var myArray = getValueAbsolute(
"high"
,
-19
,
20
); // less common method }
See Also
Utility Functions
eSignal Bulletin Board Search Engine
Help Guides and Tutorials