What is Range Detection?
Range / Chop Detection answers one question for every bar, is the market going anywhere? It shades each bar where price has been moving back and forth without making progress, and once a stretch of those bars lasts long enough, it draws a box around its high and low.
It uses Kaufman's efficiency ratio, which compares how far price got with how far it travelled. Unlike a width test, this does not mistake a slow, steady trend for a range, and it does catch a wild sideways chop.
This is a closed-source premium script. It runs on Altrady's servers, so only its output reaches your chart and its code is not published.
How to use Range Detection
- Shaded bars. The live signal. A shaded bar means the recent window has been inefficient, price travelling without getting anywhere.
- A range box. A run of shaded bars that lasted at least Min Bars. Its high and low are the range most traders would draw by hand.
- Trading the range. Inside a range, trend tools give poor signals. Many traders switch to fading the edges or simply wait.
- The range ending. When the shading stops, the market has started moving efficiently again, often the breakout out of the box.
Settings
Range
| Setting | Default | Range | What it changes |
|---|---|---|---|
| Timeframe | Chart | Chart, 15m, 30m, 1h, 4h, 1D | Measure the ratio on a higher timeframe while trading a lower one. The chart's own period must divide it exactly. |
| Efficiency Length | 20 | 2 to 200 | The window the ratio is measured over. Longer windows score lower overall, so this choice sets what 'typical' means: median 0.29 at 10 bars, 0.20 at 20, 0.15 at 30 on the instrument these defaults were measured on. |
| Max Efficiency | 0.15 | 0 to 1 | Below this the window is called ranging. 0 is pure chop, 1 is a straight line. It sets how much of the chart is tinted AND how often a run lasts long enough to be boxed, and those pull against each other. Tightening it does not find better ranges, it finds none. See the header for what each value measured. |
| Min Bars | 10 | 1 to 500 | A run must last this long before it earns a box. The ratio dips below any threshold constantly; most of those dips are noise, and the box is the expensive part. |
Display
| Setting | Default | Range | What it changes |
|---|---|---|---|
| Max Ranges | 20 | 1 to 100 | The oldest box is removed past this. |
| Show Box | On | The high-to-low extent of each qualifying range. | |
| Show Tint | On | Shade every ranging bar, including the ones before the run is long enough to earn a box. This is the live signal. | |
| Show Labels | Off | Off by default: a box that is already shaded rarely needs a word on it too. | |
| Show Border | On | ||
| Label Size | Small | Tiny, Small, Normal, Large, Huge | |
| Show State Pane | Off | A sub-pane plotting the ratio itself and the ranging flag. The tool's internal state, and what the automated checks read. |
Colours
| Setting | Default | Range | What it changes |
|---|---|---|---|
| Range | #787b86 | The box and its border. | |
| Tint | #787b86 | The background shade on a ranging bar. | |
| Label | #b0b3b8 |
Alerts: range_started, range_ended.
How it works
For every bar, the script measures the efficiency of the last Efficiency Length bars, 20 by default. A value near 0 is pure chop and a value near 1 a straight line. Below Max Efficiency, 0.15 by default, the bar counts as ranging and is shaded.
{:"The ratio dips below the threshold constantly for a bar or two, so a box is only earned once a run reaches Min Bars, 10 by default. The box then grows with the run and stops when it ends. The defaults were measured on one market"=>"stricter thresholds gave almost no ranges and looser ones shaded most of the chart."}
range_started fires when a run earns its box, and range_ended when a boxed run ends.
Limitations
- The live box repaints. A range's extent is not known until it ends, so the current box grows and its high and low widen while it is live. Boxes that have ended are final.
- The tint is early, the box is late. Shading starts on the first ranging bar. The box only appears once the run is Min Bars long.
- Defaults do not transfer automatically. Unlike the suite's ATR-based settings, the three range settings are market dependent and may need tuning.
- The start alert needs the box. range_started fires when a box is drawn, so it needs Show Box on.
- A range is not a direction. The script says the market is ranging, not which way it will leave the range.
Get Range Detection
Premium scripts are a one-time purchase in the Altrady marketplace and need a paid Altrady plan to run.
- Range / Chop Detection $7 This script on its own.
- Structure & Wyckoff bundle $29 7 premium scripts, Range Detection included.
- Altrady Complete Suite $109 All 36 premium scripts.
Frequently asked questions
A measure from Perry Kaufman that compares the net move over a window with the total distance price travelled in it. Near 0 means price went back and forth; near 1 means it went in a straight line.
The current range is still forming, so its high, low and right edge grow with it. Once the range ends, the box is fixed.
Shading marks every ranging bar, but a box is only drawn once the run lasts at least Min Bars. Short dips are treated as noise.
Two. range_started fires when a run lasts long enough to be boxed, and range_ended fires when a boxed range ends.
Yes. Range / Chop Detection is a closed-source premium script. It runs on Altrady's servers, so only its output reaches your chart and the code is never shared. You buy it once in the Altrady marketplace, on its own, in the Structure & Wyckoff bundle or in the Altrady Complete Suite, and it needs a paid Altrady plan to run. It is also included with your first annual Premium subscription.
Use the Get it in Altrady button on this page to open its listing in the Altrady marketplace. Once it is in your account, open the indicator picker on any chart in Altrady Charts and add Range / Chop Detection like any other indicator. Its settings are in the indicator's settings panel.