Standard Error Bands

Many of the charts shown in the articles on this blog have standard error bands on them. These bands can suggest much more information regarding trend direction and trend persistence than moving averages.

Many traders are familiar with and use Bollinger Bands. Bollinger bands can supply much useful information about price expansion and contraction, which is quite cyclical. A contracted market will normally return to an expansive market, and visa versa. John Bollinger calls the market being in a squeeze when his bands are tight, and the probability is that they will expand back out as the market breaks out of its compressed state. Bollinger bands are based on standard deviation, usually two, above and below a simple moving average.

Standard Error bands are quite different. First, they are bands constructed around a linear regression curve. Second, the bands are based on two standard errors above and below this regression line. The error bands measure the standard error of the estimate around the linear regression line. Therefore, as a price series follows the course of the regression line the bands will narrow, showing little error in the estimate. As the market gets noisy and random, the error will be greater resulting in wider bands.

To understand this better it is best to start with the linear regression line itself. Refer to the following chart.

The above chart shows the linear regression line, which is the straight yellow line. It is the best fit of all the closing prices of the current and preceding 30 bars. The slope of the line in this case is down. If you scattered the prices randomly and tried to draw a line that would best describe the directional tendency of that random scatter, you would get a line that is the best fit. You would expect further prices to be related in some way to the probability that this line suggests. However, as the market moves forward, the random scattering can change direction.

The above chart is the same security advanced by about a week. You can see that prices had an upmove, so the same 30 bar linear regression line has now advanced forward and is now trying to create a best fit on this 30 bar series, with the resulting upward slope in the line. This is not just averaging prices. It is fitting a current line through past price to create a probability forecast as the line is extended forward. As each day progresses the line is advanced to the next 30 bar best fit. (The 30 period parameter is just used here for illustration purposes. Any parameter can be used.) If the chart were filled with a new horizontal line on each bar, the chart would get very cluttered. Therefore, it is common to use a linear regression curve, which is the end point of each linear regression line, with the rest of the line dropped off. The resulting cyan colored line is the same 30 bar linear regression, but instead of a straight line, it is now a moving curve. The blue arrows in this chart, as well as the previous chart, show the intersection of the straight yellow regression line, and the same point as expressed by the regression curve.

This regression curve is the center line in all the error bands examples. The dashed lines above and below the curve are the error bands. It is helpful to use a moving average on the regression curve to help smooth out some of the bumps when applying the bands. The examples shown in this article tend to be mostly longer term, with regression values ranging from 50 to 125, and with the smoothing ranging from 10 to 40. The smoothing can also be changed from a simple average to any other method. Experiment with various values until you find what works best for what you are trying to accomplish with the bands. Jon Anderson, the first person I knew about who used this method, used a 21 period on the regression curve, with a 3 period simple moving average smoothing. TradeStation uses that as the default in their indicator. I mostly use much longer periods.

The above chart shows a longer-term regression curve with the standard error bands above and below. Point 1 shows an uptrend marking a nice impulse move up. The bands were fairly narrow, suggesting good trendiness. The reaction down held near the mid-point, or the regression curve. Point 2 made another test up, market a second drive, but this test was unsuccessful, and prices retreated below the bands. At point 3 this market went right up to the regression curve. You’ll notice the bands widening a bit and starting to round over the top of prices. This was an excellent example of trend change as indicated by the regression curve. The widening bands are common in this type of reversal. If the new trend gains momentum the bands usually will start to narrow in the new direction. Point 4 shows the slight narrow, although difficult to see on this chart.

Here is the same chart, but with the bands set with much shorter input value, closer to those of the TradeStation default. You can see how well the bands can catch the minor up and down swings of the prices. There is a very distinct narrowing on the two impulses down on the right side of the chart.

Here is a short-term tick chart on the Dow mini futures. You can see the rounding over the prices where the red down arrow is placed. The market finds resistance at the lower band. Notice the slight widening as this happens. The two blue up arrows show a similar situation but in reverse, but this time finding support on the regression curve as it rounds up under the prices, offering excellent support. The widening of the bands as this happens is common. As prices move up on the right side of the chart the bands begin to narrow quickly, even with prices making several up and down moves within the uptrend.

