OPEN-SOURCE SCRIPT

Chandelier Exit Oscillator + State Mapping

1 488
At its core, this script is built on a Chandelier Exit-style ATR stop-and-flip engine. The difference is that instead of leaving that framework only in price space, this indicator converts the active side and the opposite-side extension into a normalized oscillator. In other words, this takes the same Chandelier Exit structure that can define trend state and stretch on a chart, then re-expresses that structure in a separate pane so it can be read in a different way. Rather than only asking where price is relative to a trailing stop, this script asks where price is progressing inside the current active-to-extension range and how that progression is behaving.

That is what makes this more than a standard Chandelier Exit view. It does not just plot a stop and a flip. It takes the current main multiplier structure, builds a directional channel from the active side to the opposite-side extension, and maps that channel into oscillator space. That creates a normalized way to read state, stretch, and internal zone behavior across both bullish and bearish conditions.

The script includes two mapping modes.

1) Geometry mode preserves the channel relationship more literally:

active level = -100
midpoint = 0
extension = +100

2) State-Weighted mode keeps the same Chandelier framework but biases the oscillator by active direction, so bullish regimes tend to live above 0 and bearish regimes tend to live below 0. In that mode, 0 behaves less like a simple midpoint and more like a directional boundary.

From there, the script adds three secondary Chandelier Exit multipliers, which by default are 2.5, 5.0, and 7.5. These are not separate indicators bolted onto the script for the sake of adding features. They are additional Chandelier Exit branches derived from the same underlying ATR stop-and-flip logic. Their active levels are remapped into the same oscillator space so they can act as internal zone references inside the broader main channel.

That matters because not every move waits until a full extension is reached before reacting. Sometimes price begins to stall, react, or accelerate from a smaller internal multiplier zone first. These secondary CE layers help organize that behavior into a readable internal structure instead of forcing everything to be judged only from the full outer stretch.

The script also gives multiple ways to view the same oscillator state. You can keep it simple with the main oscillator line, or display histogram columns, synthetic oscillator candles, guide rails, and extreme zones. There is also an optional price-overlay candle mode, which colors the chart candles using the same oscillator color engine so the chart view and pane view remain visually connected.

To help with context, the script also includes:

➖an HTF oscillator reference line
➖an oscillator volume-weighted average
➖adaptive fast/slow crossover lines
➖a standalone SMA 20/50 crossover engine
➖a current-state table
➖optional alerts for zero-line crosses and adaptive fast/slow crosses

These features are there to help interpret the same core Chandelier Exit structure in oscillator form. They are not separate systems with separate foundations. The main idea stays consistent throughout the script: use a CE-style ATR framework as the base, then translate it into a pane-based state and extension model that is easier to compare, normalize, and monitor over time.

A practical way to read it:

➡️ In a bullish state, the active main CE side becomes the lower anchor and the opposite-side extension becomes the upper anchor. The oscillator shows how far price is progressing through that structure.
➡️ In a bearish state, the structure flips. The active main CE side becomes the upper anchor and the opposite-side extension becomes the lower anchor.
➡️ The secondary CE multiplier zones help show where internal support/resistance-style reaction areas may begin to matter before price reaches the full outer stretch.
➡️ In Geometry mode, 0 is the midpoint of the mapped channel. In State-Weighted mode, 0 behaves more like a directional dividing line between bullish and bearish conditions.

One of the main reasons I made this was to create a true companion to my overlay script, Chandelier Exit Reaction Zones + Fib Levels. That script keeps the structure directly on price. This oscillator takes the same general Chandelier Exit framework and expresses it in normalized pane form. Used together, the overlay script helps show where the structure sits on the chart, while this oscillator helps show how price is progressing through that same structure, how internal zones are behaving, and whether the move still looks orderly inside the current channel. They work well as a package because one gives the price-space view and the other gives the pane-space view of the same broader idea.

This is not meant to predict reversals by itself, and it is not intended to be treated as a standalone signal machine. The way I use it is more practical:

➖to frame where price is stretched
➖to judge whether price is still progressing through the current CE channel or starting to stall
➖to see whether the move is only testing an internal multiplier zone or approaching a full extension
➖to compare current oscillator behavior against HTF context and crossover behavior

Bar Replay is especially useful here. Watching the script one bar at a time makes it much easier to see how the CE state flips, how the oscillator remaps around those flips, and when the internal multiplier zones begin to matter before a larger stretch is completed.

Like the companion overlay version, this works best with confluence. Volume, RSI, structure, trend context, support/resistance, and broader market conditions can all help decide whether an extended move is more likely to continue, react, or fully reverse. The value of this script is not that it replaces those tools. The value is that it gives the Chandelier Exit framework a second, more normalized expression that can make state, extension, and internal zone behavior easier to read.

A few examples showing bullish and bearish charts:

لقطة

لقطة

لقطة

لقطة

لقطة

لقطة

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.