Trading bands come in two forms - Envelopes (or Percentage Bands) and Bollinger Bands.
Both indicators work on the premise that trading occurs within a certain range of an average price.
The Envelope is created by taking the moving average (usually exponential moving average but this depends on the trader) and adding and subtracting a percentage of price to this moving average (3% for example). The result is 2 lines projected over the chart.
The top line is the moving average plus a percentage, the bottom line is the moving average minus the same percentage.
Mathematically:

Note 1: either simple, weighted or exponential moving averages may be used
Note 2: see the section on moving averages for moving average formulae

This chart is of CSL using a 21-day simple moving average and 4% bands. The upper envelope is shown in red and the lower envelope in blue. A central 21 day moving average line has also been plotted (shown in green)
It can be seen that on average, the trading follows the moving average (by definition) but trades within the percentage bands.
Envelopes, and the next indicator to be introduced (Bollinger Bands) should be used to aid in the timing of a trade using other technical analysis techniques. On the surface, it could probably be deduced that the stock is a buy when it hits the lower envelope and a sell when it hits the top because the stock seems to appear to always 'return to the average'.
The trading mechanism for the use of envelopes is based on the philosophy the stock will remain within the bands, i.e.:
However, the technical analyst should be reminded that the Envelopes and Bollinger Bands are not designed to give a buy/sell signal in their own right. This is because although the moving average may be giving a sell signal, the stock may be in the vicinity of the lower band (a buy). The envelope should be seen as an affirming indicator of other stronger technical analysis techniques.

In the chart of CSL, buy signals were given at B, D and E and sell signals were given at A, C and F.
In terms of closing the trading position, a conservative trader may buy back a sold position or sell a bought position when the price returns to the moving average (central) line. Adding this to the trading rules:
Applying this to the previous example, would substantially reduce the profit gain.
A higher risk trader might buy when the price hits the lower band and sell when the price reaches the upper band and vice versa.
Most traders combine the use of envelopes with their moving average analysis. The moving average crossover may present a buy or sell opportunity and the envelope may assist in the timing of the trade. Traders usually also avoid buying or selling a stock using envelope analysis when the moving average(s) suggests otherwise.
The biggest problem when using Envelopes is estimating what percentage to use. Some stocks are more volatile than others, in which case the price will consistently penetrate the bands. If this occurs, the 'extreme' trading prices will occur more often and will most likely be inaccurate. For a low volatility stock, the price might not touch the bands at all, giving no buy/sell signals whatsoever. This dilemma was solved by John Bollinger who managed to build a self-adjusting percentage band into the envelope idea. The name of the indicator bears his name: 'Bollinger Bands'. They are discussed in the next section.
Bollinger Bands look similar to Envelopes. The central line is a moving average and there are two lines either side that act as buy and sell signals. Bollinger developed the idea that if a stock is more volatile, the envelopes should be wider apart than if the stock is less volatile. He recognised that a stock may even change volatility over its lifetime and therefore extended his idea to expand and contract the bands over the lifetime of a single stock. This was done by calculating the standard deviation of the moving average.
Standard deviation, in its simplest terms, can be thought of as the average distance from the average. In terms of share price, standard deviation refers to the average amount the stock price deviates from the moving average. A more in depth analysis of standard deviation is given later in this lesson.
Mathematically:
The central band is simply the moving average, the two outer bands are calculated as follows:

where the band is calculated for all closing prices and

Note 1: either simple, weighted or exponential moving averages may be used)
Note 2: see the section on moving averages for moving average formulae)
In the previous section which covered envelopes, it was pointed out that Envelopes and Bollinger Bands should not really be used to generate buy/sell signals in their own right. A buy/sell method can be generated based on the idea that the stock always returns to the average but this is not always a good trading method if the trader is not using the envelopes (or Bollinger Bands) in conjunction with another technical analysis tool.
However, Bollinger Bands can add confirmation to another technical analysis tool:
For the more conservative trader :

The chart shown gives an example of the use of Bollinger bands on a chart of BHP. This is an example where the indicator would have returned good results in its own right. However, note where the trader would have gone long and short and compare this to the moving average (central line). On some occasions, the trading decision goes against the trend of the moving average.
Note the contraction and expansion of the bands around the moving average. Note also how that the expansion occurs as the stock becomes more volatile and the contraction occurs as the volatility falls off.
There is an alternative view is that if the stock 'hits' the Bollinger Bands, the trend is about to change in the direction of the band (up or down). This thinking is not unreasonable. The Bollinger Bands follow a moving average and if the stock veers away from the average too suddenly, a change in the trend may occur.
Linear Regression has been grouped with the trading bands as Linear Regression attempts to tell the technical analyst the same thing - when prices have extended too far from their 'average trend'.
Students of algebra may remember the simple formula:

