Home

Contents

Methods of Analysis

 

Smoothing a Trend

 

Playing the market is just your average game.  Sure it is!

------------------------------------------------------------------------------------

Index of Page Topics

The Simple Moving Average

Moving Average

Weighted Moving Averages

Time Series Analysis

Exponential Moving Average

Trend Analysis

MAC-D

Problem Solving

Bollinger Band Crossover

The Markets

-------------------------------------------- 

The Simple Moving Average

The role of the moving average in the stock market is to smooth out the erratic fluctuations of market prices. The moving average helps to gauge trend.

There are many ways to formulate moving average. Here we look at the simple moving average, or what is called an unweighted (or evenly weighted) moving average. This is an average of a collection of numbers or the central value of the numbers, obtained by adding the numbers together and dividing by the number of them.

If the numbers are 7, 5, 6, 5, 2, the sum is 25. Since there are five of them, their unweighted average is 25/5 = 5. We can use this unweighted average to compute an unweighted (simple) moving average.

When dealing with the price of a stock over a history of trades, the moving average can be taken over any number of trades or over any time period of trading -- it's your choice. We can average over an hour, for example, or over a day, a week, month, and so on.

As an example, let's use the simple average and extend the above sequence of numbers to:

7, 5, 6, 5, 2, 6, 8, 3, 3, 1.

Continuing with five time-periods, the average of the first five (un-weighted) numbers is 5, so this is our first average of a "moving" average.

The next unweighted average begins with the second number in the sequence and goes to number 6. The average is thus:

(5 + 6 + 5 +2 + 6)/5 = 24/5 = 4.8

This gives us the second value of our simple moving average. Next is the unweighted average for the group beginning with the third number and extending to 8.

(6 + 5 + 2 + 6 + 8)/5 = 27/5 = 5.4

And so it goes.

Back to Index

 

----------------------------------------------

Weighted Moving Averages

It isn't often that successive values in a time series have equal importance. Usually the more recent values are more significant. In the stock market, current prices have more bearing on trades than older prices. So it makes sense to give more weight to the latest prices when computing an average. But the assignment of weight (or relative emphasis) of the price can be made in different ways. Each way defines a different kind of moving average.

 

Example 1

Say we have the sequence of prices as before, namely

7, 5, 6, 5, 2, 6, 8, 3, 3, 1.

Let's use the five-period grouping, again, but this time assume that more recent prices are more important than earlier prices. We will mean that each of the last two numbers in the group of five has twice the importance of each of the first three numbers. In other words, in the first group of five, the numbers 5 and 2 will have twice the weight of the numbers 7, 5, and 6. This amounts to repeating each of the last two numbers in our five-grouping.

The weighted average of the first group of five is therefore approximately:

(1*7 + 1*5 + 1*6 + 2*5 + 2*2)/7 = 32/7 = 4.57,

The factors 1 and 2 formulate the apparent number of appearances of the five numbers in each group of five. So the average has dropped from what it was for the unweighted interpretation. That's mostly because the last two numbers in the five-group exert a greater influence on the average and are small.

As before, the next weighted average in computing the moving average involves the second group of five, which begins with the number 5 and ends with 6, and uses the weights 1 and 2.

 

Example 2

Using the same sequence of prices and period groupings, let's put a successively higher degree of importance on the numbers in each group of five. So let's say the degree of importance goes from 1 to 5. The apparent number of appearances of prices in the group is therefore

1 + 2 + 3 + 4 + 5 = 15.

So the weighted average for the first group of five is approximately:

(1*7 + 2*5 + 3* 6 + 4*5 + 5*2)/15 = 65/15 = 4.33,

Note that the average has again dropped, this time mainly because the last value is small and has even greater importance than before.

Computation of the weighted moving average continues, as before, with the second group of five numbers, which starts with 5 and ends with 6, using the weights 1 through 5.

Back to Index

 

----------------------------------------------- 

Exponential Moving Average

The exponential moving average is a weighted moving average that has special importance among technicians. As Bauer and Dahlquist point out, it is unique because it uses what amounts to a combination of a grouping of prices in the sequence with a single price in the sequence that follows the grouping.

In our sample:

7, 5, 6, 5, 2, 6, 8, 3, 3, 1

where we used a five-grouping to compute moving average, the procedure would be as follows:

Start by computing the simple average of the first group of five and combine this with the next single price, which is the number 6. The combination is formed by averaging the simple average and the single number. The single number (i.e., 6) is thus rated as equally important to the group average.

An equivalent way to look at this procedure is to use a six-grouping for computing the weighted average and let the latest number in the group have a weight of one less than the group size, in this case five times that of each of the previous five. In our example, the exponentially weighted average of the first group (of six) would be:

(1*7 + 1*5 +1*6 + 1*5 + 1*2 + 5*6)/10 = 55/10 = 5.5.

Follow-on groups of six would be computed in the same way to give the moving average.

Back to Index

 

----------------------------------------------

MAC-D

Developed by Gerald Appel, the Moving Average Convergence/Divergence (MAC-D) is based on a divergence of the difference between two moving averages, on one hand, and price, on the other.  You find it by subtracting the 26-day moving average of the stock's price from the 12-day moving average of the price (the faster one of the two). What you get are values that oscillate above and below zero. If, say, the 12-day value is higher than the 26-day, the oscillator is positive. (In other words, the average value for the last 12 days is higher than the overall average.) If lower, it is negative. And of course if they're equal, it's zero.

When the MAC-D moves in the opposite direction from the price, you get a trading signal. But how long you have to wait to declare a signal is hard to tell. If the MAC-D is moving up and the price is moving down, this is bullish, signaling a turnaround soon. But if the price is moving up, and MAC-D is moving down, this is bearish, signaling diminishing interest and a likely downturn soon, though just when, as I said, is anybody's guess.

Back to Index

 

----------------------------------------------

Bollinger Band Crossover

Another way to look at a moving average is to focus on the statistical dispersion, or tendency of prices to oscillate around the moving average line, forming trading bands that contain most of the moving prices. The moving average represents the center of the stock price swing, or trend -- the mean. And the bands represent near maximum divergence from the center. This is the basis for John Bollinger's crossover index.

In Bollinger's approach, the bands respond to the market's volatility and expand and contract accordingly, getting wider when volatility increases and narrower when it decreases. According to Bauer and Dahlquist, the bands are self adjusting, automatically widening during periods of extreme price changes and narrowing during periods of small price changes. A narrow band usually portends an imminent dramatic move in the market.

Formulation of the crossover technique requires calculation of a P-period exponential moving average (EMA). The next calculation is the standard deviation (SD) to measure volatility, as follows:

SD = (Ö å (Closei - EMA)2)/P, for i = 1 to P.

In words, take the difference between the close and the EMA each day, square it, add them up for all the days of the P-period, take the square root of the sum, and divide by the number of days.

To get the upper band, add SD to the EMA. To get the lower band, subtract SD from the EMA. The bands are now a standard deviation from the moving average price.

You get a signal to buy when the price breaks below the lower band but closes above it. And you get a sell signal when the price breaks above the upper band but closes below it.

Back to Index

-----------------------------------------------

Top of Page