UtilityPine Script v6

ta.lowestbars()

Lowest Value Offset

Lowest value offset for a given number of bars back.

Syntax

Syntax
ta.lowestbars(source, length) → series int

Arguments

ParameterTypeDescription
sourceseries int/floatSeries to scan.
lengthseries intLookback length.

Returns

Offset to the lowest bar.

Remarks

na values in the source series are ignored.

Code Examples

Pine Script v6 Example
//@version=6
indicator("ta.lowestbars")
lb = ta.lowestbars(low, 20)
plot(lb, title="Bars since 20-bar low")

Trading Applications

Find how many bars ago the lowest value occurred

Build time-based support detection

Detect aging lows for potential bounces

Use in swing low identification

Frequently Asked Questions

Generate ta.lowestbars() Code with AI

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