The talib.MIDPRICE()
function is used to calculate the Midpoint Price over period (midpoint price).
The return value of the talib.MIDPRICE()
function is a one-dimensional array.
array
talib.MIDPRICE(inPriceHL) talib.MIDPRICE(inPriceHL, optInTimePeriod)
The inPriceHL
parameter is used to specify the K-line data.
inPriceHL
true
{@struct/Record Record} structure array
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.MIDPRICE(records)
Log(ret)
}
import talib
def main():
records = exchange.GetRecords()
ret = talib.MIDPRICE(records.High, records.Low)
Log(ret)
void main() {
auto records = exchange.GetRecords();
auto ret = talib.MIDPRICE(records);
Log(ret);
}
The MIDPRICE()
function is described in the talib library documentation as: MIDPRICE(Records[High,Low],Time Period = 14) = Array(outReal)