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