The talib.MIDPOINT()
function is used to calculate the MidPoint over period (midpoint).
The return value of the talib.MIDPOINT()
function is a one-dimensional array.
array
talib.MIDPOINT(inReal) talib.MIDPOINT(inReal, optInTimePeriod)
The inReal
parameter is used to specify the K-line data.
inReal
true
{@struct/Record Record} structure arrays, numeric arrays
The optInTimePeriod
parameter is used to set the period, the default value is 14.
optInTimePeriod
false
number
function main() {
var records = exchange.GetRecords()
var ret = talib.MIDPOINT(records)
Log(ret)
}
import talib
def main():
records = exchange.GetRecords()
ret = talib.MIDPOINT(records.Close)
Log(ret)
void main() {
auto records = exchange.GetRecords();
auto ret = talib.MIDPOINT(records);
Log(ret);
}
The MIDPOINT()
function is described in the talib library documentation as: MIDPOINT(Records[Close],Time Period = 14) = Array(outReal)