The Chandelier Exit, popularized by Charles Le Beau and Alexander Elder, is a trailing stop that "hangs" from the highest point reached by price, like a chandelier from a ceiling. Instead of using a fixed number of points, the distance is a multiple of the Average True Range (ATR). In quiet markets the stop sits close to price; in volatile markets it moves further away, so normal noise does not stop you out too early.
The two stop levels are calculated as follows:
Long stop = Highest High (Lookback) - Multiplier * ATR Short stop = Lowest Low (Lookback) + Multiplier * ATR
Two rules turn these levels into a usable trailing stop line:
ATR is calculated inside the indicator with Wilder smoothing (the first value is the simple average of the first InpATRPeriod true ranges), so no indicator handle is needed.
The indicator draws only in the main chart window. For iCustom() the buffers are: 0 – long stop, 1 – short stop, 2 – buy arrow price, 3 – sell arrow price (EMPTY_VALUE where nothing is drawn).
| Input | Default | Purpose |
|---|---|---|
| InpLookback | 22 | Number of bars used to find the highest high and the lowest low. |
| InpATRPeriod | 22 | ATR period (Wilder smoothing). |
| InpMultiplier | 3.0 | ATR multiplier: the distance of the stop from the extreme. Must be greater than 0. |
| InpUseClose | false | If true, the highest and lowest closes are used for the extremes instead of highs and lows. |
| InpShowArrows | true | Show buy/sell arrows on trend flips. |
| InpLongColor | clrWhite | Color of the long stop line and of the buy arrow. |
| InpShortColor | clrDarkGray | Color of the short stop line and of the sell arrow. |
| InpShowStatus | true | Show or hide the on-chart status label. |
| InpCorner | CORNER_LEFT_UPPER | Chart corner in which the status label is placed. |
| InpStatusColor | clrWhite | Color of the status label text. |
| InpAlertPopup | false | Show a popup alert when the trend flips on a closed bar. |
| InpAlertPush | false | Send a push notification when the trend flips on a closed bar (requires MetaQuotes ID in the terminal settings). |
Invalid parameters (periods below 1 or a multiplier not greater than 0) stop the initialization and a message is printed to the Experts tab.

Fig. 1. ATR Trailing Stop Line (Chandelier Exit) with default inputs: long stop (white), short stop (gray), flip arrows and the status label; black & white image according to the Code Base image guidelines.
Kaufman Adaptive Moving Average (KAMA) Ribbon
A ribbon of Kaufman Adaptive Moving Averages with growing Efficiency Ratio periods, drawn in a monochrome gradient, with an on-chart label showing whether the ribbon is bullish, bearish or mixed.
Hull Moving Average with Slope Color Change
Hull Moving Average that changes color with its slope: one color while the line rises, another while it falls, a neutral one when it is flat, with optional arrows at the turns.
Breakeven and R-Trail Manager — break-even at +1R and R-multiple trailing for any trade
Utility EA that moves the stop to break-even plus a small lock once a trade reaches +X R, then trails it N R behind price. Manual trades or any EA by magic number. Never opens trades and never widens a stop.
MTF Trend Dashboard — trend, position and volatility on six timeframes at a glance
One on-chart table for M15, H1, H4, D1, W1 and MN1: EMA slope, price vs EMA, Donchian position, ATR percentile and a combined UP / DOWN / RANGE regime. Completed bars only. Any symbol.