Triple Exponential Moving Average

The Triple Exponential Moving Average (TEMA) of Patrick Mulloy (1994) takes the lag reduction of the DEMA one step further with a third EMA.

The formula for the Triple Exponential Moving Average applies the EMA over n periods three times in turn:

\[\text{EMA}_{1} = \text{EMA}(\text{Close}, n)\] \[\text{EMA}_{2} = \text{EMA}(\text{EMA}_{1}, n)\] \[\text{EMA}_{3} = \text{EMA}(\text{EMA}_{2}, n)\]

These combine so that the lag of the first EMA cancels out:

\[\text{TEMA} = 3 \cdot \text{EMA}_{1} - 3 \cdot \text{EMA}_{2} + \text{EMA}_{3}\]

Where EMA(x, n) is the exponential moving average of x over n periods, with \(\alpha = 2 / (n + 1)\). The TEMA follows the price even more closely than the DEMA and overshoots it further after a sharp move; it suits short-term signals rather than smoothing.

A moving average smooths the price by averaging it over the last n periods, so that the trend shows through the noise of single periods. It is the oldest and most widely used trend indicator: the direction of the average shows the direction of the trend, the price above (below) it an uptrend (downtrend), and other indicators, from the MACD to the Bollinger Bands, are built on it. Every moving average trades smoothness against lag: the more periods it averages, the smoother it is and the later it turns after the price. The averages differ in how they weight the prices within the window and whether they adapt their speed to the market, each a different answer to that trade-off.

Also known as: TEMA.

In the Finance Toolkit this is get_moving_average with method="triple_exponential", the same function as Moving Average.

Example · ^GSPC · 2021 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_moving_average:

from financetoolkit import Toolkit

toolkit = Toolkit(
    tickers=["^GSPC"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.technicals.get_moving_average(method="triple_exponential", window=50)

Which returns:

References

  • Paper Mulloy, P.G. (1994). “Smoothing Data with Less Lag.” Technical Analysis of Stocks & Commodities, 12(2).
  • Library Referenced against TA-Lib’s TEMA (Triple Exponential Moving Average)
Share