Free: indicator teardowns, a repaint checker and open-source scripts. No buy/sell signals, ever.

Taught to TradeSystems over signals.

Explainers / Chandelier Exit

Chandelier Exit by everget, explained from its source

The Chandelier Exit by everget is one of the most-used free indicators on TradingView, with about a million views. It draws a trailing stop line under price in an uptrend and over price in a downtrend, and flips between the two. This page explains it from the published source code, including one default most formula pages get wrong: out of the box it hangs the stop from the highest close, not the highest high.

The formula

Two lines are calculated on every bar. Only one is drawn at a time.

long stop = highest(22) - 3 x ATR(22) and short stop = lowest(22) + 3 x ATR(22)

ATR here is Wilder's average true range, the same one TradingView's built-in ATR uses.

The name comes from the picture: the stop hangs down from the highest point, like a chandelier from a ceiling.

The default most pages miss: closes, not highs

The classic description of the Chandelier Exit uses the highest high and lowest low. This script has a setting called "Use Close Price for Extremums", and it is on by default. So unless you change it, the stop hangs from the highest close of the last 22 bars.

Why it matters:

In a simulation on 200,000 random bars, the high/low version flipped direction about 30% more often than the close version, because its stop sits closer to price. That says nothing about which is better. It tells you the two settings are different tools.

How the stop trails and flips

One detail from the code: the "rise but not fall" rule checks the previous close against the previous stop. In rare cases price slips between the two without flipping, and the long stop steps down for a bar. In our simulation that happened on about 0.3% of long bars with the default setting. So the stop almost always only moves in your direction, not always.

Does Chandelier Exit repaint?

Not on closed bars. Every value uses the current and past bars only. There is no higher-timeframe request and no look into the future.

The live bar does change, and this matters more here than for most indicators:

If you want to test an indicator's behaviour yourself, see the free repaint checker.

Chandelier Exit vs Supertrend

They look alike: one line, flipping sides, built on ATR. They hang from different places.

Chandelier Exit (everget defaults)Supertrend (TradingView built-in defaults)
AnchorHighest / lowest close of 22 barsThe bar's midpoint, (high + low) / 2
Distance3 x ATR(22)3 x ATR(10)
After a strong runStop trails from the peak of the windowStop trails from the current bar's middle, ratcheted
Window memoryA spike stays in the window for 22 barsNo window of extremes

In plain terms: the Chandelier Exit measures how far price has fallen from its recent best. Supertrend measures how far it is from the middle of the current bar. More on that one at Supertrend explained.

Settings, honestly

There is no "best" setting for gold, scalping or intraday. What each one does:

On a 1-minute chart, 22 bars is 22 minutes. On a daily chart it is about a month. The same numbers mean different things on each timeframe.

Where it fails

Also explained

Educational content only. Not financial advice. Nothing here is a recommendation to buy or sell anything. Original script by everget on TradingView (GPL-3.0); this page explains its published source and quotes no code.

Also explained: Repaint checker, VWAP, Supertrend, RSI, UT Bot Alerts, Nadaraya-Watson Envelope, Squeeze Momentum, What is repainting on TradingView?, Is TradingView backtesting accurate?, WaveTrend Oscillator, QQE MOD, Pivot highs and lows, Hull Suite, Range Filter, Twin Range Filter, HalfTrend, ZigZag++, SSL Hybrid, CM MacD Ultimate MTF, Volume Profile / Fixed Range, ADX and DI, Support Resistance Channels, Market Structure Break & Order Block, Order Block Finder, Pivot Point SuperTrend, Trendlines with Breaks [LuxAlgo], Divergence for Many Indicators, TradingView script selling terms, Support and Resistance Levels with Break, Liquidity Swings [LuxAlgo], Pine Script errors, Breakout Probability (Expo), Did ChatGPT or Claude write your Pine Sc, Lorentzian Classification, SuperTrend AI (Clustering), Machine Learning Adaptive SuperTrend, Dynamic Swing Anchored VWAP, Support and Resistance Power Channel by , Support and Resistance (High Volume Boxe, Trendline Breakouts With Targets by Char, Breakout Finder by LonesomeTheBlue

Next steps

  • Get a script fixed. Compiles but behaves differently live, or changes after a reload? In a Pine Script Audit, an AI model reads every line and writes a report on what to fix for $49, or also fixes those problems for $149. It cannot prove a script is safe.
  • Check your own script. Paste its source into the free repaint checker. It runs in your browser and flags known patterns.
Subscribe to the Teardown Letter: $19/moBack to Taught to Trade

No TradingView account yet? This affiliate link gives you a $15 coupon toward a paid plan, and we earn a commission if you buy one. The free plan is enough to follow this page.