ta.pivothigh()
Pivot High
Returns the price of a pivot high point. It returns NaN if there was no pivot high point.
Syntax
ta.pivothigh(source, leftbars, rightbars) → series floatArguments
| Parameter | Type | Description |
|---|---|---|
| source | series int/float | Series used to detect the pivot (often high). |
| leftbars | series int/float | Bars to the left that must be lower. |
| rightbars | series int/float | Bars 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
//@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.
Related Pine Script Functions
ta.pivotlow() - Pivot Low
Learn how to use ta.pivotlow() in Pine Script. Detect swing low pivot points for support levels.
ta.highest() - Highest Value
Learn how to use ta.highest() in Pine Script. Find the highest value over a lookback period for Donchian Channels.
ta.pivot_point_levels() - Pivot Points
Learn how to use ta.pivot_point_levels() in Pine Script. Calculate traditional pivot point support and resistance levels.
ta.rising() - Rising
Learn how to use ta.rising() in Pine Script. Test if a series is consistently rising over a given period.