Concept

Standard-error Channel

Standard-error Channel, also known as Raff channel, is a Trend concept. The Library holds 1 implementation, a working definition you can pull into Quant.

The standard Standard-error Channel indicator

Standard-error Channel exactly as classically defined: the faithful reference build of the original formula, free to run in Quant.

What is a Standard-error Channel?

A standard-error channel is a linear regression line drawn through a lookback window with parallel bands offset above and below by a multiple of the standard error of estimate, the statistic measuring how far prices typically sit from the fitted line. Unlike bands based on the standard deviation of price itself, the standard error measures dispersion around the trend, so the channel stays narrow when price hugs its regression line and widens when the fit is loose, whatever the slope.

The Raff regression channel, which Gilbert Raff described in the early 1990s, is the closely related variant some platforms group under the same name: instead of a statistical offset, it widens the parallels just enough to enclose the furthest high or low from the regression line. Both versions refit as new bars arrive, so the drawn channel changes across the window, and the common two-standard-error convention contains most, not all, of the price action inside it.

Mechanically, the standard error of estimate is the square root of the average squared residual, adjusted for the two parameters the regression consumes (slope and intercept). Because the bands are symmetric around a sloped centerline, the channel expresses trend and dispersion in one object, unlike an MA envelope, whose fixed-percentage width never reflects fit; and because residuals shrink when price tracks its trend cleanly, width doubles as a readout of trend quality, a tight channel marking an orderly trend and a ballooning one a trend losing definition.

The channel turns an eyeballed trendline into a repeatable, parameter-defined object: two traders with the same window and multiplier draw the same channel. It slots into trend workflows alongside tools such as an MA slope filter or a trend regime label, with the outer bands watched for the overextensions and breakouts that end or accelerate the fitted trend.

How to identify a standard-error channel on a chart

Platforms draw the channel from two clicks; the real decision is the window.

  1. 1Anchor the window at a meaningful origin, typically the swing that started the current leg, and end it at the current bar.
  2. 2Apply the standard-error (or Raff) channel tool; the platform fits the least-squares line and offsets the parallels, with two standard errors a common default.
  3. 3Check the fit: price should cross the centerline repeatedly rather than living on one side, and the bands should hold the bulk of bars; if not, the window likely spans more than one trend.
  4. 4Watch the interactions: tags of the outer bands, closes beyond them, and behavior at the centerline, which often acts as the trend's equilibrium.
  5. 5Re-anchor after a confirmed reversal, since a channel fitted across two opposing legs describes neither.

How it's calculated

A linear regression line fitted to the lookback window with parallel bands offset by a multiple of the regression's standard error.

yt=a+b×t, with a and b fitted by least squares to the last n closesy_t = a + b \times t \text{, with } a \text{ and } b \text{ fitted by least squares to the last } n \text{ closes}
SE=(Ctyt)2n2Σ taken over the n bars in the window\mathrm{SE} = \sqrt{\frac{\sum (C_t - y_t)^2}{n - 2}} \text{, } \Sigma \text{ taken over the } n \text{ bars in the window}
Uppert=yt+k×SE\mathrm{Upper}_t = y_t + k \times \mathrm{SE}
Lowert=ytk×SE\mathrm{Lower}_t = y_t - k \times \mathrm{SE}
C_t: closing price at bar t
t: bar index within the regression window
n: regression length in bars (no single standard; platform presets range from 21 to 100)
a: least-squares intercept
b: least-squares slope
y_t: regression line value at bar t
SE: standard error of the regression estimate
Σ: sum over the stated range
k: standard-error multiplier (default 2)
Upper_t: upper channel line
Lower_t: lower channel line

The Raff Regression Channel is the related variant that sets the parallels at the greatest distance price traded from the regression line in the window instead of at k standard errors.

Some implementations divide by n rather than n - 2 when computing SE.

Unless anchored, the regression is refit on every new bar, so previously plotted values change.

How traders use it

  • As a trend-following frame: while price holds inside the channel the regression trend is treated as intact, and closes beyond a band flag either an overextension or the start of a trend change worth confirming before acting.
  • As a fit-quality gauge: narrow bands mean the move is orderly and regression-based levels are meaningful, while wide bands warn that the linear fit explains little of the recent movement.
  • As anchored geometry from a swing: starting the window at a significant low or high makes the channel express that leg's trend, with the outer bands then watched as sloped support and resistance.
  • As a pullback map: in a rising channel, entries are hunted near the lower band or centerline rather than at the upper band, a sloped analogue of buying dips at dynamic support.
  • As a crossover filter: taking moving average crossover signals, such as an EMA crossing an SMA, only when they agree with the channel's slope.

Standard-error channel vs. related trend tools

Trendline: A trendline connects chosen extremes by hand; the channel is fitted to every close in the window by least squares. The trendline is subjective but fixed once drawn, the channel objective but refit on each bar.

MA Envelope: An envelope offsets a moving average by a fixed percentage, so its width never adapts; the standard-error channel's width comes from the actual scatter around the trend, tightening and widening with fit quality.

Supertrend: Supertrend is a stateful stop-and-reverse line that flips on ATR-sized breaks; the channel is a descriptive fit with no flip logic. One is a signal device, the other a lens on the trend's shape.

Concept family

Trend

100 concepts mapped · 100 in the Library

Standard-error Channel FAQ

Turn Standard-error Channel into a trading strategy.

Take the implementation from this page into Quant, then build on it, backtest it on real data, and keep refining it in conversation.