As an example, a 20 day MA would use 20 day's worth of closing prices and come up with an average that will be used as the value for the current day. By connecting the average prices, a line will be formed that often will act as a support or resistance level.
A simple MA uses the approach I outlined above. The price value for each day has equal weight when calculating the average. For the above example of a 20 day MA, the current day's closing price plus the previous 19 are used to calculate the average for the current day. By doing this for all the previous days on the chart, a line can be plotted. The longer the time period, the smoother changes in the line will be and the longer it will take for the average to 'catch up' to the current price.
An exponential MA uses a slightly more complicated calculation. The main difference is that this calculation will give more weight to the more recent day's values. To calculate the 20 day exponential average, you would take each day and multiply it by a decreasing value the farther away you get from today. For example, the previous day's value would be the closing price times 100%, but 2 days ago's price would be the closing price times 95% and so on. These values are then added together and divided by 20 to get exponential average.
I decreased the percentage value by 5% for a 20 day moving average because 100%/20 = 5% per day. If I was calculating a 30 day exponential moving average, the percentage change would be 100%/30 = 3.33%.
The exponential average will tend to show changes more quickly than its simple average equivalent. However, I prefer to stick with the simple average and simply change the periods.
You may be wondering what time periods to use... and why.
I don't have a very scientific answer. As a rule, many technicians will prefer a 20 day, 30 day, 50 day or even a 200 day MA.
As you can imagine, the longer the time period, the slower the longer term you may be looking. I tend to trade shorter term time periods so I prefer the 30 day moving average as my primary support or resistance level.
So how does the MA act as support or resistance? It's actually a rather uncanny thing to observe. And... it isn't exact. However, take a look at the same 30 moving average chart I showed above but notice where it acted as support and where it acted as resistance.
Similarly, once support was broken, notice how the MA acted as resistance.
Notice how the MA transitions from being support to resistance. I subscribe to the theory that support is support until it stops being support.
Ok, that may sound like an obvious statement but here's the deal. Looking at these two examples above, I can identify points where support acted like support and then it stopped being support. What does that mean for me? If I was bullish, it may be a good indicator to stop being bullish
If I am bearish and I see the price break through the resistance of the MA, maybe it's time to stop being bearish until I see indications otherwise.
As I'm putting this material together, I see that the following event just happened.
So, is it time to put on the party hats and call the bear market over? Hold on a minute...
Notice the last time there was a break of the 30 day MA. This break only lasted for a short time. Why was that?
Notice here that last time this happened, the rally failed to break through the next key resistance level. And in fact, broke down through the MA again.
While I may have put on some bullish trades on the breakout, the failure to follow through should have been a clear indicator that I should consider exiting these trades. Whether I do or not would depend on the nature of the trade and how I defined my trading plan.
I just want to make brief mention of the use of multiple moving averages. I often use multiple averages at the same time. I will use a 30 day, 50 day and 200 day MA. I do this because I think it is important to get a perspective of what is going on in the longer term.
With these three moving averages on and looking at the last 2 years, when might have been a good time to be bearish?
Perhaps on the first break of the 200 day MA back around the beginning of 2008. But definitely when it confirmed by using the 200 day MA as resistance in May of 2008.
When might a good time to start being really bullish again? I'd say when the price moves back up through the 200 day MA and then uses it for support.
Update 6/20/2009: We see that the SPY (and the corresponding SPX) has broken back up through the 200 day moving average.
The question is... will it confirm? By confirm, I mean will it test and use the 200 day moving average as support? If the we see the 200 day MA act as support and the SPY moves above its recent highs, I'll be ready to become a little more bullish.
Update 7/22/2009 : What a difference a month makes! I said last month that I'd like to see the 200 day moving average act as support. Well, here we see it did... twice. On top of that, it looks like a higher high is forming.
What does this mean? Does it mean that it's straight up from here? I doubt it. However I'm adopting a more cautiously bullish stance now. What would make me even more bullish is to see the 30 & 50 day MA start to act as support and the 200 day MA turn up.