Trend Indicators

TEMA: Triple EMA for Low Lag | AlfaTactix

📖 5 min read

📝 969 words

🏷️ Trend Indicators

In this page: what TEMA is, how it works, when to use it, a practical example with code, and a bonus tip.

Use TEMA in a real strategy—no code required

Create a free account to save your progress and build strategies with this indicator and 80+ others in minutes. Backtest, then export to MQL5.


TEMA on a price chart: illustration of the indicator and how it is used in technical analysis
TEMA – chart illustration

TEMA (Triple Exponential Moving Average) Indicator Explanation

The Triple Exponential Moving Average (TEMA) is an advanced trend indicator that applies exponential smoothing three times to reduce lag while maintaining responsiveness to price changes. Developed by Patrick Mulloy in 1994 and introduced in his article "Smoothing Data with Faster Moving Averages" published in Technical Analysis of Stocks & Commodities magazine, TEMA is designed to eliminate the lag inherent in traditional moving averages while preserving the smoothing benefits. The indicator provides faster signals than standard EMA and is particularly useful for short-term trading strategies that require quick response to trend changes.

How TEMA Works: TEMA is calculated by applying exponential smoothing three times to the price data. First, a standard EMA is calculated. Then, an EMA is applied to that EMA value. Finally, a third EMA is applied to the second EMA. The TEMA formula combines these three EMAs: TEMA = (3 × EMA₁) - (3 × EMA₂) + EMA₃, where EMA₁ is the first EMA, EMA₂ is the EMA of EMA₁, and EMA₃ is the EMA of EMA₂. This triple smoothing approach significantly reduces lag compared to standard EMA while maintaining trend-following characteristics. The mathematical correction eliminates most of the delay, making TEMA one of the most responsive moving averages available.

When to Use TEMA:

  • Fast Trend Identification: TEMA is highly effective for identifying trend changes quickly, making it ideal for short-term trading strategies where early entry is crucial. The reduced lag allows traders to catch trend reversals earlier than with standard moving averages.
  • Dynamic Support and Resistance: TEMA acts as dynamic support in uptrends and dynamic resistance in downtrends, providing reference levels that adapt quickly to changing market conditions. Price interactions with TEMA can signal trend continuation or reversal.
  • Crossover Strategies: TEMA can be used in crossover strategies with other moving averages or with itself using different periods. A shorter-period TEMA crossing above a longer-period TEMA generates bullish signals, while the opposite generates bearish signals.

Advantages:

  • Provides extremely fast response to price changes while maintaining smoothing benefits, making it ideal for short-term trading strategies that require quick trend identification.
  • Significantly reduces lag compared to standard EMA and SMA, allowing traders to enter trends earlier and exit before significant reversals occur.
  • Works effectively across multiple timeframes and asset classes, including stocks, forex, commodities, and cryptocurrencies, as trend measurement is universal.

Limitations:

  • TEMA can be more sensitive to price noise than standard moving averages, potentially producing more false signals during volatile or ranging markets. The increased responsiveness can lead to whipsaws in choppy conditions.
  • The indicator may still lag behind price movements during rapid market changes, though less than standard moving averages. Traders should combine TEMA with other indicators for confirmation.
  • TEMA values can be more difficult to interpret for beginners compared to standard moving averages, as the triple smoothing makes the calculation less intuitive.

In summary, TEMA is a valuable trend indicator for traders seeking fast response to trend changes while maintaining smoothing benefits. For comprehensive understanding, refer to Mulloy's original work "Smoothing Data with Faster Moving Averages" (1994), Investopedia's TEMA guide, TradingView's TEMA documentation, and academic research on advanced moving averages in technical analysis published in journals such as the Journal of Financial Markets and the Review of Financial Studies.

Practical Example: Using the TEMA Indicator in a Trading Strategy

The Triple Exponential Moving Average (TEMA) is a trend indicator used to identify trend direction and provide dynamic support and resistance levels with minimal lag. In a trading strategy, the TEMA indicator helps traders make entry and exit decisions based on fast trend identification and price interactions with the moving average.

Scenario: You're creating a short-term trend-following strategy for Ethereum (ETH/USDT) on a 15-minute chart. You want to buy when price is above the 20-period TEMA (indicating uptrend) and the price bounces off the TEMA after a pullback, and sell when price breaks below the TEMA (indicating potential trend reversal).

Strategy Logic:

  • Calculate the TEMA(20) to identify trend direction with minimal lag. The TEMA provides faster signals than standard EMA while maintaining smoothing benefits. When price is above the TEMA, it indicates an uptrend, and when price is below the TEMA, it indicates a downtrend.
  • Buy signal: When price is above the TEMA(20) and bounces off it after a pullback, indicating the uptrend is continuing and the TEMA is acting as dynamic support.
  • Sell signal: When price breaks below the TEMA(20) after being above it, indicating potential trend reversal and exit opportunity.

Backtrader Example:

import backtrader as bt

class TEMATrendStrategy(bt.Strategy):
    params = dict(
        tema_period=20
    )
    
    def __init__(self):
        # Calculate TEMA: 3*EMA - 3*EMA(EMA) + EMA(EMA(EMA))
        ema1 = bt.ind.EMA(period=self.p.tema_period)
        ema2 = bt.ind.EMA(ema1, period=self.p.tema_period)
        ema3 = bt.ind.EMA(ema2, period=self.p.tema_period)
        self.tema = 3 * ema1 - 3 * ema2 + ema3
        
    def next(self):
        if not self.position:
            # Buy when price is above TEMA and bounces off it
            if (self.data.close[0] > self.tema[0] and 
                self.data.close[-1] <= self.tema[-1]):
                self.buy()
        else:
            # Sell when price breaks below TEMA
            if self.data.close[0] < self.tema[0]:
                self.sell()

# Usage
cerebro = bt.Cerebro()
cerebro.addstrategy(TEMATrendStrategy)

Expected Outcome: By using the TEMA indicator, your strategy identifies trend direction quickly with minimal lag, helping you enter trades earlier in trends and exit before significant reversals. This approach leads to better entry timing, improved trend-following performance, and enhanced risk management by responding quickly to trend changes.

💡 Bonus Tip

Consider using TEMA in combination with volume indicators for confirmation. When price bounces off TEMA with increasing volume, it suggests strong buying interest and higher probability of trend continuation. This technique, documented in technical analysis literature, can significantly improve the reliability of TEMA-based trading strategies.

Using the TEMA indicator ensures your strategy responds quickly to trend changes while maintaining trend-following discipline, improving entry and exit timing based on fast trend analysis.

Use TEMA in a real strategy—no code required

Create a free account to save your progress and build strategies with this indicator and 80+ others in minutes. Backtest, then export to MQL5.

Try Strategy Builder

Use this indicator in Strategy Builder — free

Create free account