Sidechair

ta.pivotlow()

Browse the reference

Returns the price of a pivot low once rightbars bars have confirmed it, otherwise na.

Try it in the editor

ta.pivotlow reports a swing low: a value that is the lowest across leftbars bars to its left and rightbars bars to its right. The pivot bar is rightbars bars in the past, so the value arrives that many bars after the trough.

A bar to the left may equal the pivot's value, but each of the rightbars newer bars must be strictly higher. With two arguments the source is low.

Syntax

Pine Script
ta.pivotlow(leftbars: series int/float, rightbars: series int/float) -> series float
ta.pivotlow(source: series int/float, leftbars: series int/float, rightbars: series int/float) -> series float

Arguments

NameTypeDefaultDescription
leftbarsseries int/floatrequiredNumber of bars to the left that must not be below the pivot. A whole number of 0 or more.
rightbarsseries int/floatrequiredNumber of bars to the right that must be higher. A whole number of 0 or more.
sourceseries int/floatrequiredSeries searched for pivots. Omit it, passing only the two counts, to use low.

Returns

series float: the pivot's value on the confirming bar, otherwise na.

Remarks

  • The value arrives on the confirming bar. Draw at bar_index - rightbars or plot with offset = -rightbars to line it up with the trough.

Example

Pine ScriptMark swing lows below the barsOpen in editor
//@version=6
indicator("Swing lows", overlay = true)
pl = ta.pivotlow(low, 4, 4)
plotchar(not na(pl), "Pivot low", "▲", location.belowbar, color.green, offset = -4, size = size.small)

See also

Runs on Sidechair