OPEN-SOURCE SCRIPT
Aggiornato 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.
Note di rilascio
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.
Note di rilascio
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
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.