Saturday, May 25, 2013

S&P 500 - 20 Year Study of Buy and Sell Signals

In a previous post I made the claim that the S&P 500 was not ready to crash yet based on a custom indicator I created some time ago that plots the percentage that price closes above or below its 200 day ema and uses the trend line break technique to generate accurate buy and sell signals. 

I supported my assertion with a daily chart of the E-mini S&P 500 Index Futures (/ES) detailing the sell signals this indicator and the trend line break technique have generated over the past 3 years (chart shown below) and demonstrated that the conditions required to support a SELL signal are not in place at the present time.

As there appears to be significant interest from readers in seeing how this indicator would have fared in trading the S&P 500 during previous years (and particular interest in its performance preceding memorable historic crashes), I thought it would be fun to document its prowess for the entire 20 years of S&P 500 daily trade before today and let you decide for yourself.

Let's begin with another look at the chart that initially generated such interest in this indicator and my interpretative technique.

When the indicator crosses the red horizontal line in the center of the indicator panel (reads '1' on the far right) it means that price is crossing the 200 day ema. A reading of 1.05 means that the ES is 5% above the 200. A reading of 0.95 means that the ES is 5% below the 200, and so on. On this chart I set a magenta horizontal line at 1.12 and you may notice that price in the past 3 years has been able to stretch to 12% above the 200 on a few occasions - most notably one week ago.

We'll continue now with a chart of the ES picking up late 1993 and continuing well into 1997.

First, I must tell you that what you are going to see on these charts makes trading look quite easy. I want to be the first to admit that nothing could be further from the truth. Trading in real time has so many head fakes that even if you have a system that looks as accurate as this one you are not always going to be able to make the 'ideal' decisions. 

Second, I am often asked how one knows, in real time, when to 'draw' these trend lines to generate the BUY and SELL signals. That's a very good question.

Unfortunately, there is an intuition factor that is difficult for me to teach, but fortunately there are some guidelines that I personally try to be mindful of as 'real time' progresses.

Here are some of the clues. Nearly every sell signal was given at a negative divergence. That is, price made a higher high while the indicator made a lower high. Buy signals were sometimes accompanied by a positive divergence (indicator makes a higher low while price makes a lower low) but probably more importantly, buy signals that had the best odds of paying off occurred when the trend line break torpedoed the indicator above ZERO. You will probably notice that in the bear market of late 2001 to 2003 I did not even bother to draw in the buy signals. My reluctance to do so reflected my understanding of the implied significance of the indicator being below ZERO.

Moving along, here is the chart covering late 1996 to 2001.

The benefit of hindsight is such that one could say, looking at this extremely powerful bull rally, that simply a buy and hold strategy would have worked out nearly the same. And I would agree with that. The problem, as usual, is that no one can trade with a crystal ball or with the simple understanding given by hind sight. In that light I think this strategy has a few things going for it.

The preceding chart brought us to the top of the secular bull in later 2000. This next chart gives us a view of the bear market that followed into 2002.

And this chart brings us through the bear market and back into the next bull into 2004.

As we continue with the next bull phase of 2004 - 2008, we notice that the sell signals once again coincide with the negative divergence setup. Trend line break buy signals are again occurring above ZERO.

Here are some more details for the late 2005 through mid 2007 time period.

Now let's see what the time frame from late 2006 to mid year 2008 looked like. The final top in October 2007 was reached with a negative divergence to its predecessor of July 2007. From about 1450 and higher the situation described by the indicator was both shaky and volatile. Price fell to the 1450 price level a couple of times before falling precipitously, then retesting 1450 again before its descent towards its ultimate destiny at 666.

Looking at the action of the ES after 2008 got underway yielded a couple of trades as seen in the following chart.

And continuing on into 2009 and 2010 ...

Which brings us back to where we began.

I have not marked up this chart any further since initially posting it, but the surety of looking for the negative divergence to validate drawing the trend line break sell signal is clearly more loosely defined in these most recent years. 

