Chandelier Exit Levels
Chandelier Exit only works as intended if the stop never moves against an open position - a naive implementation that recalculates the raw highest-high-minus-ATR figure on every bar will happily let the stop drop back down after price has already pulled it up, which defeats the entire point of a trailing stop. This version ratchets: once long, the stop can only move up or stay flat, never down, and the same holds in mirror for a short stop; a flip to the other side only happens the bar price actually closes through the current ratcheted level. Direction is not stored in a separate hidden variable - whichever of the two stop buffers held a value on the previous bar is read back as the current direction, which keeps the indicator's state limited to exactly what is drawn on the chart rather than an internal flag that could drift out of sync with it. An optional three-rung ladder plots additional stop levels further out at larger ATR multiples on the active side only, for traders who scale exits rather than closing everything at one level. Notes and limitations - The stop ratchets and never worsens on its own side, but a large gap or spike can still jump straight past it - this is a reference level, not a guaranteed fill, and it does not place, modify or trail an actual order's stop-loss. - The very first computable bar on the chart has no prior direction to inherit, so it starts on the long side by convention; this has no effect once the series has run for more than a handful of bars. - The ladder rungs are purely a display aid for planned scale-out levels - they carry no independent trailing logic of their own and simply track whichever direction the main stop is currently on.
Indicator · MT5 · v1.0 · Free
About Chandelier Exit Levels
Chandelier Exit Levels is an indicator for MetaTrader 5 based on ATR. It can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Period, Multiplier and Atr period. MQL source code included.
Files in the download: ChandelierExitLevels.ex5, ChandelierExitLevels.mq5, ChandelierExitLevels.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Period | 22 | Lookback for the highest high / lowest low anchor |
| Multiplier | 3.0 | ATR multiple offset from the anchor |
| Atr period | 22 | ATR period (independent of the anchor lookback) |
| Alerts | true | Alert once per closed bar when the trend flips side |
| Show ladder | true | Draw three extra rungs at larger ATR multiples, active side only |
| Ladder step | 1.0 | ATR multiple added per ladder rung above InpMultiplier |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: ATR · Alerts · Trailing Stop & Break-even · MT5 Indicator · MQL5 Source Code