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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.