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 | Left-side pivot strength: number of bars used before the candidate. |
| rightbars | series int/float | Right-side pivot strength: number of subsequent bars required for detection. |
Returns
Price of the point or NaN.
Remarks
A pivot value is reported rightbars bars after the candidate. The example offsets the drawing back five bars, which does not make the value knowable five bars earlier. A result on the open confirmation bar can still change; wait for its close if required.
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
Draft Pine Script using ta.pivothigh() with Pineify's AI Coding Agent, then review the arguments and test the result on your chart. Usage depends on your plan and available credits.
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. Compare the current value with prior values in a lookback; consecutive increases are not required.