# Whittaker Envelope

Fits a smooth, adaptive envelope to price using Whittaker–Eilers smoothing with asymmetric least squares: the upper band bends toward peaks, the lower toward troughs, and a midline tracks the structural path between them. Band width maps volatility expansion and compression, with optional slope extrapolation. A repainting research tool for structure, not live signals.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Feb 16, 2026.
- Access: free.
- Concepts: [Whittaker–Henderson Smoother](https://www.luxalgo.com/library/concept/whittaker-henderson-smoother/) (primary), [Envelope](https://www.luxalgo.com/library/concept/envelope/), [Hodrick-Prescott Filter](https://www.luxalgo.com/library/concept/hodrick-prescott-filter/)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn7ebt00afvhsgjv2lzxy7
- Page: https://www.luxalgo.com/library/indicator/whittaker-envelope/

The **Whittaker Envelope** fits a smooth, non-linear [envelope](https://www.luxalgo.com/library/concept/envelope/) around price using Whittaker–Eilers smoothing combined with asymmetric least squares (ALS). Instead of offsetting a moving average, it solves for three curves over the last N bars: an upper band weighted toward peaks, a lower band weighted toward troughs, and a midline tracing the structural path between them. Because the fit is recomputed over the window as new bars arrive, the envelope repaints: a research tool, not a real-time signal generator.

## How to Trade the Whittaker Envelope?

- **Widening envelope**: growing distance between the bands signals expanding volatility and stronger directional movement.
- **Narrowing envelope**: compression points to consolidation or range-bound conditions.
- **Midline direction**: a rising midline frames a bullish structural bias, a falling one bearish pressure.
- **Extrapolated slope**: the projection extends the bands' trajectory forward, a reference against live action, not a prediction.

Under the hood sits a penalized fit from the family of the [Whittaker–Henderson smoother](https://www.luxalgo.com/library/concept/whittaker-henderson-smoother/); ALS asymmetry pushes each band toward one side of price, so no standard-deviation multiplier is needed.

## Whittaker Envelope Settings

- **Length**: bars in the calculation window. Shorter is more reactive, longer gives broader structure.
- **Lambda (λ)**: smoothing intensity; higher values produce stiffer, straighter bands.
- **Lower Asymmetry (p)**: how strongly the lower band hugs troughs, typically very low (e.g. 0.001).
- **Upper Asymmetry (p)**: how strongly the upper band tracks peaks, typically very high (e.g. 0.999).
- **Iterations**: ALS refinement passes; more passes fit tighter at extra computational cost.
- **Extrapolation**: how many bars of slope projection to draw.
- **Source** (default Close): the price series being fitted.

## Frequently Asked Questions

### Does the Whittaker Envelope repaint?
Yes, by design. The curve is optimized over a fixed historical window, so the entire envelope can adjust as new data enters the calculation. Treat it as a lens for volatility regimes, and pair live decisions with non-repainting confirmation.

### How does it compare to the Nadaraya-Watson Envelope?
Both wrap price in smoothing-based bands. The [Nadaraya-Watson Envelope](https://www.luxalgo.com/library/indicator/nadaraya-watson-envelope/) forms around a kernel-weighted estimate, while this build solves an asymmetric penalized fit whose bands independently chase peaks and troughs.

### Where can I get this indicator?
The Whittaker Envelope is a free release in the LuxAlgo Library. Load it onto a chart from this page, or into Quant, our coding agent, to study its behavior across markets and window lengths. 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/) (Envelope): markdown at https://www.luxalgo.com/library/indicator/nadaraya-watson-envelope.md
- [Proximal Range Filter](https://www.luxalgo.com/library/indicator/proximal-range-filter/) (Envelope): markdown at https://www.luxalgo.com/library/indicator/proximal-range-filter.md
- [Chebyshev Filters](https://www.luxalgo.com/library/indicator/chebyshev-filters/) (Trend): markdown at https://www.luxalgo.com/library/indicator/chebyshev-filters.md
- [Laguerre Filter](https://www.luxalgo.com/library/indicator/laguerre-filter/) (Trend): markdown at https://www.luxalgo.com/library/indicator/laguerre-filter.md
- [Elliptic Filter](https://www.luxalgo.com/library/indicator/elliptic-filter/) (Trend): markdown at https://www.luxalgo.com/library/indicator/elliptic-filter.md
- [Gaussian Filter](https://www.luxalgo.com/library/indicator/gaussian-filter/) (Trend): markdown at https://www.luxalgo.com/library/indicator/gaussian-filter.md
- [Swiss Army Knife Filter](https://www.luxalgo.com/library/indicator/swiss-army-knife-filter/) (Trend): markdown at https://www.luxalgo.com/library/indicator/swiss-army-knife-filter.md
- [Ehlers SuperSmoother](https://www.luxalgo.com/library/indicator/ehlers-supersmoother/) (Trend): markdown at https://www.luxalgo.com/library/indicator/ehlers-supersmoother.md

---

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