UtilityPine Script v6

ta.highest()

Highest Value

Highest value for a given number of bars back.

Syntax

Syntax
ta.highest(source, length) → series float

Arguments

ParameterTypeDescription
sourceseries int/floatSeries to scan.
lengthseries intLookback length.

Returns

Highest value in the series.

Remarks

na values in the source series are ignored.

Code Examples

Pine Script v6 Example
//@version=6
indicator("ta.highest")
plot(ta.highest(high, 20), title="20-bar highest high")

Trading Applications

Find the highest price over a lookback period

Build Donchian Channel indicators

Create breakout detection systems

Calculate relative position within a range

Frequently Asked Questions

Generate ta.highest() Code with AI

Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.highest() and other built-in functions instantly.