//@version=5
strategy("Chandelier Exit", overlay=true,
default_qty_type=strategy.percent_of_equity, default_qty_value=10)
period = input.int(22, "Period")
mult = input.float(3.0, "ATR Mult")
emaLen = input.int(200, "Trend EMA")
atrV = ta.atr(period)
longStop = ta.highest(high, period) - atrV * mult
shortStop= ta.lowest(low, period) + atrV * mult
emaT = ta.ema(close, emaLen)
longBO = ta.crossover(close, shortStop) and close > emaT
shortBO = ta.crossunder(close, longStop) and close < emaT
if longBO and strategy.position_size == 0
sl = longStop
risk = close - sl
if risk > 0
strategy.entry("Ch L", strategy.long)
strategy.exit("X", "Ch L", stop=sl, limit=close + risk * 2.5)
if shortBO and strategy.position_size == 0
sl = shortStop
risk = sl - close
if risk > 0
strategy.entry("Ch S", strategy.short)
strategy.exit("X", "Ch S", stop=sl, limit=close - risk * 2.5)
plot(longStop, "Long Stop", color.red)
plot(shortStop, "Short Stop", color.green)
plotshape(longBO, "L", shape.triangleup, location.belowbar, color.lime)
plotshape(shortBO, "S", shape.triangledown, location.abovebar, color.red)
Overview
Chandelier Exit calculates trailing stop bands using the highest high or lowest low over a lookback period adjusted by an Average True Range multiplier. Long trades enter when the close crosses above the lower band while above the EMA, and short trades enter when crossing below the upper band while below the EMA. Positions use the respective Chandelier level as a stop loss alongside a 1:2.5 risk-to-reward profit target, drawing bands and entry markers directly on the price chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Period
int
22
period
ATR Mult
float
3.0
mult
Trend EMA
int
200
emaLen
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This strategy plots VWMA-based Bollinger bands on the 1-minute ES futures price chart for volatility analysis and potential breakout identification. It calculates dynamic long and short stop loss and take profit levels using percentage inputs relative to entry
This strategy runs on the price chart and enters long when a fast simple moving average crosses above a slow one, and short on the opposite cross, while closing the other side. Entries also need ATR above a filter, a pullback check, a minimum candle-body chang
This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the
This trend-following strategy adapts classic Donchian breakout channels according to market volatility regimes. It calculates an ATR percentile rank across a rolling lookback period, shifting dynamically between tighter breakout channels with smaller stops dur
This strategy executes breakout trades using two Donchian Channels alongside an optional 200-period EMA trend filter. Entries trigger when the price sets a new highest high or lowest low over the primary Donchian Channel period. Exits are managed via a shorter
This strategy implements a channel breakout system directly on the main price chart. It calculates highest highs and lowest lows over configurable entry and exit periods using historical candles. A long entry triggers when the close breaks above the entry chan