# Nadaraya-Watson Smoothers

The Nadaraya-Watson Smoothers fit a Gaussian kernel regression through price, with smoothness set by a bandwidth input instead of a window length. Toggle between a non-repainting endpoint estimate that reads like a moving average and a repainting fit that labels every directional turn, built for traders who study trend structure.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Aug 24, 2021.
- Access: free.
- Concepts: [Kernel Regression](https://www.luxalgo.com/library/concept/kernel-regression/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn40zf005mvhsg59bogg6d
- Page: https://www.luxalgo.com/library/indicator/nadaraya-watson-smoothers/

**Nadaraya-Watson Smoothers** runs Gaussian [kernel regression](https://www.luxalgo.com/library/concept/kernel-regression/) over price, so smoothness comes from a bandwidth parameter rather than a lookback length. A single toggle switches between two estimators: a causal endpoint version that behaves like a conventional moving average, and a repainting version that re-fits its whole history to expose the underlying price path and stamp every change of direction.

## How to Trade the Nadaraya-Watson Smoothers?

- **Endpoint mode rising or falling**: with *Repainting Smoothing* off, an ascending smoother suggests an uptrend and a descending one a downtrend, read exactly as you would a moving average.
- **Triangular labels**: in repainting mode, labels mark each point where the estimator turns, framing candidate tops and bottoms against the actual price series.
- **Bandwidth as the lens**: raise it to study longer-term structure; lower it to follow local swings.

Because the repainting fit re-estimates earlier points once newer bars exist, recent labels can resettle while data is still arriving. Several may print in real time before the latest one holds. Treat that mode as an analysis surface for trend structure and turning points, and lean on the endpoint mode whenever you need output that never rewrites itself.

## Nadaraya-Watson Smoothers Settings

- **Bandwidth**: width of the Gaussian kernel: larger values spread weight across more bars for a smoother, flatter estimate, while very small values hug price until the output is nearly raw.
- **Src**: the price source fed to the kernel regression.
- **Repainting Smoothing**: enables the two-sided repainting estimator; disabled, the indicator plots the causal endpoint Nadaraya-Watson estimate.

## Frequently Asked Questions

### Why do the labels move after they appear?

In repainting mode the kernel assigns weight to bars after a point as well as before it, so fresh data shifts the estimate and can relocate recent labels. That is the cost of the cleaner fit; the endpoint mode never revises a printed value.

### How does it differ from the Nadaraya-Watson Envelope?

The Smoothers plot the kernel estimate itself so you can read direction and turning points, while the [Nadaraya-Watson Envelope](https://www.luxalgo.com/library/indicator/nadaraya-watson-envelope/) wraps bands around the same style of fit to frame price extremes. Reach for the Smoothers when the trend line itself is the object of study.

### Is the Nadaraya-Watson Smoothers indicator free?

Yes. It is a free release in the LuxAlgo Library. You can also load it into Quant, our coding agent, straight from this page and experiment with bandwidth values on your own data. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [Nadaraya-Watson Envelope](https://www.luxalgo.com/library/indicator/nadaraya-watson-envelope/) (Kernel Regression): markdown at https://www.luxalgo.com/library/indicator/nadaraya-watson-envelope.md
- [Machine Learning: Gaussian Process Regression](https://www.luxalgo.com/library/indicator/machine-learning-gaussian-process-regression/) (Kernel Regression): markdown at https://www.luxalgo.com/library/indicator/machine-learning-gaussian-process-regression.md
- [Machine Learning: Anchored Gaussian Process Regression](https://www.luxalgo.com/library/indicator/machine-learning-anchored-gaussian-process-regression/) (Kernel Regression): markdown at https://www.luxalgo.com/library/indicator/machine-learning-anchored-gaussian-process-regression.md
- [Gaussian Volume Profile](https://www.luxalgo.com/library/indicator/gaussian-volume-profile/) (Kernel Density Estimation): markdown at https://www.luxalgo.com/library/indicator/gaussian-volume-profile.md
- [KDE Value Clouds](https://www.luxalgo.com/library/indicator/kde-value-clouds/) (Kernel Density Estimation): markdown at https://www.luxalgo.com/library/indicator/kde-value-clouds.md
- [Structural SVM Ranker](https://www.luxalgo.com/library/indicator/structural-svm-ranker/) (Support Vector Machines): markdown at https://www.luxalgo.com/library/indicator/structural-svm-ranker.md
- [Decision Trees](https://www.luxalgo.com/library/indicator/decision-trees/) (Machine Learning): markdown at https://www.luxalgo.com/library/indicator/decision-trees.md
- [Gradient Boosting](https://www.luxalgo.com/library/indicator/gradient-boosting/) (Machine Learning): markdown at https://www.luxalgo.com/library/indicator/gradient-boosting.md

---

Source: https://www.luxalgo.com/library/indicator/nadaraya-watson-smoothers/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
