Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
talib.MIDPRICE
Calculates the Midpoint Price over Period.
talib.MIDPRICE(inPriceHL)
talib.MIDPRICE(inPriceHL, optInTimePeriod)Examples
Compute the Midpoint Price over Period from the latest K-lines.
javascript
function main() {
var records = exchange.GetRecords()
if (!records) return
var ret = talib.MIDPRICE(records)
Log(ret)
}
python
import talib
def main():
records = exchange.GetRecords()
if not records:
return
ret = talib.MIDPRICE(records.High, records.Low)
Log(ret)Returns
| Type | Description |
numeric array | Indicator values, the same length as the input; the leading values without enough data are |
Arguments
| Name | Type | Required | Description |
inPriceHL |
| Yes | K-line array; the high and low fields are used. In Python, pass |
optInTimePeriod | number | No | Calculation period. Default |
See Also
Remarks
TA-Lib equivalent: MIDPRICE(Records[High,Low],Time Period = 14) = Array(outReal).