Geometric Moving Average (GMA) Trading Strategy: Backtest and Evaluation

Geometric moving average strategy backtest

There are different ways of getting the moving average of a time series. While the simple and exponential methods of calculating the moving average are more common in the trading world, it is also possible to get the geometric mean of the price series. But what does the geometric moving average entail? Can we make profitable geometric moving average strategies in the markets?

Yes, simple moving average strategies do work. Our backtests show that a geometric moving average can be used profitably for both mean-reversion and trend-following strategies on stocks.

The geometric moving average is a type of moving average that calculates the geometric mean of the previous n-periods of the price time series. Unlike the simple moving average that uses the arithmetic mean to continuously calculate the moving average as new price data comes in, the geometric moving average uses the geometric mean formula to get the moving average of the price data as new ones come in. Since the geometric mean has a compounding effect, investors usually consider it a more accurate measure of returns than the arithmetic mean.

Geometric moving average strategy backtest and best settings

Before we go on to explain what a geomtric moving average is and how you can calculate it, we go straight to the essence of what this website is all about: quantified backtests.

Our hypothesis is simple:

Does a geometric moving average strategy work? Can you make money by using geometric moving averages strategies?

We look at the most traded instrument in the world: the S&P 500. We test on SPDR S&P 500 Trust ETF which has the ticker code SPY.

All in all, we do four different backtests:

  • Strategy 1: When the close of SPY crosses BELOW the N-day moving average, we buy SPY at the close. We sell when SPY’s closes ABOVE the same average. We use CAGR as the performance metric.
  • Strategy 2: Opposite, when the close of SPY crosses ABOVE the N-day moving average, we buy SPY at the close. We sell when SPY’s closes BELOW the same average. We use CAGR as the performance metric.
  • Strategy 3: When the close of SPY crosses BELOW the N-day moving average, we sell after N-days. We use average gain per trade in percent to evaluate performance, not CAGR.
  • Strategy 4: When the close of SPY crosses ABOVE the N-day moving average, we sell after N-days. We use average gain per trade in percent to evaluate performance, not CAGR.

The results of the first two backtests look like this:

Strategy 1

Period

5

10

25

50