Simple Moving Average Index Crossover - Backtesting SP500

Now lets do some backtesting on the american S&P500 (Standard & Poors) index, would trading with simple moving averages also give an yield outperformance here? And would the larger timewindows be in advantage again?


				
					Backtest performance chart comparison for simple moving averages and S&P500

Fig. 1: SMA Yield performance for S&P500

In figure 1 you see the performance of the timewindows 1-1000 for the simple moving average (SMA) using the index crossover signal generation scheme. The calculation was done for the last 15 years (3750 trading days). It seems like the index did not perform as good as the DAX as it only gave a yield of 6.5% p.a. The best SMA with a timewindow of 385 days delivered a yield of 10.5%.

Number of trades

If we look at the amount of trades done in figure 2, it shows again that most trades where done with the smaller SMA timewindows (which also results in negative performance).


				
					Amount of Trades for each SMA for S&P500

Fig. 2: Amount of Trades per SMA timewindow size


				
					Backtest Performance chart of moving average 385 and S&P500 Index

Fig. 3: Performancechart of simple moving average vs Buy & Hold

In fig. 3 you see the performance chart of the SMA385 system trading compared to the Index performance since the start of the backtest 3750 days ago. You see how the system follows the index until day 2800 where a false signal causes the performance to fall back (see also fig 4. with the SMA curve at day 2800). But as the SMA system signals the following downturns correctly, it outperforms the index afterwards.


				
					Chart of simple moving average 385 eith S&P500

Fig. 4: S&P500 Chart with SMA385

Optimal simple moving average for trading the S&P500

Lets look at all the performance charts of each of the 1000 SMAs, done in a 3D Graphic in figure 5 and 6. Compared with the DAX SMA backtesting the SP500 seems to produce a more homogeneous surface, atleast starting at a timewindow of 200 days.


				
					Topology of S&P500 Performance with simple moving averages

Fig. 5: Topology of SMA Performance for S&P500


				
					Overview of simple moving average performance for SP500

Fig. 6: Topview SMA Performance for the S&P500

In fig. 7 you see again a topview of the buy & hold performance (streched for better visibility). You can see the downturn at ca. day 1750, which gets avoided by nearly all SMAs.


				
					Buy and Hold Performance for SP500

Fig. 7: Topview Buy&Hold Performance for the S&P500

The best simple moving average for total outperformance of the SP500 has not so strong ups and down in the days 2750-2250 as seen when backtesting the DAX. But it has periods where it gives performance below the benchmark.

Because of that lets search for an SMA which gave nearly no underperformance. Figure 8 show the average underperformance (negative distance from S&P500 Index) for every trading day. The SMA with the lowest underperformance value is the SMA768, its chart can be seen in fig. 9.


				
					Simple moving average underperformance for SP500

Fig. 8: Underperformance for each timewindow value


				
					Chart of moving average with 786 days with SP500

Fig. 9: Performance of SMA 786 and Buy&Hold