Skip to content

Free MT5 indicator

Chandelier Exit

ATR-based chandelier trailing stops for MT5 that show the active long or short stop and mark each confirmed direction flip.

Risk managementv1.0MetaTrader 5 (MQL5) Compiles with 0 errors Non-repainting signals Alerts

What it does

Chandelier Exit plots a volatility-based trailing stop that "hangs" a set number of ATRs below the recent high in an uptrend, or above the recent low in a downtrend. Only the active stop is drawn: a green line under price while long, a red line above price while short. An arrow marks each closed bar where price crosses the opposite stop and the direction flips.

Its main job is exit management: it gives you a rule-based place to trail a stop-loss that adapts to current volatility.

How it works

  1. True range and a Wilder ATR are calculated over 22 bars.
  2. Long stop = highest value over the last 22 bars − 3 × ATR. Short stop = lowest value over the last 22 bars + 3 × ATR. By default the highest and lowest closes are used; you can switch to highs and lows.
  3. Ratchet: while the previous close stays above the previous long stop, the long stop can only rise. While the previous close stays below the previous short stop, the short stop can only fall.
  4. Direction turns long when the close rises above the previous short stop, and short when the close falls below the previous long stop. Otherwise it stays the same.
  5. The green line shows the long stop while long; the red line shows the short stop while short.

How to use it

  • As an exit: if you hold a long trade, the green line is a candidate trailing stop level. A close below it flips the indicator short and suggests the trend has weakened.
  • As a trend filter: green means price has stayed within 3 ATRs of its recent high; red means it has stayed within 3 ATRs of its recent low.
  • Use the distance between entry and the current stop with the Position Size Calculator to size trades so that a stop-out costs a fixed share of your account.
  • Wider multipliers suit volatile instruments such as gold, oil and crypto; tighter multipliers suit calmer pairs.
  • It works on any symbol and timeframe; H1 and above typically give more stable stops.

Settings

InputDefaultWhat it changes
Lookback22How far back the high or low is measured
ATR length22Smoothing of the volatility measure
ATR multiplier3.0Stop distance; higher means fewer flips and larger risk per trade
Use closes for the extremestrueSet to false to hang the stop from wicks instead
Pop-up alert / Push notificationfalse / falseOne alert per closed bar on a new flip

Limitations

  • The stop is based on closing bars. Price can trade through the line intrabar without a flip, and a real stop order would be filled at that point.
  • After a sudden spike the ATR widens, pushing the stop further away exactly when you may want it tight.
  • In ranging markets it flips often, and each flip near the middle of a range is costly if traded mechanically.
  • Values on the live bar change with each tick; arrows and alerts wait for the bar to close.
  • A trailing stop limits but does not remove risk, and gaps or slippage can cause larger losses. Trading involves substantial risk of loss.

Key inputs

Key inputs of Chandelier Exit
InputDefaultDescription
Highest-high / lowest-low lookback22Bars used to find the extreme the stop hangs from.
ATR length22Bars used for the Wilder Average True Range.
ATR multiplier3.0Distance of the stop from the extreme, in ATRs.
Use closes (not highs/lows) for the extremestrueMeasure the extreme from closing prices instead of wicks.
Pop-up alert on new flipfalseAlerts once when a closed bar flips the direction.

Educational tools, not advice. Indicators and Expert Advisors describe price; they do not predict it, and past behaviour does not guarantee future results. Test everything on a demo account first and never risk money you cannot afford to lose. See our disclaimer.

Keep exploring

Related mt5 indicators