You scroll back through the chart and the band looks uncanny. Every swing high brushes the upper line, every low taps the lower one, and the trades that would have paid you are sitting there in plain sight. So you wait for the next touch, take it live, and by the time the candle closes the line that triggered you has quietly slid to a different price. Your read was fine. The line moved.
Here is what that behaviour actually is, why it is baked into the maths rather than bolted on by a sloppy coder, and what the envelope is still genuinely good for once you stop asking it for entries.
Key Findings
- It is a smoother, not a forecaster: the curve is a weighted average of surrounding bars, with the nearest bars counting most and influence fading with distance.
- It sees both directions: each point is fitted using bars before and after it, which is exactly why the historical fit looks so clean.
- The right edge is unfinished: the newest part of the curve has no bars to its right yet, so it keeps adjusting until enough candles close around it.
- Use it for stretch, not for triggers: read distance from the curve as context, and put the entry decision on a level that is final at the close.
Why does the Nadaraya-Watson envelope fit price so well?
Because it is not trying to predict anything. It is drawing the smoothest line it can through data it can already see, in both directions.
The mechanism is kernel regression, published independently in 1964 by Elbekhan Nadaraya and Geoffrey Watson, which is where the name comes from. Statisticians reach for it when they want a curve through a scatter of noisy points without committing to a straight line or a formula. For each point on the curve it takes a weighted average of the observations around it, giving heavy weight to the closest ones and tapering that weight off with distance. The bandwidth setting is what controls how far that reach extends.
Put that on a price chart and one difference from a moving average matters more than everything else. A moving average at any bar can only use the bars behind it. A kernel smoother uses the bars on both sides. In the middle of your chart, the bars on the “after” side are settled history, so the curve there is finished and will never move again. At the right-hand edge, the bars on the after side have not printed yet. The curve is being drawn from half a window, and it revises itself with every close until the window fills in.
What are the bands actually measuring?
Distance from that centre curve, scaled to what counts as a normal distance on this chart.
The envelope takes the typical gap between price and the smoothed line, multiplies it by a factor you set, and draws the result above and below. So a touch of the upper band is not a sell signal. It is a statement that price has stretched further from its recent average path than it usually does. What happens next depends entirely on whether the market is rotating or trending, which the envelope has no opinion about.
Most traders go straight for the multiplier when the touches feel wrong. That is the wrong dial. Bandwidth is the setting that changes the character of the tool: widen it and the curve stops caring about small swings, narrow it and the curve chases every wiggle until the bands are meaningless. The multiplier only decides how often price pokes through a curve you have already chosen.
How does it compare with the bands you already use?
| Nadaraya-Watson envelope | Bollinger Bands | Keltner channel | |
|---|---|---|---|
| Centre line | Kernel-smoothed curve through price | Simple moving average | Exponential moving average |
| What sets the width | Typical distance from the curve, times a multiplier | Standard deviation of price | Average true range |
| Uses bars from both sides | Yes, in the standard version | No | No |
| Final when the bar closes | No, near the right edge | Yes | Yes |
| Reads best as | How stretched price is from its recent path | Volatility expansion and contraction | Trend containment and breakout |
One row decides this. Bollinger and Keltner values are finished the instant a candle closes, so you can build a rule on them and test it honestly. The Keltner channel guide covers that containment read, and the Bollinger squeeze method the volatility angle. The kernel envelope wins on how good the fit looks and loses on when you can trust it.
RelicusRoad Pro
Have you been trading for a while but have never made consistent profits or are you new to FOREX trading and want to get a head start? Try RelicusRoad and you'll never look back.
Get RelicusRoad ProWhere does the repainting actually bite?
In your backtest, not in the maths. The curve is doing exactly what kernel regression is supposed to do.
The version most traders load is the TradingView script published by LuxAlgo in 2022, and its own description flags the recalculation openly. The same author later released a non-repainting variant restricted to bars that have already closed. None of this is hidden. It is a documented property most traders scroll past.
The damage happens when you judge the tool by looking backwards. Every historical touch you count came from a curve that had the benefit of the candles printed after it. You are grading the indicator on an exam it took with the answers in front of it. At the hard right edge it sits the same exam blind, and the hit rate you talked yourself into does not survive. Worth asking of anything that draws on your chart, and the full mechanism is laid out in the piece on how repainting indicators fake backtests .
So how do you use it without lying to yourself?
Demote it. The envelope is a context layer, and it is a good one.
Read it for stretch and bias. Price riding the upper band for a long run tells you the market is trending hard, not that a reversal is due. Price snapping back to the centre curve again and again tells you rotation is the base case. Both readings survive a curve that shifts a little, because you are reading a shape rather than a price.
What does not survive is a rule that hangs on the exact band value at the moment you click. If you want that, load a version limited to closed data and accept the trade-off: it looks worse, reacts later, and hands you far fewer of the beautiful touches. That is not the indicator getting weaker. That is you finally seeing what it knew at the time. The walkthrough on non-repaint forex indicators has the verification method in full.
What to reach for when the level has to hold still
A smoothed curve is a description of where price has been. An entry needs something that has stopped negotiating.
RelicusRoad Pro is built around that split. Its levels and signals lock at the candle close and stay at the price they printed, so a screenshot you take tonight matches the chart you reload next week. Keep a kernel envelope up for stretch if you like the visual, and hang the decision on a mark that will not have drifted by the time your order fills. It will not tell you how much to risk, and no line on a screen ever will. What it removes is the one doubt this whole article is about: whether you are looking at a finished read or a work in progress.
Frequently asked questions
What is the Nadaraya-Watson envelope?
It is a chart overlay that fits a smooth curve through price using kernel regression, then draws an upper and lower band a set distance either side of that curve. The curve is a weighted average: for each point on the chart it looks at surrounding bars and gives the closest ones the most influence, fading that influence out with distance. The band width is usually derived from how far price typically strays from the curve, scaled by a multiplier you choose. Traders use it to see stretch, because price poking outside the envelope stands out as an unusual distance from the recent average path.
Does the Nadaraya-Watson envelope repaint?
The widely used TradingView version does, and its own script description says so. The reason is structural rather than a bug: the smoother weights bars on both sides of each point, so the curve near the right-hand edge is built from an incomplete window and keeps adjusting as new candles close. Older sections of the curve settle and stop moving once enough bars sit either side of them. A non-repainting variant exists that restricts the calculation to data already closed, and it is the version to use if you intend to act on band touches rather than just read context.
What bandwidth setting should I use on the Nadaraya-Watson envelope?
There is no universally correct number, and anyone quoting one has skipped the part that matters. Bandwidth controls how far the weighting reaches, so a larger value produces a lazy curve that ignores small swings and a smaller value produces a curve that hugs every wiggle. Match it to the swing size you actually trade on that instrument and timeframe, then leave it alone. Retuning the bandwidth after a run of losses is curve-fitting by another name, and it is the most common way traders make this indicator worse.
Is the Nadaraya-Watson envelope better than Bollinger Bands?
They answer different questions. Bollinger Bands centre on a simple moving average and set width from standard deviation, so they widen and contract with volatility and every value is final the moment the bar closes. The Nadaraya-Watson envelope centres on a smoother that fits the path of price more closely, which makes historical touches look cleaner, but the newest section of that curve is still provisional. If you want a volatility read you can act on at the close, Bollinger Bands are the safer tool. If you want a visually cleaner sense of where price sits relative to its recent path, the kernel envelope reads better.
Can you use the Nadaraya-Watson envelope on MT4 or MT5?
It started life as a TradingView community script, which is where most traders meet it, but ported versions circulate for MT4 and MT5. Quality varies a lot between ports, and the port cannot fix the underlying issue. Whichever platform you load it on, run the same check before trusting it: step the chart forward bar by bar and watch whether the band you would have traded stays where it was. If it moves, the port has copied the recalculating version.
Want the band on your chart and the decision on something settled? See how RelicusRoad Pro fixes its levels at the close on MT4, MT5, and TradingView.