Skip to content

Technical indicators

Chandelier Exit

Where to put a trailing stop, from the recent extreme and the market’s typical move.

The long exit hangs below the highest high of the window by multiplier × ATR; the short exit sits above the lowest low by the same distance.

Traders holding a long position exit when the price closes below the long exit, and the reverse for a short. It is a way to let a trend run while protecting gains, not an entry signal.

long exit = highest high of the last periods bars − multiplier × ATR(periods)
short exit = lowest low of the last periods bars + multiplier × ATR(periods)

Call: chandelierExit(periods, multiplier)

Setting Chart default
periods: Periods 22
multiplier: Multiplier 3

What you get: a list of 2, in this order: 1. a number (“chandelierExit Short”); 2. a number (“chandelierExit Long”).

Warm-up: with chandelierExit(22, 3), it asks for 22 bars of history and a run-up of 44, and its first value came on bar 23 of the example data.

Chandelier Exit drawn by its own code on example prices

The prices are made up, hourly, and the same on every page, so the chart shows how the indicator behaves, not how a market behaved.

function onIntervalClose() {
const exits = chandelierExit(22, 3);
const longExit = exits[1];
if (OPEN_POSITIONS_COUNT > 0 && CLOSE < longExit) {
closeAllPositions();
}
}

It gives [short exit, long exit].