Triple Exponential Moving Average TEMA – Trading Strategy Backtest (Does it work?)

Last Updated on August 22, 2022 by Oddmund Groette

Triple exponential moving average strategy 

One of the not-so-common moving average indicators used by traders is the triple exponential moving average (TEMA). It is an important trend indicator used by traders to identify trends more closely than a traditional moving average. But do you know what it is? And do you know if a triple exponential moving average strategy can be used profitably in the stock market?

Yes, triple exponential moving average strategies do work. Our backtests show that a triple exponential moving average can be used profitably for long-term trend-following strategies on stocks.

The triple exponential moving average, TEMA, is a trend following indicator used by analysts. It is formulated by creating multiple exponential moving averages (EMA) of the original EMA to reduce some of the lag. It helps to reduce price volatility to make the trend easier to identify.

Triple Exponential Moving Average TEMA strategy backtest and best settings

It’s nice to know the theory behind the triple exponential moving average, but does it really work? It’s time to backtest and put the theory to the test:

Does a triple exponential linear-moving average strategy work? Can you make money by using triple exponential moving average 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:

  1. 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.
  2. 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.
  3. 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.
  4. 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

100

200

CAR

3.41

6.52

7.73

7.68

7.25

7.53

MDD

-42.28

-26.32

-32.36

-36.94

-35.66

-37.8

Strategy 2

Period

5

10

25

50

100

200

CAR

6.12

3.02

1.86

1.92

2.32

2.05

MDD

-44.5

-62.5

-70.64

-54.89

-55.21

-61.97

 

Opposite to many other moving averages, the TEMA performs better on a 5-day average when it breaks ABOVE the average (see table two above). However, it looks like this result is an outlier. All the other days for the TEMA work better when the close crosses BELOW the average. This is because, in the short run, the stock market shows tendencies toward mean-reversion. In the long run, it is better to use trend-following strategies.

The results from backtesting 3 and 4 look like this (the results are not CAGR, but average gains per trade):

Strategy 3

Period

5

10

25

50

100

200

5

0.18

0.44

1.01

2.17

4.35

8.47

10

0.09

0.47

1.13

1.82

4.11

8.31

25

0.1

0.3

0.83

2.31

4

8.95

50

0.15

0.49

0.96

2.05

3.57

8.89

100

0

0

0.8

1.9

3.95

8.67

200

0.18

0.46

0.54

1.99

4.08

7.65

 

Strategy 4

Period

5

10

25

50

100

200

5

0.28

0.4

1.14

1.96

4

8.5

10

0.23

0.24

0.85

2.02

4.64

8.52

25

0.19

0.23

0.7

1.89

4.29

7.53

50

0

0.16

0.85

1.68

4.05

7.94

100

0.03

-0.03

0.31

2

3.2

8.04

200

0.09

0.22

0.47

0.98

3.87

9.08

As expected, the longer you are in the stock market, the better returns you get. This is because of the tailwind in the form of inflation and productivity gains. We have problems extracting much information from our backtests on TEMA except the fact that it seems random if you buy on a crossing of the TEMA either above or below. What matters is the number of days you stay in the trade. Thus, TEMA seems to have little predictive value. It’s the overall tailwind in the stock market that matters.

However, be aware that this is just one method of testing a moving average. There are basically unlimited ways you can use a moving average and your imagination is probably the most restricting factor!

What is a triple exponential moving average (TEMA)?

The triple exponential moving average, also referred to as TEMA, was developed by Patrick Mulloy in the mid-1990s. It was created to help eliminate the persistent issue of lag faced by traders when using other moving average indicators such as the exponential moving average (EMA). Multiple moving averages are usually employed to help reduce noise in short-term market swings.

The triple exponential moving average serves as a trend following indicator. It is mostly used in longer trends.  In such a sustained trend, it filters market volatility, showing the real direction of the prevailing trend.

The triple exponential moving average can be used with other technical indicators or oscillators to better track sharp price movements. Some analysts suggest pairing the TEMA with the moving average convergence divergence (MACD) for market analysis.

How to calculate a triple exponential moving average

The triple exponential moving average creates a multiple exponential moving average (EMA) of the initial EMA. Thus, the formula for calculating the TEMA is a bit more complex than that of the traditional moving average, as it uses a previously calculated EMA.