which describes a simple linear function (plots a straight line)
As y is the vertical axis and x is the horizontal axis, a straight line on a chart could be plotted using the following formula:

What technical analysts have attempted to do with the y = mx+c formula is fit it onto a chart as accurately as possible, then once 'm' and 'c' have been calculated, find the future price by substituting a future date into the formula.
So can m and c be calculated? The answer is 'yes' - using the least squares method. This is performed by finding all the closing prices for the last n periods and finding the formula that best fits the line.
The trading rules for trading the Linear Regression Lines are remarkably similar to that of the Bollinger Bands or Envelopes.
However, there is an important difference between Linear Regression and the other trading bands. A problem with the other bands is that the stock may give a buy signal when the moving average is moving down or a sell signal when the moving average is moving up. With linear regression, we always know in which direction the 'moving average' is heading as it is constant.
A more robust strategy is:
With these trading rules we are using the trading bands as a 'timing tool' for a stock we believe is moving in the direction of the slope of the linear regression lines.

The example shown is a chart of CCL with the linear regression indicator drawn over approximately 6 months with a standard deviation of 2. The central black line is the linear regression trend line and has been calculated using the least squares method. The two pink lines either side of the linear regression slope are called Raff regression lines. They act in a similar way to envelopes. The central line could be considered as the moving average and the pink lines as the envelopes. A technical analyst may consider the stock has moved too far from the trend if the price hits one of these lines.
Note how well the linear regression lines can time the entry and exit points whilst the trader can remain relatively comfortable, knowing they are still trading the direction of the trend.
Traders are not only interested in the price movement of a stock but also, how much the market agrees with the price move. A significant price movement accompanied by large volume (or relatively large compared to previous trading sessions) means that there are enough market participants (or enough large shareholders) who agree the stock should be moved to the new price. A price movement accompanied by small volume doesn't show much agreement in the new price and there is risk that the market may return the stock to its previous price. In other words, the price move is more significant if it is accompanied by larger volume.
Volume indicators determine the significance of price movement by analysing the amount of volume that accompanied the price move.
The On Balance Volume Indicator is possibly the most popular of the indicators relating volume to price. Like all the volume indicators, it attempts to display the significance of a price movement by comparing it to the amount of accompanying volume. The amount of the price movement is disregarded in the calculation of OBV. The only thing that matters with respect to price, is whether the price movement was up or down. The amount the OBV moves is directly proportional to volume.
Mathematically:
If the stock moved up, then the OBV is calculated as:

Alternatively, if the stock moved down, then the OBV is calculated as:

The table below gives an example of calculating the OBV
| Day | Price | Volume | On Balance Volume |
| 1 | $1.00 | 15,000 | 0 |
| 2 | $1.10 | 12,000 | 12,000 |
| 3 | $1.05 | 17,000 | -5 000 |
| 4 | $1.07 | 15,000 | 10,000 |
| 5 | $1.03 | 10,000 | 0 |
| 6 | $1.07 | 25,000 | 25,000 |
| 7 | $1.10 | 15,000 | 40,000 |
Note that the first day is given an OBV of zero as we can't tell whether the volume should be added or subtracted (because we are unsure whether the price has moved up or down from the previous day).
A running total of volume begins on day 2 adding volume if the price was up and subtracting volume if the price was down.
In this example the second day was up so the volume is added to the previous total of 0
The following day was down so the volume is subtracted from the previous total to give today's OBV.
OBV can be used as a leading indicator. That is, the movement of the OBV is designed to precede the movement in price. This is based on the assumption that if there is accumulation (buying of the stock around a particular price range), there will be slightly more 'up days' and these will correspond to higher volume days. In other words, the price movement may be minimal but the OBV increases. A result of accumulation is the sellers soon run out and the buyers must pay a higher price to attract a new breed of sellers.
If an increase in the stock price is seen without a corresponding increase in OBV, there is a good chance that the up trend in price will not continue. This is because there is no confirmation with volume.
The Accumulation/Distribution Indicator is similar to the OBV indicator in that it gives the trader an idea of the markets agreement in movement of price. It does this by comparing the price move to the volume accompanying the price movement. The difference with the ADI is that the amount of the price movement is also taken into consideration. (Remember, OBV only took into account the direction of price movement, not the amount of movement).
As has been previously discussed in the section on bar charts, the closing price gives a good indication on whether the buyers or sellers are controlling the market. If the closing price is near the high of the day, the buyers are in control. If the closing price is nearer to the low of the day, the sellers are in control. The ADI uses this theory in combination with volume confirmation.
Mathematically:

