talib.IMI
Calculates the Intraday Momentum Index.
talib.IMI(inPriceOC)
talib.IMI(inPriceOC, optInTimePeriod)Examples
Compute the Intraday Momentum Index from the latest K-lines.
javascript
function main() {
var records = exchange.GetRecords()
if (!records) return
var ret = talib.IMI(records)
Log(ret)
}
python
import talib
def main():
records = exchange.GetRecords()
if not records:
return
ret = talib.IMI(records.Open, records.Close)
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 |
inPriceOC |
| Yes | K-line array; the open and close fields are used. In Python, pass |
optInTimePeriod | number | No | Calculation period. Default |
See Also
Remarks
TA-Lib equivalent: IMI(Records[Open,Close],Time Period = 14) = Array(outReal).
Over the last optInTimePeriod bars, the sum of up-bar bodies (Close - Open) as a percentage of the sum of all body lengths, ranging from 0 to 100.
In Python, TA-Lib provides this function from version 0.6 (both the C library and the Python package must be 0.6 or later); older versions raise an attribute error.