ohlc4()
Previous Top Next
Return Value(s)
Notes
Code Examples
See Also
Previous Top Next
The ohlc4() function creates a series based on (open+high+low+close)/4 or retrieves individual (open+high+low+close)/4 values.
Syntax
ohlc4( [ nBarIndex][, sym() | inv()] )
Parameters
Parameter: | Description: | Default: |
nBarIndex | [Optional] Number of bar index of series to retrieve
|
n/a |
sym() or inv() | [Optional] Function of sym() or inv() to determine source for close values.
|
n/a |
Return Value(s)
Returns a Series Object when nBarIndex is not specified.
Returns a single price value when nBarIndex is specified.
Notes
N/A
Code Examples
function main() {
//retrieve the value for the current price bar
myVar = ohlc4(
0
)
;
//retrieve the value for the previous price bar
myVar = ohlc4(
-1
)
;
//retrieve the current value for a specific symbol
myVar =ohlc4
(
0
,
sym("IBM")
)
;
//retrieve the current value for a specific symbol/interval
myVar =ohlc4
(
0
,
sym("IBM,5")
)
;
//retrieve the current value for a specific bar interval
myVar =ohlc4
(
0
,
inv(15)
)
;
//create a Series Object of the (open+high+low+close)/4 prices.
xSeries =ohlc4
()
;
//create a Series Object of the (open+high+low+close)/4 prices for a specific symbol.
xSeries = ohlc4(
sym("IBM")
)
;
//create a Series Object of the (open+high+low+close)/4 prices for a specific symbol/interval.
xSeries =ohlc4
(
sym("IBM,5")
)
;
//create a Series Object of the (open+high+low+close)/4 prices for a specific interval.
xSeries = ohlc4(
inv(15)
)
;
}
See Also