INDICATORS

Wait For It -- Wait For It

Anticipating Moving Average Crossovers

by Dimitris Tsokakis


Although simple moving averages may be a technical analyst's best friend, they do tend to lag. Here's how you can overcome this problem.
Moving averages are excellent indicators to confirm existing trends in spite of their lag. To overcome this lag, several alternatives such as the exponential moving average (EMA) and the weighted moving average (WMA) have been applied to price charts. In this article, I will not tweak the simple moving average (SMA). Instead, I will decrease the lag of the SMA crossover by one day by basing it on a simple mathematical observation.

SIMPLE MOVING AVERAGE CROSSOVER

First, I would like to show you an arithmetic example. A five-day simple moving average (MA5) is the average of the last five closing values:

MA5  = (C + C-1 + C-2 + C-3 + C-4)/5
     = C/5 + (C-1 + C-2 + C-3 + C-4)/5        [A1]
In a similar fashion, a four-day SMA is:
MA4  = (C + C-1 + C-2 + C-3)/4
Its previous value is:
MA4-1     = (C-1 + C-2 + C-3 + C-4)/4
or
4*MA4-1   = C-1 + C-2 + C-3 + C-4
or
4*MA4-1/5 = (C-1 + C-2 + C-3 + C-4)/5
If you replace (C-1 + C-2 + C-3 + C-4)/5 in [A1] you get:
MA5 = C/5 + 4*MA4-1/5
or
MA5 = (C+4*MA4-1)/5    [A2]
The equation in [A2] expresses the five-day SMA as a function of the previous value of the four-day SMA. You can generalize the relation in [A2] for any period K as:
MA(K) = (C + (K-1)*MA(K-1)-1)/K    [A3]
Let MA(K) represent the SMA for day k, MA(P) the SMA for day p, and assume k > p. Using the information given, you can determine the values of tomorrow's close (TC), k-period moving average, Tma(K), and p-period moving average, Tma(P).

If you apply [A3] you get:

TMA(K) = (TC+(K-1)*MA(K-1))/K and
TMA(P) = (TC+(P-1)*MA(P-1))/P
If tomorrow's SMAs are equal, then Tma(K) = Tma(P) or (TC+(K-1)*MA(K-1))/K=(TC+(P-1)*MA(P-1)))/P. You can now solve for tomorrow's close (TC) using the following formula:
TC = (P*(K-1)*MA(K-1)-K*(P-1)*MA(P-1)) / (K-P)
[Relation A0]
For a crossover of moving averages to occur, they need to touch. So here's how you can use what we have learned so far. For example, if P = 20 and K = 30, in order for the MA(20) and MA(30) to cross over tomorrow, the TC would have to be:
TC=[20*29*MA(29)-30*19*MA(19)]/(30-20) or
TC=[580*MA(29)-570*MA(19)]/10 or finally
TC=58*MA(29)-57*MA(19)
So when the TC crosses with the actual closing price, it could potentially predict the crossing of the SMAs in the next price bar.

...Continued in the February issue of Technical Analysis of STOCKS & COMMODITIES


Excerpted from an article originally published in the February 2007 issue of Technical Analysis of
STOCKS & COMMODITIES magazine. All rights reserved. © Copyright 2007, Technical Analysis, Inc.



Return to February 2007 Contents