OPEN-SOURCE SCRIPT
已更新 Swing Low Stop Loss Levels

Swing Low Stop Loss Levels plots volatility-adjusted stop loss levels below the most recent confirmed swing lows, so you can see at a glance where a structure-based stop for a long position would sit.
HOW IT WORKS
A swing low is a candle whose low is lower than the lows of the N candles on each side of it. Once a swing low is confirmed, the indicator draws a line below it at:
Stop level = Swing low − (ATR × multiplier)
The ATR value is taken from the swing low candle itself, so each level is fixed at the moment it forms and does not drift as volatility changes afterward. Each line starts at its swing low, runs to the current candle, and is labeled with its price.
The indicator keeps only the most recent swing lows (3 by default). When a new swing low is confirmed, the oldest level is removed.
SETTINGS
Swing detection
- N (candles on each side): how many candles on both sides must have higher lows. Higher values find more significant swings; lower values find more frequent, minor swings.
- Number of swing lows to show: how many recent stop levels are displayed.
ATR buffer
- ATR length: the ATR calculation period (default 14).
- ATR multiplier: how far below the swing low the stop is placed, in ATR units (default 0.25).
Style
- Line color, line style (Solid, Dashed, Dotted), and line width.
- Show price labels: displays the stop price next to each line.
- Remove a level once price closes below it: optionally clears levels that have already been broken, since a violated swing low is usually no longer a valid stop reference.
HOW TO USE IT
When planning a long entry, the nearest level below price gives a stop that sits beneath recent market structure with a small volatility buffer, which helps avoid being stopped out by normal noise right at the swing low. Deeper levels show alternative stops if you prefer more room. The distance between entry and stop can also be used for position sizing.
NOTES
- A swing low can only be confirmed after N candles have closed to its right, so each level appears N candles after the actual low. This is inherent to swing detection and means the indicator does not repaint.
- The indicator is designed for long positions (stops below swing lows).
- It works on any symbol and timeframe.
This tool is for chart analysis only and does not provide trading signals or guarantee results. Always apply your own risk management.
HOW IT WORKS
A swing low is a candle whose low is lower than the lows of the N candles on each side of it. Once a swing low is confirmed, the indicator draws a line below it at:
Stop level = Swing low − (ATR × multiplier)
The ATR value is taken from the swing low candle itself, so each level is fixed at the moment it forms and does not drift as volatility changes afterward. Each line starts at its swing low, runs to the current candle, and is labeled with its price.
The indicator keeps only the most recent swing lows (3 by default). When a new swing low is confirmed, the oldest level is removed.
SETTINGS
Swing detection
- N (candles on each side): how many candles on both sides must have higher lows. Higher values find more significant swings; lower values find more frequent, minor swings.
- Number of swing lows to show: how many recent stop levels are displayed.
ATR buffer
- ATR length: the ATR calculation period (default 14).
- ATR multiplier: how far below the swing low the stop is placed, in ATR units (default 0.25).
Style
- Line color, line style (Solid, Dashed, Dotted), and line width.
- Show price labels: displays the stop price next to each line.
- Remove a level once price closes below it: optionally clears levels that have already been broken, since a violated swing low is usually no longer a valid stop reference.
HOW TO USE IT
When planning a long entry, the nearest level below price gives a stop that sits beneath recent market structure with a small volatility buffer, which helps avoid being stopped out by normal noise right at the swing low. Deeper levels show alternative stops if you prefer more room. The distance between entry and stop can also be used for position sizing.
NOTES
- A swing low can only be confirmed after N candles have closed to its right, so each level appears N candles after the actual low. This is inherent to swing detection and means the indicator does not repaint.
- The indicator is designed for long positions (stops below swing lows).
- It works on any symbol and timeframe.
This tool is for chart analysis only and does not provide trading signals or guarantee results. Always apply your own risk management.
發行說明
Update: swing lows now confirm only on candle close (no repainting)發行說明
Change the default number of stop losses to 1開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。