OPEN-SOURCE SCRIPT

Volatility Corridor - Quantized Equilibrium Levels

2 485
Most range and channel tools slide. The midline is a moving average, so it moves on every bar, and the levels drawn from it move with it. That makes them fine as a trend read and close to useless as levels, because the level you looked at ten bars ago is no longer where you left it.

Volatility Corridor does the opposite. It holds still, and then it jumps.

HOW THE CORRIDOR IS BUILT

An equilibrium anchor sits at the centre of the corridor. Once placed, it is frozen. It does not drift, it does not smooth, it does not respond to anything at all until price closes more than one volatility step away from it.

When that happens, the anchor jumps by a whole number of steps in the direction of the breach, lands at the new location, re-measures its step size from ATR at that exact moment, and freezes again.

Three bands are drawn one step apart above the anchor and three below, giving seven horizontal levels: S3, S2, S1, EQ, R1, R2, R3. Because the anchor and the step are both frozen between jumps, every one of those levels is a genuine flat horizontal line for the entire life of the corridor. Across a chart the result is a staircase of stable shelves rather than a wave, and the jump bars are marked so the history of the structure is readable at a glance.

The quantization matters. The anchor moves by whole steps, never by fractions, so successive corridors line up on a common grid instead of drifting off it. When price returns to an area it traded weeks ago, the corridor tends to rebuild on the same shelves rather than near them.

WHAT IS ON THE CHART

Seven stepline levels, thickest at the equilibrium.

Six filled bands between them, darkening toward the outer edges, so the corridor reads instantly without inspecting a single number.

Candles tinted by their position inside the corridor, running from the lower colour at the bottom edge through neutral at equilibrium to the upper colour at the top.

Background tint whenever price is trading fully outside the corridor.

Price labels on every level at the right edge, in four selectable sizes.

Jump markers at the top and bottom of the pane showing every bar the corridor re-anchored, and in which direction.

SETUPS

Two setups are defined, and either can be switched off.

Reversion. Price has pushed into the outer band and closes back inside it while still on its own side of equilibrium. The stop is the far outer level, and the targets are the levels above: equilibrium first, then the next band, then the one after that. The reasoning is that a corridor that is holding will pull price back toward its centre, and the level structure already provides the map for that journey.

Breakout. Price closes fully beyond the outer level of the corridor. The stop is the first level back inside, and the targets are projected one, two and three steps beyond the corridor edge, on the same grid the corridor itself uses.

In both cases the stop and the targets are structural levels, not multiples of risk. Nothing is placed at an arbitrary distance. The stop is where the structure would be wrong, and the targets are the next shelves on the grid.

Only one setup is tracked at a time. A new signal cannot silently replace an unresolved one.

The panel keeps a record of whether the first target or the stop was reached first, and prints collecting rather than a percentage until the sample is large enough to mean anything. That number is a narrow measurement of one mechanical rule, not a backtest, and it says nothing about what a trader who moved a stop or scaled out would have achieved.

SETTINGS

Step Size is the one dial that matters. It sets the width of a single band in ATR terms, and therefore how far price must travel to force a jump. Larger values give wider, rarer, more significant corridors. Smaller values give a tighter grid that re-anchors often.

Volatility Length sets the ATR lookback used to measure a step at each anchor. Longer is more stable.

Everything else is cosmetic: fills, candle painting, label size, level thickness, background tint.

REPAINTING

The anchor, the step size, the jumps, the setups and the alerts all evaluate on confirmed bars only. A level that is drawn is final for the life of the corridor and is never moved retroactively. The script requests no higher timeframe data.

READING IT

Equilibrium is the fair value the corridor is currently defending. Price oscillating around it is a market with no directional decision.

The outer bands are where the current corridor stops being an adequate description of price. Price reaching them means one of two things is about to happen: it is rejected and the corridor holds, or it closes through and the whole structure jumps to a new shelf. Both are tradable and both have a setup defined for them.

A corridor that survives many bars is a market that has agreed on value. A rapid sequence of jumps in one direction is a trend, and the jump markers make that sequence obvious even when the candles do not.

This is an analysis tool, not financial advice, and not a trading system. The setups are two mechanically defined patterns, and no pattern has an edge on its own. Use it with your own risk management and position sizing.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.