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
Parameters
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 = midpoint(10); //create a Series Object of the midpoint low price. var xSeries = midpoint(10, low()); //create a Series Object of the midpoint low price of IBM. var xSeries = midpoint(10, low(sym("IBM"))); //create a Series Object of the midpoint low price from 15 min interval. var xSeries = midpoint(10, low(inv(15))); //create a Series Object of the midpoint value from sma(20). var xSeries = midpoint(10, sma(20)); //retrieve a single value for the current bar. var nValue_0 = midpoint(10, 0); //retrieve a single value for the previous bar. var nValue_1 = midpoint(10, -1); }
See Also
Series Functions
eSignal Bulletin Board Search Engine
Help Guides and Tutorials