The calculation of the closing price required for a moving average crossover to occur is straightforward as shown in this blog.

In the 1990s I used projections of closing prices that cause a moving average crossover for entering MOC orders in advance. During that time most markets were driven by momentum and a moving average crossover was often followed by an associated price gap at the next open and as a result entering trades in advance was a good strategy.

Since momentum died and gave way to mean-reversion and also momersion, I have been using projections of moving average crossovers to fade related signals.

Regardless, knowing the price levels for a moving average crossover to occur is useful in many respects.

For example, a 50-200 death-cross is about to occur in the S&P 500. I would like to know the closing value that will cause the crossover today so that I can fade this signal. That price is the solution to the equation:

MA(50) = MA(200)    (1)

In general, for fast MA(n1) and slow MA(n2) the solution for the closing value Cp in equation 1 is given by this formula:

Cp = (MA(n1) – MA(n2) +C(n2-1)/n2 – C(n1-1)/n2)/(1/n2-1/n1)  (2)

Note that a close below Cp will necessarily cause a death cross if MA(n1) < MA(n2) and a close above CP will necessarily cause a golden cross if MA(n1) >   MA(n2).

Below is an example for the pending 50-200 death cross in S&P 500. The formula is implements on the bottom indicator pane: It may be seen that if the S&P 500 closes at 1887.08 or below that today, a death-cross will occur. Note that Cp in equation 2 changes daily or in real-time when one is dealing with intraday data.

Also note that when the moving averages have longer periods, such as in the 50-200 cross example, and are far apart, then the projected values to cause a cross are often unrealistic and even negative.

Below is an example for faster periods, MA(3) versus MA(10): In this case the projected values shown on the bottom pane are more realistic. Since MA(3) has already crossed MA(10) to the downside, the projected value corresponds to the level to cause a golden cross, i.e., MA(3) crossing above MA(10), and it is equal to 2307.74. Thus, if today’s close is at or above that value, a 3-10 golden cross will occur. This is tot very likely though.

Again, note that Cp changes when new data comes in.

There are also some indicators one could develop based on these formulas but that will probably be the subject of another blog.

You can subscribe here to notifications of new posts by email.

Charting program: Amibroker

Detailed technical and quantitative analysis of Dow-30 stocks and popular ETFs can be found in our Weekly Premium Report.

© 2015 Michael Harris. All Rights Reserved. We grant a revocable permission to create a hyperlink to this blog subject to certain terms and conditions. Any unauthorized copy, reproduction, distribution, publication, display, modification, or transmission of any part of this blog is strictly prohibited without prior written permission.