Triple Exponential Moving Average (TEMA)
The DEMA idea taken one step further.
What it measures
Section titled “What it measures”The TEMA combines an EMA, the EMA of that EMA, and the EMA of that again, weighted so their lags cancel. Like the DEMA, it sits on the close when prices rise by the same amount every bar, and it holds closer to the price through a curve. Patrick Mulloy published both in 1994. It is not the same as TRIX, which is the rate of change of a triple-smoothed EMA.
How traders read it
Section titled “How traders read it”As the DEMA: a quick moving average for crossings and trend direction, with more false turns when the market goes sideways.
Formula
Section titled “Formula”EMA1 = EMA(CLOSE, periods)EMA2 = EMA(EMA1, periods)EMA3 = EMA(EMA2, periods)TEMA = 3 × EMA1 − 3 × EMA2 + EMA3Each EMA starts from the mean of its first periods values, as TA-Lib’s TEMA does.
Settings and output
Section titled “Settings and output”Call: tema(periods)
| Setting | Chart default |
|---|---|
periods: Periods |
20 |
What you get: a number.
Warm-up: with tema(20), it asks for 0 bars of history and a run-up of 160, and its first value came on bar 58 of the example data.
The prices are made up, hourly, and the same on every page, so the chart shows how the indicator behaves, not how a market behaved.
In an algorithm
Section titled “In an algorithm”function onIntervalClose() { const fast = tema(20); if (fast !== null && CLOSE < fast && OPEN_POSITIONS_COUNT === 0) { openPosition("SELL", { quantity: 10000, stopLossPips: 30 }); }}