XXUANTIFYInvite a friend

Meet the Maker: Range Detector by LuxAlgo

LuxAlgo turns chart-reading habits into tidy code. Range Detector, from October 2023, takes on one of the oldest: boxing in a market that is going nowhere. It is about a hundred lines long and had 14,306 likes in July 2026. It reproduced exactly on every chart we measured, so it is a good place to ask what a range is and what followed a break.

BTC daily candles over the past year with Range Detector boxes and their coloured edge lines
Few boxes in a year of daily candles, and their edges stay on long after.

Key takeaways

An exact copy with no repainting: the plots match the original on all four charts

Calm by design: on BTC daily it changes colour about 6 times a year, mostly in quiet markets

On hourly charts upward breaks tended to fade: on BTC price was higher 10 bars later after 41% of them, against 51% for any bar (148 breaks)

Daily breakouts are too few to judge: 12 to 16 per direction since mid-2022

The idea

LuxAlgo describes a range as a stretch of stationarity: price moving back and forth inside fixed limits. The script hunts for it the way a trader does by eye, only with a strict test. It takes the average close of the last 20 bars and draws a band one ATR (average true range, the typical size of a bar) above and below it. If every one of those 20 closes sits inside the band, a range is born. The ATR is measured over 500 bars, so the yardstick is long-run volatility rather than last week's: a range appears when the market has gone quiet by its own historic standard.

At that moment the script shades the bar grey and draws the box back to where the 20-bar window began, with a dotted midline. The author says openly that the box is placed retrospectively. The code only draws it once the test has passed, and our check found no repainting: nothing already on the chart changes later. When a new range overlaps the previous one, the two merge and the edges widen.

Then the edges live on. Blue means unbroken; a close above the top turns them green, a close below the bottom turns them red. They extend until the next range appears, so old limits stay visible as possible support and resistance, which is how the author suggests using them. There are only three settings: the minimum range length, a width multiplier and the ATR length.

Two markets, two speeds

We measured from mid-2022 on the daily charts (the 500-bar ATR needs a warm-up first) and from January 2025 on the hourly charts, both to mid-October 2026.

On the daily charts Range Detector is unhurried. BTC produced about 2 ranges a year, with a median box height of about 11% of price; ETH about 2.6 a year at about 16%, so ETH's ranges are looser. The edge colours switched about 6 times a year on both coins, and a colour typically held for about 22 days. The script lives up to its name in quiet markets: on BTC daily it switched about 3 times per 100 bars when volatility was calm, against 0.3 when it was wild. Every daily range edge was reached again later, and nearly all were eventually closed through: 14 of 15 on BTC, all 18 on ETH.

BTC hourly candles over 15 days with many narrow Range Detector boxes and frequently crossed edges
On the hourly chart the same rule draws a new box every few days and the edges flip colour far more often.

The hourly charts run the same rule at a much faster beat: about 92 ranges a year on BTC and 95 on ETH, with boxes about 1.4% and 2.2% tall, and around 235 colour switches a year. A colour still held for a median of about 22 bars, roughly a day.

Here there are enough breaks to measure what came next. On both coins, a close above the range top was followed by a higher price 10 bars later less often than an ordinary bar: 41% against 51% on BTC (148 breaks) and 43% against 52% on ETH (141 breaks). The fade was strongest in calm hours, at 35% on BTC (82 breaks) and 34% on ETH (61 breaks). Downward breaks split by coin: on BTC they faded too (price lower 10 bars later 39% of the time against 49%, 148 breaks), while on ETH they followed through (lower 5 bars later 59% of the time against 49%, 142 breaks). On the daily charts each direction had only 12 to 16 breaks, too few to say anything.

ETH hourly candles over 15 days with Range Detector boxes slightly taller than on BTC
ETH hourly follows the same rhythm with somewhat wider boxes; watch what price did after each close above a top edge.

The bottom line

Range Detector is a faithful, calm and original tool: its lines are its own, not a classic moving average in disguise. Its measured strength is the map, not the trigger. It marks where the market went quiet and keeps those limits in view. On the hourly charts the first close beyond an upper edge was more often a test than a launch, so the box suits framing a trade better than firing one.

The author could build on that with an optional confirmation, such as a second close beyond the edge or a retest, and with alerts for a new range and for each break.

For more on how quiet and wild markets change a signal, read Does volatility change a signal?, meet another calm-state maker in Supertrend by KivancOzbilgic, or browse the latest measured scripts.

We measured Range Detector with LuxAlgo's default settings on BTC and ETH, on daily and hourly charts; your own settings or market may behave differently.

This article is education, not investment advice.

Every test here counts trading costs, runs on many markets and compares the result with just holding the same market. A result is a starting point, not a verdict. How we test

Newsletter

New tests, now and then.

Only for this newsletter; we send a mail to confirm first, and every mail has a link to stop. Privacy