Skip to content
Algo Trade Analytics Docs

ta.pivothigh() - Pine Script Function

This function returns price of the pivot high point. It returns ‘NaN’, if there was no pivot high point.

ta.pivothigh(leftbars, rightbars) → series float
NameTypeDescription
leftbarsseries int/floatLeft strength.

Price of the point or ‘NaN’.

  • If parameters ‘leftbars’ or ‘rightbars’ are series you should use max_bars_back function for the ‘source’ variable.
//@version=6
indicator("PivotHigh", overlay=true)
leftBars = input(2)rightBars=input(2)ph = ta.pivothigh(leftBars, rightBars)
plot(ph, style=plot.style_cross, linewidth=3, color= color.red, offset=-rightBars)