Mulloy's triple-stage lag compensator — 3·EMA1 − 3·EMA2 + EMA3 — often confused with TRIX, which shares the core but plots something else entirely.
The Triple Exponential Moving Average is Patrick Mulloy's 1994 follow-up to DEMA, published in Technical Analysis of Stocks & Commodities. Like DEMA, the name is misleading: TEMA is not an EMA smoothed three times. It combines three nested smoothing stages into a lag-compensated line: TEMA = 3·EMA1 − 3·EMA2 + EMA3, where EMA2 = EMA(EMA1) and EMA3 = EMA(EMA2). At equal length it tracks price more tightly than both EMA and DEMA. TEMA is frequently confused with TRIX because both are built on a triple-nested EMA — but they are different indicators: TRIX triple-smooths price and then plots the one-bar rate of change of that smoothed line as an oscillator around zero, while TEMA combines the three stages into a moving-average line plotted on price itself. Same core, different output. TEMA is a deterministic function of past prices; it describes recent price with less delay and predicts nothing. This is educational content only, not financial advice, and all trading carries risk of loss.
Each EMA stage adds roughly one unit of lag: EMA1 lags price, EMA2 lags EMA1, EMA3 lags EMA2. DEMA cancels the first-order lag by adding back the gap between EMA1 and EMA2. TEMA carries the same correction one order further: expanding 3·(EMA1 − EMA2) + EMA3 shows it cancels both the first- and second-order lag terms, leaving a line that hugs price more tightly than DEMA at the same length. The cost scales with the benefit — the higher-order correction amplifies overshoot at reversals and sensitivity to noise, because the terms being added back always describe the trend that just ended, not the one starting. That frames the honest answer to 'when would you use TEMA over DEMA': when you want less lag and are willing to accept more overshoot and more false moves. There is no correct choice between them; EMA, DEMA, and TEMA are the same dial turned progressively further toward responsiveness. One practical consequence of the three nested recursions: TEMA needs a longer warm-up than an EMA, so values near the start of loaded history differ between platforms with different data depth.
Lengths of 9 to 21 are common for short-term reads and 50 for an intermediate view, on the closing price. Because TEMA(n) runs much faster than EMA(n), some traders use longer TEMA lengths to keep smoothness while retaining some lag reduction. The most instructive setup is EMA, DEMA, and TEMA at one identical length side by side — it makes the responsiveness/overshoot trade-off visible rather than theoretical.
//@version=6
indicator("TEMA Example", overlay = true)
len = input.int(20, "Length", minval = 1)
src = input.source(close, "Source")
e1 = ta.ema(src, len)
e2 = ta.ema(e1, len)
e3 = ta.ema(e2, len)
tema = 3 * (e1 - e2) + e3
plot(tema, "TEMA", color = color.blue, linewidth = 2)
plot(e1, "EMA", color = color.new(color.orange, 40))Pro tip: Before using any 'TEMA' script, check its output scale: a line on price is TEMA, an oscillator around zero is TRIX — the two are routinely mislabelled because they share the triple-EMA core. Then compare EMA, DEMA, and TEMA at one length and choose your spot on the lag/overshoot ladder deliberately. This is educational material only, not financial advice; indicators describe past price, and trading involves risk of loss.
Educational only — not financial advice, not a recommendation to trade. No indicator is predictive; trading involves substantial risk of loss.