Charts See the terminal

Standard Error Bands

Bands around a regression line, set by how closely price follows that line, so narrow bands mark an orderly trend rather than a quiet market.

Volatility Add to chart

Live Standard Error Bands preview · BTC/USDT · Binance

What is Standard Error Bands?

Standard Error Bands fit a straight line through the last 21 closes and draw its value at the current bar as the middle line. Bands sit above and below it at two standard errors, a measure of how far price has strayed from that fitted line. All three lines are lightly smoothed and the area between the bands is shaded. Because the middle line carries the slope of the fit, the bands tilt with the trend rather than lagging behind it like a moving average.

Standard Error Bands describe how orderly recent price has been around its own trend line. Narrow bands do not mean a quiet market, and the bands do not predict when a trend will end.

How to use Standard Error Bands

  • Narrow bands. Price is tracking its own trend line closely, which is what a strong, orderly trend looks like. This is the opposite of reading narrow Bollinger Bands as a quiet range.
  • Widening bands. Price is scattering around its line. The trend is becoming disorderly, or price is moving sideways in swings.
  • The middle line's slope. The basis is the end point of a straight-line fit, so its direction shows which way the window has been trending.
  • Price outside a band. Price has moved well away from the line it had been following, which can mark the start of a change in pace or direction.

These are ways to read the bands, not entry signals on their own.

Settings

SettingDefaultWhat it changes
Length21 Bars the regression line is fitted through. Shorter tracks recent changes sooner; longer judges the trend over a broader stretch. Minimum 3.
Errors2 How many standard errors each band sits from the middle line. Higher puts the bands further out; lower brings them in. From 0.001 to 50.
Smoothing3 Bars of simple averaging applied to each finished line. More smoothing removes jitter but adds lag; 1 turns it off. Minimum 1.
SourceClose Which price each bar contributes. Open, high, low and the averaged sources such as hl2 and hlc3 are also available.

Adjust the regression window, band width, smoothing and source in the indicator settings.

Calculation

Each bar, the indicator fits an ordinary least-squares line through the last Length values, measures the scatter around it, and builds the bands from those two numbers:

fit       = least-squares line through the last 21 closes
mid       = value of the fit at the current bar
std error = sqrt( sum of (close - fit)^2 / (21 - 2) )
upper     = SMA(mid + 2 * std error, 3)
basis     = SMA(mid, 3)
lower     = SMA(mid - 2 * std error, 3)

The standard error divides by Length minus 2 because fitting a line uses up two degrees of freedom, one for its level and one for its slope. That is why Length has a minimum of 3.

The smoothing is applied to the three finished lines, not to price. The fit is redone on every bar, which makes its end point jump slightly from bar to bar, and three bars of averaging takes that jitter out without adding much lag. The first values appear once the fit has Length bars and the smoothing has its own window of fitted values on top.

Limitations

  • The reading is inverted from other bands. Narrow means orderly trend here, not calm. Carrying over habits from Bollinger Bands leads to the wrong conclusion.
  • It assumes a straight line. A move that curves, such as an accelerating rally or a rounded top, leaves scatter around a straight fit and widens the bands even when the move is orderly.
  • The end point is the least stable part of a fit. A single large bar tilts the whole line and moves the middle line more than it would move an average. The smoothing reduces this but does not remove it.
  • The live candle moves. The current bar's fit, bands and middle line change until that bar closes.
  • It is not a strategy. The bands carry no risk management, sizing or exit rule of their own.

Frequently asked questions

Standard Error Bands are a pair of bands around a regression line. The middle line is the current end point of a straight line fitted through recent closes, and the bands sit a set number of standard errors either side, where standard error measures how far price has strayed from that line.

Narrow bands mean price is following its trend line closely, which is the sign of a strong, orderly trend. Wide bands mean price is scattering around the line. The slope of the middle line shows the trend's direction. This is the reverse of Bollinger Bands, where narrow bands mean a quiet market.

Yes. The indicator declares four inputs: Length, default 21 with a minimum of 3; Errors, default 2, from 0.001 to 50; Smoothing, default 3 with a minimum of 1; and Source, default close. Open the indicator's settings on the chart to change them.

No. The fit is redone on every bar using only that bar and the ones before it, and each bar keeps the end point it had, so values on closed bars are not revised. The current candle's lines move while that candle is live and settle when it closes.

Bollinger Bands centre on a moving average and set their width by the scatter around the window's mean. Standard Error Bands centre on a regression line, which tilts with the trend, and set their width by the scatter around that line. A steady trend widens Bollinger Bands but narrows Standard Error Bands.

Use the Add to chart button at the top of this page. It opens BTC/USDT on Binance in the Altrady Charts terminal with the built-in Standard Error Bands already applied. On any other market, open the indicator picker on the chart and choose Standard Error Bands from the Volatility group.

Add to chart