ta.lowestbars()
Lowest Value Offset
Lowest value offset for a given number of bars back.
Syntax
ta.lowestbars(source, length) → series intArguments
| Parameter | Type | Description |
|---|---|---|
| source | series int/float | Series to scan. |
| length | series int | Lookback length. |
Returns
Offset to the lowest bar.
Remarks
na values in the source series are ignored.
Code Examples
//@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
Related Functions
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.
Related Pine Script Functions
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.lowest() - Lowest Value
Learn how to use ta.lowest() in Pine Script. Find the lowest value over a lookback period.
ta.barssince() - Bars Since
Learn how to use ta.barssince() in Pine Script. Count bars since a condition was last true.
ta.valuewhen() - Value When
Learn how to use ta.valuewhen() in Pine Script. Get the value of a series when a condition was true.