August 22nd, 2008

Oscillator, MACD, MA Crossovers In Market Timing

The volume of hits I get every time Cramer mentions the S&P Oscillator started me thinking. Why don’t I back-test a number of oscillators, MACD (moving average convergence-divergence) and moving average crossovers against my database of 45 years of S&P closing values (over 11,250 observations).

I compared a buy-and-hold strategy base case against a portfolio managed according to stochastic momentum indicators. The base case assumed purchasing $1,000 of the Standard & Poors 500 Index ETFs, or SPYs, on May 14, 1964 (later than the start of the database to allow for the 600 days required to for the 300-day oscillator plus constructing a 300-day moving average of that oscillator); there were no transactions over the full 45 years since the portfolio followed a strict buy-and-hold strategy.

The managed portfolio of $1000 assumed that buy and sell decisions were madE according to the market timing signals of an oscillator. Assumptions for this tests were:

  • The technical indicators would be calculated at the end of each day based on the closing value of the S&P 500 Index.
  • If the indicator dictated a trade, it was executed at the next trading day’s open at the price of the previous close (assume that there were no overnight events causing the Index to change value between close and open).
  • The model was binary meaning that the portfolio could only have two positions, fully invested or fully in cash.
  • The model ignored transaction costs, incomes taxes interest income on cash balances and any dividends paid by either the SPY etf or the underlying 500 companies.

To test a diverse range oscillators, I assumed: 1) a number of different range lengths (30-day, 60-day, etc), 2) to smooth the oscillator series’ volatility, moving averages series of lengths equal to the oscillator ranges and 3) a number of alternative buy/sell trigger rules (buy when oscillator hit 20%, 30% or 40% and sell when it hit 80%, 70% or 60%).

On December 31, 2007, the buy-and-hold base portfolio was worth $15,990 – not too shabby for a $1,000 investment over 44 years earlier. But perhaps S&P’s proprietary Oscillator, the one Cramer talks about so often, is significantly different that the ones I tested because according to my test, using a stochastic oscillator to indicate buy and sell decisions produced poor results:

Are moving averages (MAs), another momentum indicator, better market timing tools? I conducted the same test with MACDs as marking timing indicators in managing the $1,000 investment of SPYs but the test results were again, to say the least, disappointing:

The MACD-based market timing strategies using 60-, 90, 180- and 300- day moving averages again resulted in substantially smaller ending values (the buy-and-hold produced a higher value than the oscillator because of a later start date necessitated by the added time for the moving average needed in the oscillator test).

Another approach using MAs as a market timing tool is when they’re used as “trendlines”, or trend boundary indicators. In this approach, the index simply crossing above a moving average is considered a buy signal while its crossing below the moving average is considered a sell signal. When I tested this simple market timing tool on the hypothetical SPY portfolio, it also produced worse results than a buy-and-hold strategy:

Stochastic oscillator, MACD and MA crossover indicators might work well for signaling changes in the momentum of individual stocks but they don’t appear to work well when when uses in a test for timing the market as a whole.

My MTI (Market Timing Indicator) takes the best features of all these other tools and combines them in a synergistic way. Managing the test portfolio according to the market timing signals of the MTI increased an initial investment of $1000 beginning on March 12, 1963 to $50,171 on December 31, 2007, more than double the results of a simple buy-and-hold strategy.

fyi: the MTI has been signaling an “all-cash” position since December 27, 2007 and continues to do so today.

Subscribe below or click here to learn more about help for navigating turbulent markets.