indicator · on price · open source
Chandelier Exit
Running…
Loading chart…
About
Chandelier Exit plots a trailing stop anchored at the rolling high/low adjusted for ATR — originally designed to let winners run.
- Long stop = rolling high minus
mult × ATR; flip when price closes below the prior stop. - Combine with a trend filter (above/below a slow MA) for the classic swing entry.
Source code
//@version=5
indicator("Chandelier Exit", overlay=true)
len = input.int(22, "Lookback", minval=2, maxval=200)
mult = input.float(3, "ATR multiplier", minval=0.5, maxval=10, step=0.1)
atrVal = ta.atr(len)
hi = ta.highest(high, len)
lo = ta.lowest(low, len)
highExit = hi - atrVal * mult
lowExit = lo + atrVal * mult
ch = close > (na(highExit[1]) ? close : highExit[1]) ? highExit : lowExit
p_Chandelier = plot(ch, "Chandelier", color=color.orange, linewidth=2)
alertcondition(close > ch and close[1] <= ch[1], "Long flip", "Chandelier Exit flipped long")
alertcondition(close < ch and close[1] >= ch[1], "Short flip", "Chandelier Exit flipped short")
No comments yet.
Sign in to comment.