talib.highestbars

Locates the highest value of source within the last length bars and returns its position rather than its value. It returns a series int, which makes it the companion to talib.highest.

talib.highestbars(series float source, series int length) → series int
ParameterTypeRequiredDescription
sourceseries floatyesThe series to search.
lengthseries intyesHow many bars the search covers.

Returns series int — A series int giving the offset of the highest bar.

indicator("Offset of the highest high")
plot(talib.highestbars(high, 20))

See also talib.alma · talib.atr · talib.barssince

Part of the function index.

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade