Chandelier Exit for MT4 – faithful port of everget’s TradingView version with signal statistics

Indicators MetaTrader 4 Free

Chandelier Exit on XAUUSD H1

A line-by-line port of “Chandelier Exit”, © 2019-present Alex Orekhov (everget), distributed under the GPL-3.0 license. The original is at tradingview.com/script/AqXxNS7j/. This port is released under the same license.

The logic is exactly the original’s:

  • ATR = multiplier × ta.atr(length) (Wilder RMA, seeded with an SMA).
  • Long stop = highest(close or high, length) − ATR. It only moves up while the previous close stays above the previous stop.
  • Short stop = lowest(close or low, length) + ATR. It moves symmetrically: only down while the previous close stays below the previous stop.
  • Direction:
    • It turns long when the close breaks above the previous short stop.
    • It turns short when the close breaks below the previous long stop.
    • Otherwise it keeps the previous state.
  • Buy / Sell when the direction flips, with a dot at the start of each new stop line.
  • State highlight between OHLC/4 and the active stop. It is drawn as background rectangles so it stays behind candles and other indicators.

Inputs (original defaults): ATR Period 22, Multiplier 3.0, Use Close Price for Extremums on.

Added for MT4:

  • Signal statistics panel. It buys at the bar after a Buy, sells after a Sell, and closes and reverses at the opposite signal. It shows:
    • trades, win rate, net points / pips / USD after spread + commission
    • profit factor, longest losing streak, max drawdown
    • the open trade and the cost per trade
  • Daily session filter in your own time zone, with session shading and an optional close at session end. It is off by default (the panel counts the whole day); set Use_Session = true and your hours to use it.
  • Trade marks with tooltips.
  • Alerts on new signals.

Buffers for EAs ( iCustom ): 4 = Buy, 5 = Sell, 6 = long stop, 7 = short stop.

The panel describes past signals. It is not a backtest and not a promise of results.