ta.highest()
Highest Value
Highest value for a given number of bars back.
Syntax
ta.highest(source, length) → series floatArguments
| Parameter | Type | Description |
|---|---|---|
| source | series int/float | Series to scan. |
| length | series int | Lookback length. |
Returns
Highest value in the series.
Remarks
na values in the source series are ignored.
Code Examples
//@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
Related Functions
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.
Related Pine Script Functions
ta.lowest() - Lowest Value
Learn how to use ta.lowest() in Pine Script. Find the lowest value over a lookback period.
ta.lowestbars() - Lowest Bars Offset
Learn how to use ta.lowestbars() in Pine Script. Find how many bars ago the lowest value occurred.
ta.valuewhen() - Value When
Learn how to use ta.valuewhen() in Pine Script. Get the value of a series when a condition was true.
ta.barssince() - Bars Since
Learn how to use ta.barssince() in Pine Script. Count bars since a condition was last true.