Moving Averages are a method to calculate a trend line from a stock or index chart. Using these moving averages you can generate Tradesignals which allow you to decide wether to enter exit into an investment. The trend line smoothes out the up and downturns which occur all the time in market, and can show strong trends more clearly.

The moving averages are calculcated by taking all stock prices from a timewindow before the current day and calculating the average from them. For the next day e.g. tommorrow the time window is shifted one day to include the previous day (thus the name ‘moving’).

By looking at the moving average you can quickly get an overlook how the market has been moving, and avoid investing when being in a strong downwards move, and rather invest into an upgoing market.

By combination of moving averages with different time window sizes, one can generate Tradesignals which can be used to try to beat the market, by timing the investment into the market (markettiming).

You could think of hopping on wave, where you leave at the top and reinvest when the downwards movement has finished (in theory). So the aim is to reach an Outperformance for medium and long time investments compared to the Buy and Hold approach.

					Fig. 1: 150 day Simple Moving average with DAX Index

Fig. 1: 150 day Simple Moving average with DAX Index

Figure 1 shows an Example how an moving average and its underlying stock look like. You see the german DAX Index in blue, and a Simple Moving Average in a green curve calculated with a timewindow of 150 days. You can see clearly how the SMA represents the DAX price movements, but in a more generalized way, but with a bit of delay as the moving average gets calculated with a timewindow of 150 days.

The values for the simple moving average curve at the beginning of the chart where calculated with DAX Data outside the chart (150 days more). If these would not have been available, the simple moving average curve would start after 150 days in the chart.

Trading systems

Moving averages are often used in combination with other indicators to create a trading system, which generates you signals to buy or sell a stock. On this website we only look at simple trading systems using moving averages only. It is not discussed how much sense this makes, but the performance of the different moving averages combinations may enable one to draw conclusions for combination with other indicators to create complex trading systems. Backtests

To test the different kinds of moving averages and methods to generate signals the following rules were used:

  • After an signal occurs, the stock will be bought not perfectly with the price at the time of signal, but with 0.5% worse on buy or sell
  • If a stock is sold with positive result, a tax fee of 25% will be applied
  • The stock data is based at the 1.1.2010. This is the day 0 in most charts.

The first point is to make the backtest more realistic, because its hardly possible to trade exactly at the time a signal occurs, its much more likley you are going to get a worser price, especially because you trading in a trend and are buying or selling ‘against’ it.

The second point is to simulate taxes that occur on stock trading (german ‘Abgeltungsteuer’).