OPEN-SOURCE SCRIPT
Cập nhật 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.
Phát hành các Ghi chú
Update: swing lows now confirm only on candle close (no repainting)Phát hành các Ghi chú
Change the default number of stop losses to 1Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.