The above chart shows the Dow mini futures again, this time with a longer time frame tick chart, but with a shorter input value for the regression curve. Point 1 shows the rounding over prices. Point 2 shows rounding up under prices and excellent support as the market keeps testing, to make sure it really wants to proceed higher. It obviously does, and the bands tighten to show the uptrend displays a persistent and smooth trend. Point 3 begins to round over the top of prices indicating a reversal, accompanied by the wider bands. As the new down move begins the bands narrow, and point 4 offers excellent resistance.

Here is the same chart, but this time employing a longer-term regression curve. (The session break line visible on the above chart was omitted from the previous chart, but it is the same chart.) This choice of input values shows a different picture, but still offers useful information. Point 1 has wider bands indicating a sideways pattern. The upper band is broken, and point 2 re-tests the band, breaking it slightly, but holding over the regression curve. The uptrend occurs with the narrowing bands showing trendiness. Point 3 re-tests the lower band after prices cross under the regression curve. Point 4 display the familiar rounding over the top of prices with the bands widening.

Here is another Dow mini tick chart from a different day, with the very short input values. It shows how well the bands can track the swings of the market. Notice the narrowing as trends get underway, and the widening at reversal areas. Not every chart will show such a clear pattern. This is a well-chosen example. But these do occur on many days.

Here is a little longer term Dow mini contract showing the trending tendencies of prices as defined by the error bands. The bars are squeezed tight to show more data on the chart to get a little longer view. There is lag, but the trend of the bands, with the support or resistance offered, was helpful in trading this chart. Not every example is this even and cyclical.

Here is the same chart with the cyan colored line being a popular moving average length. This doesn’t give me much information, as compared to the standard error bands in the previous example. Of course, you could curve fit to find a moving average that would track prices better than the moving average I’ve displayed. It is difficult to curve fit a moving average in real time while you are trying to trade. In my own trading I use only two standard error bands: one with a very long regression value and smoothing, and one that is very short. I use the same parameters on all my charts, from tick chart to weekly charts.

Here is a daily stock chart. Notice the trending section on the left with the narrow bands. When the regression curve begins to round over the top of prices the bands widen out. The bands narrow during the drop after the consolidation. On the right side of the chart the bands get very wide, indication a choppy, noisy market.

Here is the same Johnson & Johnson chart, but this time with a popular moving average in place of the standard error bands. The moving average doesn’t give me nearly as much useful information to make sense of this price action. Moving averages can offer excellent support and resistance if the proper input value is known and used. I use the adaptive CCI on my charts that have the zero line representing the moving average. It would not be helpful to have another moving average displayed on my charts.

Here’s another example of the rounding over the top of prices, at point 1, and a short time later, rounding up under the bottom of prices at point 2. Notice the same pattern of wider bands at turning points, and narrowing of bands as trends proceed.

There are many indicators that can help define the trend of the market. Using standard error bands based around a linear regression curve, in my opinion, gives much more useful information than do moving average based indicators. This method does not seem to be as parameter dependent, as different input values can still provide information on trend direction as well as the quality of that trend. Also, the bands can provide clues as to when a trend might change direction.

Another indicator that is often used in conjunction with standard error bands is the R-Squared indicator, which I described elsewhere in this section of the blog.

As always, if you decide to use this indicator, do much testing on various parameter values and over large samples of data to see if this indicator can help you in your style of trading. The examples in this article were well chosen to explain possible usage of this indicator, but not all price charts will provide tradable opportunities such as those presented here.

4 thoughts on “Standard Error Bands

  1. Ralph, I’m intentionally being vague on the parameters for these examples. It is best to fit the lookback period and the amount of smoothing to the market and time frame and data feed that you are using. My parameters would be useless on your charts. Most parameters on a regression type of indicator will define trends and cycles quite well. Some traders like longer cycles, and some shorter. So just experiment and look at how it fits the data, and test on data going back a long way to see if it is stable. Don’t make the mistake of fitting it to the last couple of weeks of data and then assume the market will continue to duplicate that environment going forwrd. Hope this helps. Doug

  2. Pingback: Moving Trend
  3. Dear Sir,
    Any one can advise how to find ‘Std. Error’.
    One way I have found in a site is find ‘RSQ’ in Excel, divide it by ‘No. of period minus 2’ and take Square root. But this figure is very insignificant, whether the period is 21 or long period and so the bands overlap on the regression curve.
    Thanks and Regards,

Comments are closed.