talib.MAXINDEX
Calculates the Index of Highest Value over a Specified Period.
talib.MAXINDEX(inReal)
talib.MAXINDEX(inReal, optInTimePeriod)Examples
Find the index of the highest close over the last 5 K-lines.
javascript
function main() {
var records = exchange.GetRecords()
if (!records) return
var ret = talib.MAXINDEX(records, 5)
Log(ret)
}
python
import talib
def main():
records = exchange.GetRecords()
if not records:
return
ret = talib.MAXINDEX(records.Close, 5)
Log(ret)Returns
| Type | Description |
numeric array | Indexes of the highest value within each period. |
Arguments
| Name | Type | Required | Description |
inReal |
| Yes | K-line array (close prices are used) or numeric array; in Python, pass a numeric array such as |
optInTimePeriod | number | No | Calculation period. Default |
See Also
Remarks
TA-Lib equivalent: MAXINDEX(Records[Close],Time Period = 30) = Array(outInteger).