OPEN-SOURCE SCRIPT
Mis à jour 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.
Notes de version
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.
Notes de version
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.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.