The following table provides an example of a calculation of ADI. As an exercise, see if you can work through the example (using the formula) on the previous page
| Day | Low | High | Close | Volume | ADI (day) | ADI (cumulative) |
| 1 | $0.98 | $1.05 | $1.00 | 15,000 | -6,428.57 | -6,428.57 |
| 2 | $1.04 | $1.12 | $1.10 | 12,000 | 6,000 | -428.57 |
| 3 | $1.00 | $1.10 | $1.05 | 17,000 | 0 | -428.57 |
| 4 | $1.07 | $1.10 | $1.07 | 15,000 | -15,000 | -15,428.57 |
| 5 | $0.99 | $1.03 | $1.03 | 10,000 | 10,000 | -5,428.57 |
| 6 | $1.07 | $1.07 | $1.07 | 25,000 | 0 | -5,428.57 |
| 7 | $1.07 | $1.12 | $1.10 | 15,000 | 3,000 | -2,428.57 |
Note the days where the closing price was exactly midway between the high and the low, the ADI for the day equaled 0. Note also that the same closing prices were given as in the OBV example. However, with the ADI, a negative value was returned as opposed to a positive value with the OBV.
The theory behind the ADI is similar to that of the OBV, that is, the indicator attempts to identify accumulation or distribution of the stock by comparing the price movement with the amount of stock that traded. The idea is, the more stock that traded, the stronger the accumulation or distribution. The ADI adds to this theory slightly by taking into account the amount of price movement. That is, the stronger the price movement (intraday) the stronger the accumulation/distribution. The result of accumulation is the sellers soon run out and the buyers must pay a higher price to attract a new breed of sellers. The result of distribution is the buyers soon run out and the sellers must begin selling at a new, lower level to attract a new breed of buyers.
It follows that the buy/sell signals will be generated when there is conflicting signs being given by the stock and by the ADI indicator. For example, if the stock is moving down, or is trading around its lows yet the ADI shows accumulation is occurring, a change is likely (to the upside).

The chart of Infomedia (IFM) is shown above. A 10-day linear regression (line of best fit) has been projected over the stock clearly showing the down trend in the stock. The reader will also observe how the ADI continued to rise during this time. This is an excellent example of divergence where the fall in stock price simply did not have volume confirmation.
The Performance indicator is used as a quick reference to examine the performance of a stock since a particular point in time. Performance indicators of two or more stocks are usually presented so the relative performance of each stock (or index) may be compared. The performance indicator accomplishes this by 'normalising' the data so both stocks begin at a zero point at a particular point in time.
A performance indicator for a single stock will give the percentage increase of that stock from the starting date (entered by the technical analyst)
Mathematically:
The key part of the calculation of the performance indicator is choosing the date from which the analyst wishes to compare today's price. The date selected will have a corresponding closing price and this price is used as the 'first close'.

Performance is measured as a percentage.

Performance does not give any buy and sell signals as such. Analysts use the performance indicator to examine how the stock has progressed since a certain date. This could be handy information when comparing different stocks and how they have performed since a crash or a currency crisis (for example).
The chart shown gives an example of the use of the Performance indicator on AMP Ltd. (AMP) with the starting date as the 23 DEC 2001. This date was chosen as this was the date AMP separated from its European subsidiary which became a separate company. With the performance indicator, the trader can see how the stock has performed since this date. For this example, about 25% in six months.
Standard Deviation is a mathematical term essentially meaning: the average distance from the mean, or, the average distance from the average. We saw in the Bollinger Bands indicator that each band is an average distance the stock is away from the moving average (the 'mean') at any point in time. Is it useful just to know the standard deviation and not add that on to the moving average? Many analysts consider it is as it gives a very good indicator of volatility. Volatility is the result of uncertainty. When a minimal number of people in the market roughly agree on the price of a stock, the stock will be fairly stable. When many people in the market believe very different things about what price the stock should be trading, the stock will generally be very volatile. If volatility occurs at the end of the trend, one could then conclude that there is uncertainty and uncertainty that the trend will continue. This is where the standard deviation indicator is most useful. Should a stock be trending and an increase in volatility occurs, it is quite possible that the trend is about to come to an end.
Similarly to the performance indicator, the standard deviation does not have a buy and sell signal as such.
Mathematically:

where the Standard deviation (SD) is calculated for all closing prices (X) and n is the number of time periods for the moving average

This chart gives an example of the use of the Standard Deviation indicator on BHP with the moving average (exponential) period of 4 days. Note how the volatility of the stock increases as the stock becomes more 'erratic'.
This concludes this lesson and the lessons on stock selection. The next two lessons deal with derivatives. These are types of financial products which you may to buy and sell instead of the actual share itself. More is explained in the next lesson, Options and Warrants.