Nadaraya-Watson envelopes: kernel smoothing on a chart, and how some versions repaint
Posted: Mon Nov 23, 2026 9:21 am
Nadaraya-Watson envelopes became popular on charting platforms in the last few years. They look like a smooth curve through price with bands on either side, and in historical examples price often seems to turn exactly at the bands. It is worth understanding the method behind them, because that explains both the appeal and the main trap.
Nadaraya-Watson is a kernel regression technique. To estimate the "fair" value at a point, it takes a weighted average of nearby prices, with weights that fall off smoothly with distance. A Gaussian kernel is the usual choice, and a bandwidth parameter controls how wide the weighting is. Envelopes are then drawn at some multiple of the average deviation from that curve.
The trap is in the word "nearby". In the textbook form, nearby means on both sides, including points after the one being estimated. A curve calculated that way uses future prices, so historical turns line up beautifully with the bands. But at the right edge of the chart there are no future prices, so the last part of the curve keeps changing as new bars arrive. Some popular scripts redraw past values in this way unless a non-repainting mode is selected. On a static chart this looks like a remarkably accurate tool; in live trading the signals appear in different places.
A non-repainting version only uses past data at each point. That is a legitimate smoother, closer to a weighted moving average with a particular weight shape, and it lags like one.
If you want to test one honestly:
- Use only the non-repainting calculation.
- Record signals in real time or with a bar-by-bar replay, not from a finished chart.
- Compare it with a plain moving average and standard deviation band of similar smoothness. If the results are the same, the kernel is not adding anything.
Has anyone forward-tested the non-repainting version? I'd be interested in whether the band touches still looked as useful once the future data was removed.
Nadaraya-Watson is a kernel regression technique. To estimate the "fair" value at a point, it takes a weighted average of nearby prices, with weights that fall off smoothly with distance. A Gaussian kernel is the usual choice, and a bandwidth parameter controls how wide the weighting is. Envelopes are then drawn at some multiple of the average deviation from that curve.
The trap is in the word "nearby". In the textbook form, nearby means on both sides, including points after the one being estimated. A curve calculated that way uses future prices, so historical turns line up beautifully with the bands. But at the right edge of the chart there are no future prices, so the last part of the curve keeps changing as new bars arrive. Some popular scripts redraw past values in this way unless a non-repainting mode is selected. On a static chart this looks like a remarkably accurate tool; in live trading the signals appear in different places.
A non-repainting version only uses past data at each point. That is a legitimate smoother, closer to a weighted moving average with a particular weight shape, and it lags like one.
If you want to test one honestly:
- Use only the non-repainting calculation.
- Record signals in real time or with a bar-by-bar replay, not from a finished chart.
- Compare it with a plain moving average and standard deviation band of similar smoothness. If the results are the same, the kernel is not adding anything.
Has anyone forward-tested the non-repainting version? I'd be interested in whether the band touches still looked as useful once the future data was removed.