However, the notion that price has been limited by a 12% ceiling above the 200 day ema is notable. If I had to guess I would think at some point we will have a new high that does not reach anything close to the 12% measurement (see late April 2011) and may indeed yield a negative divergence. This possibility suggests that price may drift around for a while and bring the indicator down to the blue trend line. At that point price will then rebound 'one more time' to new highs and leave the negative divergence print for all to see.

Another possibility is that price falls and the indicator reaches the blue trend line quickly. After giving it a little thought price just continues south and the trend line break sell signal is in effect right then and there. There is no way I can possibly know which scenario will play out at this point. 

So there you have it. 20 years of good information and now is your opportunity, as promised, to decide for yourself how well this system seems to work.

BTW, this indicator using the trend line break technique works very well on all kinds of ticker symbols and all kinds of various time frames. And changing the moving average from 200 periods to 100 periods or even 50 periods is effective, as well. It is similar, as you probably noticed, in interpretation to the True Strength Index (TSI) indicator. The reason that both indicators work as well as they do is that they accurately capture trend direction and accurately reveal when trend direction has substantially changed very early in the momentum transition.

I hope you enjoyed contemplating this post and have found new possibilities that you may never have dreamed existed.

Be good,



  1. Thanks John,

    As always interesting and educational. It's enjoyable being one of your adult students.


  2. John, Great post. If possible could you post one of the above charts that has more than a couple trendline breaks and include the TSI indicator below the price_ma comparison indicator? It would be interesting to see how closely the two indicator's trendline breaks line up. You did include both indicators in the silver chart at the end of your Sayonara article but that chart did not have any trendline breaks.
    Thanks. Bruce

  3. Doug - thank you.

    Bruce - if one uses TSI (7,4) then it is like comparing apples with oranges because this TSI setting gives many many more signals.

    However, when I look at this using TSI (25,13) vs. the 200 day ema indicator the results are strikingly similar....particularly if one uses the notion to draw the trend line *after* a negative divergence.

    Still talking the daily ES chart, the TSI (7,4) has a nearly perfect trend line connecting its lows starting back on November 15th. At present it is trying to rebound higher from just above that trend line. I have no doubt that when this trend line is broken it will be a fatality for price.

    As far as the 200 ema contraption goes, it looks like ES needs to make up around 30 points to reach the previous highs, and it obviously if/when it does we will NOT be 12% above the 200 as more recently. That could well signal trouble is nearing.

  4. Ideal if you like to make things complex. Step in when the monthly price closes above its EMA-10 and get out when it closes below its EMA-10, and you get the same results.

  5. Marcrenders - I thought your strategy not only elegantly simple but hoped it would prove true. So to find out, I wrote a simple strategy on ThinkorSwim that charted back 20 years of monthly price and a 10 period ema. then I told the computer to simply buy when price closed the month above the 10 period ema and sell when it closed below the 10 period ema.

    What I found was that if the ticker symbol tended to have very sharp and lengthy trends, up and down, like the S&P500 over the past 20 years, the strategy performed nearly as well as a single buy and hold over the entire 20 year period.

    However, if we were looking at using this strategy on an issue that was not as gifted at trending strongly and for long periods of time, it was a bust. I looked at Ford (F) and Bank of America (BAC) as a couple of examples. Both, on a buy and hold over the past 20 years, are ahead today very marginally - like 20%. Unfortunately, the strategy returns were negative.

    Designing good strategies is very very tough. What looks like a no-brainer on the chart can easily become a nightmare when it is truthfully back tested. I have been disappointed more times than I can say - absolutely sure I was onto something great only to find it that it was not.

    Thanks for sharing your strategy. I do appreciate your thinking.

  6. I thought your strategy not only elegantly simple but hoped it would prove true. So to find out, I wrote a simple strategy on ThinkorSwim that charted back 20 years of monthly price and a 10 period ema. then I told the computer to simply buy when price closed the month above the 10 period ema and sell when it closed below the 10 period to invest in the stock market

  7. Great post. Thanks for sharing your strategy.

  8. stocks to buy is awesome.Ideal if you like to make things complex.As always interesting and educational. It's enjoyable being one of your adult students.