# Deviation Above/below Range

A Market Structure concept (Range anatomy) in the LuxAlgo Library, with 1 indicator implementation.

## What is a Deviation Above/below Range?

A deviation is a move that leaves an established [trading range](https://www.luxalgo.com/library/concept/trading-range/), trades above its high or below its low, fails to find acceptance, and closes back inside. The term is common in crypto range-trading vocabulary, where a range's extremes are treated as a resting [liquidity pool](https://www.luxalgo.com/library/concept/liquidity-pool/): the deviation is the excursion that collects those stops without building value outside. What separates a deviation from a breakout is the re-entry; the market comes back into the range and holds there, showing the outside prices were rejected rather than accepted.

The vocabulary rose with crypto range-trading content in the late 2010s and 2020s, but the event itself is old charting territory: Wyckoff called the bullish version a spring and the bearish one an upthrust, and classical literature filed both under failed breakouts. More recent candle-range-theory material recycles the same idea one level down, treating each higher-timeframe candle as a range whose high or low can be deviated and reclaimed. The names differ; the mechanic, a probe that fails to hold beyond a defined extreme, does not.

The standard reading is rotational: once an extreme has been deviated and reclaimed, the stops beyond it are spent, and price often rotates back through the range toward the opposite side. A deviation below the lows followed by a reclaim is a common long trigger, with the mirror at range highs. Acceptance versus rejection is a judgment made in real time and revised: an excursion that re-exits and holds outside was a breakout after all, which is why the deviation's extreme serves as the invalidation.

Judging acceptance is the craft. Time spent outside, the number and size of closes beyond the boundary, and whether trading outside builds any value all weigh against a fast, wick-heavy rejection, and the read sharpens across timeframes: a single daily deviation is a whole failed expedition on the hourly chart, which is why [multi-timeframe alignment](https://www.luxalgo.com/library/concept/multi-timeframe-structure-alignment/) work treats the lower timeframe as the place to watch the reclaim happen. At swing scale rather than range scale, the same probe-and-fail event is the [swing failure pattern](https://www.luxalgo.com/library/concept/swing-failure-pattern/).

## How to identify a deviation on a chart

The bearish-to-bullish case at range lows is described; mirror it for deviations above range highs.

1. Establish the range first: a mature [trading range](https://www.luxalgo.com/library/concept/trading-range/) with a defined high and low that have each been tested more than once.
2. Watch the excursion: price breaks below the range low, often quickly, into the stops resting beneath it.
3. Grade acceptance in real time: closes stacking below the boundary and value building outside argue breakout; hesitation, long lower wicks, and failure to extend argue rejection.
4. Require the reclaim: one or more decisive closes back inside the range on the timeframe that defined it convert the break into a deviation.
5. Mark the deviation's extreme as invalidation; trading back below it says the rejection read was wrong.
6. Frame the rotation: the range midpoint and opposite extreme become the working targets, per the standard rotational logic of ranges.

## How it's calculated

Defines a failed breakout in which price trades beyond a range boundary but closes back inside the range.

```
RH = max(H_i) over bars i in the range window
RL = min(L_i) over bars i in the range window
Deviation above: H_t > RH and C_t < RH
Deviation below: L_t < RL and C_t > RL

  RH: range high, the highest high of the established range
  RL: range low, the lowest low of the established range
  H: bar high
  L: bar low
  C: bar close
  i: bar index inside the range window
  t: bar index of the breakout attempt
```

The range is an established consolidation, defined by detected pivot highs and lows or by user-set levels, usually with a minimum number of bars inside it.

Many implementations allow the close back inside to occur within a few bars of the poke rather than on the same bar.

Also called a false breakout or swing failure; the deviation is only confirmed once price closes back inside the range.

## How traders use it

- As a reversal trigger at range extremes: after price deviates and closes back inside, traders position toward the range midpoint and opposite extreme, with stops beyond the deviation's furthest point.
- As a patience rule for range trading: instead of fading the first touch of a boundary, some models require the full deviation-and-reclaim sequence, accepting a later entry in exchange for evidence the extreme was rejected.
- As a breakout filter: breakout traders treat a decisive close back inside the range as failure and exit quickly, rather than holding through what has become a deviation.
- As a phase tell in range classification: a deviation below the lows that gets bought back aggressively is one of the behaviors that tilts an ambiguous range toward the accumulation side of the [accumulation versus distribution](https://www.luxalgo.com/library/concept/accumulation-vs-distribution-ranges/) question.
- As a swing-scale trigger: the same probe-and-reclaim logic applied to a single prior [swing high or low](https://www.luxalgo.com/library/concept/swing-high-low/) rather than a whole range is traded as the [swing failure pattern](https://www.luxalgo.com/library/concept/swing-failure-pattern/), with identical invalidation logic.

## Deviations vs similar concepts

- **False Breakout** (https://www.luxalgo.com/library/concept/false-breakout/): Essentially the same event in older vocabulary: a boundary break that fails and returns. 'False breakout' names the trap after the fact; deviation language centers the reclaim itself and the rotation trade toward the other side of the range.
- **Liquidity Sweep** (https://www.luxalgo.com/library/concept/liquidity-sweep/): A sweep is the raid on resting stops at any level, and can be a wick-only event at a single swing point. A deviation is specifically about an established range's extremes and is defined by the failure to hold outside the range.
- **Spring** (https://www.luxalgo.com/library/concept/spring/): Wyckoff's name for the bullish case: a shakeout below range support that recovers, read as evidence of accumulation (the bearish mirror is the upthrust). A deviation below the lows is the same price event without the Wyckoff phase context attached.

## FAQ

### Do deviations always lead to the other side of the range?

No. The reclaim only shows the extreme was rejected; from there price can stall mid-range, chop, or deviate again at the same edge. The opposite extreme is a scenario target with a defined invalidation (the deviation's extreme), not something the market owes. Range trades built on deviations still fail regularly.

### How long can price stay outside before it's a breakout, not a deviation?

There is no fixed rule. Common conventions require a close back inside within one or a few bars on the timeframe that defined the range, or use acceptance measures such as time spent and volume traded outside. The longer and more actively price trades beyond the boundary, the more the move reads as acceptance, meaning a genuine breakout.

### What is the difference between a deviation and a swing failure pattern?

Scale and reference. A swing failure pattern probes a single prior swing point and reclaims it, while a deviation works the boundary of an established multi-touch range. The trap logic and the invalidation (the probe's extreme) are identical, which is why traders comfortable with one usually trade the other the same way.

### How should the range be defined before trading deviations?

Strictly enough that the boundaries mean something: multiple genuine tests of both extremes, on the timeframe you intend to trade, with the range old enough that stops have had time to build beyond it. Deviating a boundary nobody was leaning on proves little. Many traders map the range on a higher timeframe and execute the deviation on a lower one.

### Does volume help judge acceptance versus rejection?

It is a useful second opinion where volume data is meaningful. A push outside on swelling volume that keeps trading actively out there reads as acceptance; a spike that immediately dries up as price sags back inside reads as stop-driven rejection. The price-based read (closes and time outside) leads, with volume confirming or questioning it.

### Do deviations work on higher-timeframe candle ranges?

The candle-range-theory reading applies the same template to a single higher-timeframe candle: its high and low act as the range, and a lower-timeframe excursion beyond one that closes back within is traded as a deviation. It inherits all the usual caveats, and the boundary is only as meaningful as the candle chosen, so most practitioners restrict it to prominent daily, weekly, or session candles.

## Implementations in the Library

- CRT Sweep & Setup Highlighter (LuxAlgo): https://www.luxalgo.com/library/indicator/crt-sweep-setup-highlighter/

## Related concepts

- Trading Range: https://www.luxalgo.com/library/concept/trading-range/
- False Breakout: https://www.luxalgo.com/library/concept/false-breakout/
- Breakout-pullback-continuation: https://www.luxalgo.com/library/concept/breakout-pullback-continuation/
- Accumulation vs Distribution Ranges: https://www.luxalgo.com/library/concept/accumulation-vs-distribution-ranges/
- Re-accumulation: https://www.luxalgo.com/library/concept/re-accumulation/
- Re-distribution: https://www.luxalgo.com/library/concept/re-distribution/
- Parabolic Phase: https://www.luxalgo.com/library/concept/parabolic-phase/

---

Source: https://www.luxalgo.com/library/concept/deviation-above-below-range/ (LuxAlgo Library, the encyclopedia of trading & technical analysis). Free to use with attribution: https://www.luxalgo.com/library/license/