Lowest Indicator Pine Script — Complete TradingView Guide
The Lowest indicator in Pine Script uses the built-in ta.lowest(source, length) function to track the minimum value of a price series over a rolling lookback window. Applied to the low series, it plots the lowest low over the last N bars as a continuous line on your TradingView chart — making it the foundational building block for Donchian Channel lower bands, dynamic support overlays, and stop-loss reference levels. The Lowest indicator works on all asset classes (stocks, crypto, forex, futures) and all timeframes from 1-minute to weekly charts. Paired with ta.highest(), it forms the complete Donchian Channel used in the classic Turtle Trading system. This guide covers the complete Pine Script v6 implementation, all configurable parameters, three concrete trading strategies, and step-by-step instructions for generating it instantly with Pineify.
What Is the Lowest Indicator?
The Lowest indicator is a range-tracking overlay that continuously plots the minimum price value over a user-defined lookback period. Unlike momentum oscillators such as RSI or Stochastic that measure rate-of-change, the Lowest indicator answers one precise question: "What is the trough value within the last N bars?" This makes it fundamentally different from smoothing tools like moving averages, which average values and obscure the actual low-water mark.
In Pine Script v6, the Lowest indicator is implemented via the built-in function ta.lowest(source, length). The function scans the most recent length bars of source, ignores na values, and returns the single smallest number found. The result is a series float that updates on every bar, creating a dynamic support boundary on the chart.
Formula: Lowest[t] = min(source[t], source[t-1], ..., source[t-length+1]), where t is the current bar index. The result is the minimum across the entire window of length bars.
The concept behind the Lowest indicator originates from channel-based trading theory, most famously applied by Richard Dennis and William Eckhardt in the Turtle Trading experiment of 1983. Their system used the 20-bar lowest low as the lower band of the Donchian Channel — serving as both a trend-exit signal and a dynamic trailing stop. Today the same logic underpins dozens of breakout, mean-reversion, and volatility-contraction strategies across all markets.
The Lowest indicator applies to virtually every liquid market. In equities, the 52-week lowest low (length=252 on daily charts) marks critical support zones that institutional traders monitor. In crypto, short lookback periods (5–14 bars) on 15-minute charts capture rapid swing lows. In forex and futures, the indicator is widely used on 4H and daily charts to set stop-loss levels below recent structure lows.
The best timeframes depend on your trading style. For scalping, use 1m–5m charts with a length of 5–10. For day trading, 15m–1H charts with length 14–20 balance noise and responsiveness. For swing trading, 4H and daily charts with length 20–55 mirror the classic Donchian Channel periods. For position trading, daily and weekly charts with length 52–252 track major support floors.
Best Markets
Stocks · Crypto · Forex · Futures
Best Timeframes
15m, 1H, 4H, Daily
Overlay
Yes — plots directly on price chart
Lowest Indicator Pine Script Code
The code below plots the 5-bar lowest low as a red line overlaid directly on the price chart. Copy it, open the TradingView Pine Script editor (Alt+P), paste it in, and click Add to chart. Change the 5 in ta.lowest(low, 5) to any lookback period that fits your strategy — 20 for a Donchian Channel, 14 for intraday support tracking.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Pineify
//@version=6
indicator(title="Lowest", overlay=true, max_labels_count=500)
// Returns the lowest low over the last 5 bars
p_ind_1 = ta.lowest(low, 5)
// Plot the result on the chart
plot(p_ind_1, "Lowest", color.rgb(242, 54, 69, 0), 1)Chart Preview

