XXUANTIFYInvite a friend

Nadaraya-Watson Liquidity Sweeps Under the Microscope

Can one tool show the trend's pulse and also mark the levels a market comes back to? That is the idea behind AlgoAlpha's Nadaraya-Watson Regression Liquidity Sweeps. We found an oscillator that holds its colour for weeks on the daily chart, never rewrites its past, and draws levels price later reached most of the time. Its buy and sell marks, though, showed no clear edge.

A glowing regression curve through candles with a volatility band, a swept horizontal level above it and a green-and-red oscillator below
The script in one picture: a smooth curve, a level from an old swing high, and the momentum wave underneath.

Key takeaways

Calm on the daily chart: about 5 colour switches a year on BTC, median phase of 51 days

Faithful: every plotted line matches the original exactly on all four charts, no repainting

Levels that get reached: on BTC daily, 84% of its liquidity lines were later touched

No signal was clearly better than any bar; on hourly charts the clear cases leaned against it

Scorecard

Faithful

Checked against the original: lines exact on BTC and ETH, daily and hourly; the drawn levels differ slightly.

Repainting

None. The curve is built only from bars that have already closed.

Calm

BTC daily 5.3 switches a year, median run 51.5 bars; ETH daily 4.6 a year, 59 bars.

Edge

No signal clear in its favour on any chart; three hourly cases clear against it at 5 bars.

What the author built

AlgoAlpha describes the script as three tools in one workflow. A Nadaraya-Watson regression, a kernel smoother that gives nearby bars more weight than distant ones, draws a smooth curve under price. The slope of that curve, scaled by its own recent volatility, becomes a momentum oscillator with a signal line. When momentum starts to fade after a run, the author's idea is to mark the swing high or low of that run as a "liquidity level", a place where stop orders may be resting and that price may later come back to sweep.

In the code it works like this. The curve averages the last 140 closes with bell-shaped weights (bandwidth 30), always looking backwards. Its bar-to-bar change is divided by its 100-bar standard deviation, smoothed with a 21-bar weighted average, and given a 14-bar EMA as signal line. When the oscillator is above zero and crosses below its signal, the script draws a red line at the highest high of the phase that just ended; the mirror case draws a green line at the lowest low. A level counts as swept when a bar closes beyond it. Rebound marks appear when price closes back across the curve while the oscillator still points the same way.

What we measured

We ran the script with its author's default settings on BTC and ETH perpetuals: daily charts from late 2019 to mid-October 2026, hourly charts from January 2025 to mid-October 2026.

BTC daily chart with the script's coloured candles, regression band and liquidity lines, with markers at a zero cross, a signal cross and a weakening-momentum level
Look at how long each colour holds, and at the red level drawn when momentum faded in October 2026.

Behaviour. The oscillator's colour is its main state, and on the daily chart it is patient: 5.3 switches a year on BTC with a median run of 51.5 bars, and 4.6 a year on ETH with a median of 59 bars. Only about 3% of BTC daily runs were short ones. On the hourly charts it switches far more often, about 149 times a year on BTC and 161 on ETH, yet a phase still lasts a median of 44 to 46 hours. The weakening-momentum dots never flipped to the opposite dot within three bars on any chart. On the daily charts the colour agreed with the market's trend about 83% of the time on BTC and 78% on ETH, against roughly 51% by chance; on hourly charts that agreement fell to about 53%.

The levels. BTC daily produced about 7 levels a year; 84% were later touched and 80% closed through. ETH daily showed the same 84% and 80%. On hourly charts, about 95% (BTC) and 93% (ETH) of levels were touched. Our reproduced drawings differ slightly from the original's, so read these shares as close, not exact.

Reliability. Every plotted line matched the original to within a millionth on all four charts, and there is no repainting. The oscillator moves like a slower RSI (correlation 0.92 with RSI(30) on BTC daily, about five bars behind) but is not mathematically one: it is its own idea.

After the signals. None of the signals was clearly better than any random bar on any chart. Daily signals are few (19 to 47 per type over seven years), so most are too thin to judge. On hourly charts three cases were clear but went against the signal over five bars: the bullish zero cross on BTC (41% up versus 51% for any bar, 133 signals) and on ETH (42% versus 51%, 145 signals), and the bearish signal cross on ETH (42% versus 49%, 293 signals). Zero crosses tend to arrive late, a median of about 12 bars after the turn.

Where it shines, and where it is quieter

Where it shines

The daily charts. Colour phases last a median of 51.5 bars on BTC and 59 on ETH, and agree with the trend about 83% (BTC) and 78% (ETH) of the time. Its levels were reached 84% of the time on both coins. The whipsaw test found no dot reversed within three bars on any chart.

Where it is quieter

The hourly charts. Around 150 to 160 colour switches a year, trend agreement near chance (about 53%), and hourly levels are so likely to be touched (93 to 95%) that being touched says little. As a buy or sell trigger it showed no clear edge anywhere, and after hourly zero crosses price leaned the other way over five bars.

Make it better

One measured change helped: take only signals in the direction of the 50-day trend, skip wild markets, and give each trade a fixed exit instead of waiting for the opposite signal. Judged after costs on a stretch not used to choose it, BTC hourly went from −23% to +2% (deepest fall from 33% to 19%), and ETH hourly from −15% to +19% (34% to 21%). Holding BTC over the same stretch returned +22% (deepest fall 29%), holding ETH +18% (38%). So on BTC the filter turned a loss into a small gain that still trailed holding; on ETH it finished near holding with a shallower fall. Random signals improved with this rule too, so read it as a rule of the market in this period more than a finding about this script.

A practical hint: on the daily chart, nine in ten winning signals stayed within 5% of their entry against them, so a stop just beyond that leaves the winners alone.

The bottom line

AlgoAlpha has built a faithful, non-repainting momentum map that is at its best on the daily chart: long, calm colour phases that follow the trend, and levels that price returned to most of the time. Use it as context, where momentum stands and which old swing still matters, rather than as a trigger. A natural next step for the author would be a trend filter on the signals, and a way to show which levels are still fresh. More from the same author: our look at AlgoAlpha's Trend Reversal Probability and the battle CCI vs Stochastic Z-Score. New reports land on the latest page.

All of this was measured with the author's default settings on BTC and ETH, daily and hourly; 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