Range & PivotPine Script v6

ta.pivothigh()

Pivot High

Returns the price of a pivot high point. It returns NaN if there was no pivot high point.

Syntax

Syntax
ta.pivothigh(source, leftbars, rightbars) → series float

Arguments

ParameterTypeDescription
sourceseries int/floatSeries used to detect the pivot (often high).
leftbarsseries int/floatBars to the left that must be lower.
rightbarsseries int/floatBars to the right that must be lower.

Returns

Price of the point or NaN.

Remarks

A pivot is confirmed only after rightbars complete; most historical bars return na until the pattern validates.

Code Examples

Pine Script v6 Example
//@version=6
indicator("pivothigh", overlay=true)
plot(ta.pivothigh(high, 5, 5), style=plot.style_circles, offset=-5)

Trading Applications

Identify swing high points for resistance levels

Build support/resistance detection systems

Create trendline drawing algorithms

Use for chart pattern recognition

Related Functions

Frequently Asked Questions

Generate ta.pivothigh() Code with AI

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