The formula for the TEMA is as follows:

TEMA =

[(3 X EMA 1) – (3 X EMA 2) + (3 X EMA 3)]

Where:

EMA 1 = the initial Exponential Moving Average (EMA),

EMA 2 = the EMA of EMA 1,

EMA 3 = the EMA of EMA 2.

To start, you must first calculate the initial EMA. Then, you use the values of that EMA to calculate the second EMA and use the second to calculate the third EMA. So, the second EMA is an EMA of EMA (a double exponential moving average or DEMA), while the third is an EMA of the DEMA (i.e. EMA of EMA of EMA). With these EMAs, you can then calculate the TEMA.

You must choose the lookback period of the indicator. For instance, when you decide to use a 10-period TEMA on a daily chart, the indicator will calculate the EMA of the 10 days.

Note that you do not have to do this calculation because your trading platform already has it done for you.

Why use a triple exponential moving average?

The TEMA tends to respond to price action faster than a simple or exponential moving average because it is skewed to the most recent data. The TEMA shows you pretty much the same thing other moving averages show, but it tends to have less lag than most of them. The direction of the TEMA is tilted to follow the short-term price movement, so it may be more useful to short-term traders, such as day traders and swing traders.

triple exponential moving average strategy
triple exponential moving average strategy

See the Ethereum futures chart above. You can see that the TEMA closely follows the price. It slopes upward as soon as the price rallies and slopes downward when the price declines.

Thus, the TEMA can be a very useful indicator for swing traders who wish to identify the individual price swings in time and get into the trades. But a lot depends on the lookback period, as that determines how fast the TEMA responds to price movement – the longer the lookback period, the slower it responds to price; the shorter the lookback period, the faster the reaction to price movement.

So, a TEMA with a long look-back period on a higher timeframe can move slowly and, in some cases, may also provide points of support or resistance on the chart. In an uptrend, a pullback can bounce off and reverse from the indicator.

How to use a triple exponential moving average

You can find the triple exponential moving average on popular trading platforms. For example, on your Tradingview, simply go to the indicator section and search for the TEMA to add it to your chart. You can customize it to your preference.

Similarly, you can create your own TEMA by using many of the free online coding scripts out there or pay someone to code one for you.

How can you use a triple exponential moving average?

The most common thing is to use the TEMA to identify market trends, especially short-term ones. But if the period is long enough, the indicator line can also serve as a point of support in an uptrend, or as resistance in a downtrend.

To make better trading decisions using this indicator, you can pair it with other technical indicators such as oscillators, or combine it with candlestick patterns analysis to identify potential pullback reversal points. For example, a rising TEMA accompanied by a bullish engulfing pattern in a retracement may be an indication that the trend may continue.

Another method to trade with TEMA is to use the moving average crossover strategy. This is done by adding two TEMA to your chart: a long period (50-period TEMA) and a short period (10-period TEMA). A buy signal is given when the 10-period TEMA crosses above the 50-period TEMA. A sell signal is given when the 10-period TEMA crosses below the 20-period TEMA.

Drawbacks with a triple exponential moving average

The TEMA is also plagued by the same factors affecting other moving averages. Below are some of the limitations faced by the TEMA:

  • It has the lagging factor because it depends on historical price data.
  • Even though it is useful in the present price action, it may not be able to forecast future price movements.
  • It does not work in a ranging market, as it can get whipsawed.

Relevant articles about moving averages strategies and backtests

Moving averages have been around in the trading markets for a long time. Most likely, moving average strategies were the start of the systematic and automated trading strategies developed in the 1970s, for example by Ed Seykota. We believe it’s safe to assume moving averages were a much better trading indicator before the 1990s due to the rise of the personal computer. The most low-hanging fruit has been “arbed away”.

That said, our backtests clearly show that you can develop profitable trading strategies based on moving averages but mainly based on short-term mean-reversion and longer trend-following. Furthermore, there exist many different moving averages and you can use a moving average differently/creatively, or you can combine moving averages with other parameters.

For your convenience, we have covered all moving averages with both detailed descriptions and backtests. This is our list:

We have also published relevant trading moving average strategies:

Triple exponential moving average strategies (TEMA) – takeaways

Our takeaway from the backtests is that triple exponential moving average strategies are not the best. Our backtests indicate that many of the other moving averages perform better.

Similar Posts