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
Draft Pine Script using ta.lowestbars() 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.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.