Moving Average

Formula for Simple Moving Average

A simple, or arithmetic, moving average is calculated by adding the closing price of the security for a number of time periods (e.g., 12 days) and then dividing this by the total number of time periods. The result is the average price of the security over the time period. Simple moving averages give equal weight to each daily price.

For example, to calculate a 21-day moving average of IBM: First, you would add IBM's closing prices for the most recent 21 days. Next you would divide that sum by 21; this would give you the average price of IBM over the preceding 21 days. You would plot this average price on the chart. You would perform the same calculation tomorrow: add up the previous 21 days' closing prices, divide by 21, and plot the resulting figure on the chart.



Where:
n = The number of the time periods in the moving average



Formula for Exponential Moving Average

An Exponential (exponentially weighted) moving average is calculated by applying a percentage of today's closing price to yesterday's moving average value. Exponential moving averages place more weight on recent prices.

For example, to calculate a 9% exponential moving average of IBM, you would first take today's closing price and multiply it by 9%. Next, you would add this product to the value of yesterday's moving average multiplied by 91% (100% - 9% = 91%).

(Today's Close * 0.09) + (Yesterday's Moving Average * 0.91)


Because most investors feel more comfortable working with time periods, rather than with percentages, the exponential percentage can be converted into an approximate number of days. For example, a 9% moving average is equal to a 21.2 time period (rounded to 21) exponential moving average.

The formula for converting exponential percentages to time periods is:



You can use the above formula to determine that a 9% moving average is equivalent to a 21-day exponential moving average:



The formula for converting time periods to exponential percentages is:



You can use the above formula to determine that a 21-day exponential moving average is actually a % moving average:




Formula for Triangular Moving Average

Triangular moving averages place the majority of the weight on the middle portion of the price series. They are actually double-smoothed simple moving averages. The periods used in the simple moving averages varies depending on if you specify an odd or even number of time periods.

The following steps explain how to calculate a 12-period triangular moving average.

  1. Add 1 to the number of periods in the moving average (e.g., 12 plus 1 is 13).
  2. Divide the sum from step #1 by 2 (e.g., 13 divided by 2 is 6.5).
  3. If the result of Step #2 contains a fractional portion, round the result up to the nearest integer (e.g., round 6.5 up to 7)
  4. Using the value from step #3 (i.e., 7), calculate a simple moving average of the closing prices (i.e., a 7-period simple moving average).
  5. Again using the value from step #3 (i.e., 7) calculate a simple moving average of the moving average calculated in step #4 (i.e., a moving average of a moving average).


Formula for Simple Variable Average

A variable moving average is an exponential moving average that automatically adjusts the smoothing percentage based on the volatility of the data series. The more volatile the data, the more sensitive the smoothing constant used in the moving average calculation. Giving more weight to the current data increases sensitivity.

Most moving average calculation methods are unable to compensate for trading range versus trending markets. During trading ranges (when prices move sideways in a narrow range) shorter term moving averages tend to produce numerous false signals. In trending markets (when prices move up or down over an extended period) longer term moving averages are slow to react to reversals in a trend. By automatically adjusting the smoothing constant, a variable moving average is able to adjust its sensitivity, allowing it to perform better in both types of markets.

A variable average is calculated as follows:

(0.078 (VR0 * Close) + (1 - 0.078 (VR) * Yesterday's Moving Avg)


Where:
vr= The Volatility Ratio




Hint: Click on the arrows.



Click Here to Enlarge »

Descending Moving Average's Crossover  zoom »
When the faster moving average crosses down through the 6 and 9 period moving average this can be a good signal for a reversal of an up trend to a down trend. Knowing when these crossovers occur can signal a potential entry and exit point. With Markets-Alert patented wireless alert technology, it is possible to know the exact moment this occurs.

Ascending Moving Average's Crossover  zoom »
When the faster moving average crosses up through the 6 and 9 period moving average this can be a good signal for a reversal of a down trend to an up trend. Knowing when these crossovers occur can signal a potential entry and exit point. With Markets-Alert patented wireless alert technology, it is possible to know the exact moment this occurs.


 Back to the Learning Center Home Page »