OPEN-SOURCE SCRIPT
已更新 Stop Loss - structuur + ATR-buffer

This indicator helps you avoid getting stopped out by a few pips when price sweeps an obvious level. Instead of placing your stop exactly at the last swing low/high — where liquidity sits — it calculates a stop level with a volatility-based buffer:
Stop = last confirmed swing low/high ± (ATR × multiplier + extra pips)
The chart shows the swing level (dotted line), the buffered stop level for longs and shorts (solid lines), and a label with the exact stop price, buffer size, and distance in pips — use that distance for your position sizing.
Settings:
Swing sensitivity — how many candles left/right must confirm a swing. Higher = only major swings, lower = minor swings closer to price.
ATR period / multiplier — the buffer scales with volatility, so it automatically widens on volatile pairs and higher timeframes.
Extra pips — fixed margin for spread (stops are triggered on bid/ask, not the mid-price your chart shows).
Note: the default settings are a starting point, not a recommendation. Backtest on your own trades: measure how far wicks typically pierce your swing levels relative to ATR, and set the multiplier accordingly. A wider stop means a smaller position at the same risk percentage — never more risk. If the buffered stop breaks your minimum R:R, skip the trade instead of tightening the stop.
Stop = last confirmed swing low/high ± (ATR × multiplier + extra pips)
The chart shows the swing level (dotted line), the buffered stop level for longs and shorts (solid lines), and a label with the exact stop price, buffer size, and distance in pips — use that distance for your position sizing.
Settings:
Swing sensitivity — how many candles left/right must confirm a swing. Higher = only major swings, lower = minor swings closer to price.
ATR period / multiplier — the buffer scales with volatility, so it automatically widens on volatile pairs and higher timeframes.
Extra pips — fixed margin for spread (stops are triggered on bid/ask, not the mid-price your chart shows).
Note: the default settings are a starting point, not a recommendation. Backtest on your own trades: measure how far wicks typically pierce your swing levels relative to ATR, and set the multiplier accordingly. A wider stop means a smaller position at the same risk percentage — never more risk. If the buffered stop breaks your minimum R:R, skip the trade instead of tightening the stop.
版本注释
Stop Loss — Structure + ATR BufferThis indicator helps you avoid getting stopped out by a few pips when price sweeps an obvious level. Instead of placing your stop exactly at the swing low/high — where liquidity sits — it calculates a stop level with a volatility-based buffer:
Stop = swing low/high ± (ATR × multiplier + extra pips)
The chart shows the reference level (dotted line), the buffered stop for longs and shorts (solid lines), and a label with the exact stop price, buffer size, and distance in pips — use that distance for your position sizing.
Two detection modes
Direct (no delay): takes the lowest low / highest high of the last N candles, recalculated every bar. No confirmation lag — ideal when you place your order before price returns to your entry zone. With the "closed candles only" option enabled, a lookback of 1 gives you exactly the wick of the last closed candle.
Confirmed swing (pivot): only uses confirmed swing points, with separately adjustable left/right confirmation. More stable, but the level appears with a delay of [right confirmation] candles.
Three preset slots
Save up to three complete parameter sets (mode, lookback, ATR settings, extra pips) and give each slot your own name — for example one per market or timeframe. Set them up once, click "Save as default", and switch between them with a single dropdown click. A label on the chart always shows which preset is active, so you never trade with the wrong parameter set.
Note: the default values are a starting point, not a recommendation. Backtest on your own trades: measure how far wicks typically pierce your levels relative to ATR and set the multiplier accordingly. A wider stop means a smaller position at the same risk percentage — never more risk. If the buffered stop breaks your minimum R:R, skip the trade instead of tightening the stop.
The interface text is in Dutch. Key terms: Actief preset-slot = active preset slot, Detectiemodus = detection mode, Terugkijkperiode = lookback period, Bevestiging links/rechts = left/right confirmation, Enkel gesloten candles = closed candles only, Toon long-stop/short-stop = show long/short stop.
版本注释
Stop Loss — Structure + ATR Buffer
This indicator helps you avoid getting stopped out by a few pips when price sweeps an obvious level. Instead of placing your stop exactly at the swing low/high — where liquidity sits — it calculates a stop level with a volatility-based buffer:
Stop = swing low/high ± (ATR × multiplier + extra pips)
The chart shows the reference level (dotted line), the buffered stop for longs and shorts (solid lines), and a label with the exact stop price, buffer size, and distance in pips — use that distance for your position sizing.
Two detection modes
Direct (no delay): takes the lowest low / highest high of the last N candles, recalculated every bar. No confirmation lag — ideal when you place your order before price returns to your entry zone. With the "Closed candles only" option enabled, a lookback of 1 gives you exactly the wick of the last closed candle.
Confirmed swing (pivot): only uses confirmed swing points, with separately adjustable left/right confirmation. More stable, but the level only appears after the right-side confirmation candles have closed.
Three preset slots
Save up to three complete parameter sets (mode, lookback, ATR settings, extra pips) and give each slot your own name — for example one per market or timeframe. Set them up once, click "Save as default", and switch between them with a single dropdown click. A label on the chart always shows which preset is active, so you never trade with the wrong parameter set.
Note: the default values are a starting point, not a recommendation. Backtest on your own trades: measure how far wicks typically pierce your levels relative to ATR and set the multiplier accordingly. A wider stop means a smaller position at the same risk percentage — never more risk. If the buffered stop breaks your minimum R:R, skip the trade instead of tightening the stop.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。