Lipi Reference Lipi

Functions

talib.highestbars()

Highest value offset for a given number of bars back

Syntax

                talib.highestbars(series float source, series int length) → series int
              

Arguments

source required series float Series of values to process.
length required series int Number of bars (length).

Return Type

series int

Example


          indicator("Highest Bars Example", overlay=true)
// Define input source and period
src = high
length = 20
// Compute the number of bars ago the highest value occurred
bars_since_highest = talib.highestbars(src, length)
// Mark the highest point with a plot shape
plotshape(bars_since_highest == 0, location=location.abovebar, color=color.green, shape=shape.circle, title="Highest")