Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
TA
Talib
Overlap Studies
Momentum Indicators
Volume Indicators
Volatility Indicators
Cycle Indicators
Price Transform
Statistic Functions
Math Transform
Math Operators
Pattern Recognition
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

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

TypeDescription

numeric array

Indicator values, the same length as the input; the leading values without enough data are NaN.

Arguments

NameTypeRequiredDescription

inPriceOC

Record array

Yes

K-line array; the open and close fields are used. In Python, pass records.Open, records.Close in this order.

optInTimePeriod

number

No

Calculation period. Default 14.

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.