Parameters
| Parameter | Default Value | Description | Recommended Range |
|---|---|---|---|
| source | low | The series to scan for the minimum. Any numeric series: low, close, or a calculated value. | Any numeric series |
| length | 5 (in example) | Number of bars in the lookback window. Larger values produce a smoother, slower-moving support line. Smaller values react faster to recent lows. | 5–252 depending on style |
Tuning Guide by Trading Style
- Scalping (1m–5m charts): length 5–10 — captures intraday swing lows with fast response
- Day trading (15m–1H charts): length 14–20 — balances noise reduction with timely support signals
- Swing trading (4H–Daily charts): length 20–55 — the classic Turtle Trading channel lengths for exit/stop placement
- Position trading (Daily–Weekly charts): length 52–252 — tracks the 52-week low for major support zones
Trading Strategies Using the Lowest Indicator
The Lowest indicator is most effective as a dynamic support level or stop-loss reference. Below are three concrete strategies with specific entry and exit conditions.
Strategy 1 — Donchian Channel Support Bounce
Market environment: trending markets · Best timeframe: Daily, 4H
The Donchian Channel lower band, defined by ta.lowest(low, 20), forms the exit level in the classic Turtle Trading system developed by Richard Dennis and William Eckhardt in 1983. Pair it with ta.highest(high, 20) to form the complete channel.
- Calculate the 20-bar lowest low:
lower = ta.lowest(low, 20)[1](use [1] offset to avoid repainting) - Calculate the 20-bar highest high:
upper = ta.highest(high, 20)[1] - Long entry: close crosses above
upper(breakout confirmation) - Stop loss: place initial stop at
lower— the 20-bar lowest low - Exit: close crosses below the 10-bar lowest low
ta.lowest(low, 10)[1]
Strategy 2 — 52-Week Low Reversal Watch
Market environment: oversold / recovery · Best timeframe: Daily, Weekly
When price approaches the 52-week lowest low and shows a bullish reversal candle with increasing volume, it may signal a major capitulation low. Combine with RSI(14) to confirm oversold conditions.
- Calculate the 252-day lowest low:
yearly_low = ta.lowest(low, 252)[1] - Watch zone: price within 2% of yearly_low (
low < yearly_low * 1.02) - Confirm oversold with RSI(14) below 30:
ta.rsi(close, 14) < 30 - Entry signal: bullish engulfing or hammer candle forms at the support zone with above-average volume
- Stop loss: below the yearly_low; target the 20-day SMA
Strategy 3 — Lowest Low + ATR Trailing Stop
Market environment: trending markets · Best timeframe: 1H, 4H
Combine ta.lowest(low, 14) with ta.atr(14) to create a volatility-adjusted trailing stop that tightens automatically as price rises.
- Calculate the 14-bar lowest low:
support = ta.lowest(low, 14)[1] - Calculate ATR(14):
atr = ta.atr(14) - Long entry: close > ta.highest(high, 14)[1] (breakout above 14-bar high)
- Trailing stop:
stop = math.max(support, close - 2 * atr)— whichever is higher protects more profit - Exit: close crosses below the trailing stop level
Disclaimer: The strategies above are for educational purposes only and do not constitute investment advice. Past performance does not guarantee future results. Always apply proper risk management and position sizing.
How to Generate the Lowest Indicator in Pineify
- 1
Open Pineify
Go to pineify.app and sign in — a free account gives you immediate access to the AI Coding Agent.
- 2
Click "New Indicator"
Select "Indicator" as the script type from the creation menu on the dashboard.
- 3
Describe the indicator you want
Type a prompt such as: "Plot the 20-bar lowest low as a red overlay line on the price chart." Pineify's AI Coding Agent generates the complete Pine Script v6 code including ta.lowest() in seconds.
- 4
Copy to TradingView
Click "Copy to TradingView" to copy the generated code, then paste it into the TradingView Pine Script editor (Alt+P) and click "Add to chart".
- 5
Adjust the length parameter
In the TradingView indicator settings panel, change the lookback length to match your trading style — 5 for scalping, 20 for Donchian Channel, 55 for Turtle Trading — no code editing required.
Frequently Asked Questions
Related Pine Script Indicators
Highest Indicator
Track the maximum value over a rolling lookback window
EMA Indicator
Exponential Moving Average for trend and momentum
MA Indicator
Moving Average overlay for trend identification
MA Crossover Indicator
Dual moving average crossover for entry and exit signals
HAS Indicator
Heikin Ashi Smoothed for trend filtering
Build Your Lowest Indicator in Seconds
Skip the manual coding. Pineify's AI Coding Agent generates complete, ready-to-use Pine Script indicators — including ta.lowest() support and Donchian Channel strategies — instantly for free.
Try Pineify Free