# midpoint()

ICE Data Services -

 midpoint() Series Functions

The midpoint() function is used to create a Series Object of the midpoint value found in a series within a specified number of bars. It is implemented as ( highest value found + lowest value found ) divided by 2.

Syntax
midpoint(  nLength [, Series | sym() | inv() ][, nBarIndex ] )

Parameters
Parameter: Description: Default:
nLength Required. Number of periods to use for calculation.

n/a Series or
sym() or
inv()
[Optional]  Series Object or function of sym() or inv() to determine symbol/interval source for the study.

Chart's sym/inv nBarIndex [Optional]  Bar index of series to retrieve. See Notes.

n/a

Return Value(s)

Returns a Series Object when nBarIndex is not specified.

Returns a single value when nBarIndex is specified.

Notes
The nBarIndex parameter is available only starting with version 10.5

Code Examples
 ``function main() { //create a Series Object of the midpoint close price. var xSeries = ``mid``point(``10``)``;`` ` //create a Series Object of the midpoint low price. var xSeries = ``mid``point(``10``, ``low()``)``;`
``	//create a Series Object of the midpoint low price of IBM. 	var xSeries = ``mid``point(``10``, ``low(sym("IBM"))``)``;``
``	//create a Series Object of the midpoint low price from 15 min interval. 	var xSeries = ``mid``point(``10``, ``low(inv(15))``)``;``
``	//create a Series Object of the midpoint value from sma(20). 	var xSeries = ``mid``point(``10``, ``sma(20)``)``;``
``	//retrieve a single value for the current bar. 	var nValue_0 = ``mid``point(``10``, ``0``)``;``
``	//retrieve a single value for the previous bar. 	var nValue_1 = ``mid``point(``10``, ``-1``)``;``
``}``