Adaptive ATR Stop-Distance

by @dela_holds_the_line

D

Dela Mensah-Kow

@dela_holds_the_line
Open sourceformulaMIT

Dynamically calculates a stop-loss distance based on recent ATR and the size of the last confirmed swing, adapting to market volatility and price structure for Forex and indices on 4H to daily timeframes.

0 likes💬 0 comments👁 0 views🔖 0 saves0 forks1 in use
Sign in to interact.

Try it live

Run the preview to see this indicator plotted on a real chart.

Inputs

ATR Lengthint · default 14
ATR Multiplierfloat · default 1.5
Swing Lengthint · default 10
Swing Range Multiplierfloat · default 0.5

Outputs / plots

Adaptive Stop Distance (series)

Latest changelog

Initial release.

Version history

v17/24/2026, 5:58:59 PM

Source code

formula
let atr_val = atr(atr_len)
let swing_high = highest(high, swing_len)
let swing_low = lowest(low, swing_len)
let swing_range = swing_high - swing_low
let avg_atr = sma(atr_val, atr_len)
let scaled_stop = avg_atr * atr_mult
let adaptive_stop = scaled_stop + swing_range * swing_mult
plot("stop_distance", adaptive_stop)

Comments (0)

Sign in to leave a comment.

No comments yet.

Related indicators

Want to use this?

Sign in to preview it live on a chart, fork it into your own Indicators Lab, or use it in a strategy.