Triple Exponential Average (TRIX)

Haiyue
10min

I. What is the TRIX Indicator

TRIX (Triple Exponential Average) is a momentum oscillator that measures price momentum by calculating the rate of change of a triple-smoothed Exponential Moving Average (EMA) of closing prices. Thanks to the layered filtering effect of the triple EMA, TRIX effectively eliminates short-term price noise and retains only the most significant trend change signals.

Historical Background

TRIX was invented by Jack Hutson in 1983 and published in Technical Analysis of Stocks and Commodities magazine — a publication Hutson himself founded and edited. He designed TRIX with the goal of creating an indicator that could filter out “meaningless price fluctuations” and only produce signals when a truly significant trend change occurs. The triple EMA design was inspired by the concept of multi-stage low-pass filters in signal processing.

Indicator Classification

  • Type: Oscillator, displayed in a separate panel
  • Category: Momentum
  • Default Parameter: Period n=15n = 15
  • Value Range: Unbounded, oscillates around the zero line (unit: %)
TRIX Filtering Effect

A single EMA smoothing only partially removes noise; two EMAs (the basis of DEMA) smooth further; a triple EMA almost completely filters out short-term fluctuations. TRIX then calculates the rate of change of this triple EMA — essentially performing “velocity” analysis on already highly smoothed data.


II. Mathematical Principles and Calculation

Core Formula

Step 1: Calculate triple EMA

EMA1t=EMA(Close,n)tEMA1_t = EMA(Close, n)_t

EMA2t=EMA(EMA1,n)tEMA2_t = EMA(EMA1, n)_t

EMA3t=EMA(EMA2,n)tEMA3_t = EMA(EMA2, n)_t

Step 2: Calculate TRIX (rate of change)

TRIXt=EMA3tEMA3t1EMA3t1×100TRIX_t = \frac{EMA3_t - EMA3_{t-1}}{EMA3_{t-1}} \times 100

Optional: Signal line

Signalt=SMA(TRIX,s)tSignal_t = SMA(TRIX, s)_t

where ss is typically 9.

EMA Recursive Formula

EMAt=αXt+(1α)EMAt1,α=2n+1EMA_t = \alpha \cdot X_t + (1 - \alpha) \cdot EMA_{t-1}, \quad \alpha = \frac{2}{n + 1}

Step-by-Step Calculation Logic

  1. Calculate first EMA: Apply nn-period EMA to closing prices
  2. Calculate second EMA: Apply nn-period EMA to the first EMA
  3. Calculate third EMA: Apply nn-period EMA to the second EMA
  4. TRIX = percentage rate of change of the triple EMA
  5. Optional: Calculate 9-period SMA as signal line

Smoothing Effect of Triple EMA

For triple EMA with period n=15n = 15:

  • Equivalent smoothing period is approximately 3×(n1)+1=433 \times (n-1) + 1 = 43 periods
  • This acts as a very smooth low-pass filter — only price movements sustained over several weeks can significantly affect the TRIX value
TRIX vs TEMA

Be careful to distinguish TRIX from TEMA (Triple Exponential Moving Average):

  • TRIX = rate of change of triple EMA (oscillator)
  • TEMA = 3EMA13EMA2+EMA33 \cdot EMA1 - 3 \cdot EMA2 + EMA3 (overlay indicator) Both use the same triple EMA intermediate products, but their final calculations and applications are completely different.

III. Python Implementation

import numpy as np
import pandas as pd


def trix(close: pd.Series,
         period: int = 15,
         signal_period: int = 9) -> pd.DataFrame:
    """
    Calculate TRIX Indicator

    Parameters
    ----------
    close : pd.Series
        Close price series
    period : int
        EMA period, default 15
    signal_period : int
        Signal line SMA period, default 9

    Returns
    -------
    pd.DataFrame
        DataFrame with TRIX and Signal columns
    """
    # Triple EMA
    ema1 = close.ewm(span=period, adjust=False).mean()
    ema2 = ema1.ewm(span=period, adjust=False).mean()
    ema3 = ema2.ewm(span=period, adjust=False).mean()

    # TRIX = percentage change of triple EMA
    trix_values = (ema3 - ema3.shift(1)) / ema3.shift(1) * 100

    # Signal line
    signal_line = trix_values.rolling(window=signal_period, min_periods=signal_period).mean()

    return pd.DataFrame({
        "TRIX": trix_values,
        "Signal": signal_line
    }, index=close.index)


# ========== Usage Example ==========
if __name__ == "__main__":
    np.random.seed(42)
    dates = pd.date_range("2024-01-01", periods=150, freq="D")
    trend = np.linspace(0, 15, 150)
    noise = np.cumsum(np.random.randn(150) * 0.8)
    price = 100 + trend + noise

    df = pd.DataFrame({
        "date": dates,
        "open":  price + np.random.randn(150) * 0.3,
        "high":  price + np.abs(np.random.randn(150) * 0.6),
        "low":   price - np.abs(np.random.randn(150) * 0.6),
        "close": price,
        "volume": np.random.randint(1000, 10000, size=150),
    })
    df.set_index("date", inplace=True)

    # Calculate TRIX
    trix_df = trix(df["close"], period=15, signal_period=9)
    df = pd.concat([df, trix_df], axis=1)

    print("=== TRIX Results (Last 15 Rows) ===")
    print(df[["close", "TRIX", "Signal"]].tail(15).to_string())

    # Zero-line crossover
    df["zero_cross_up"] = (df["TRIX"] > 0) & (df["TRIX"].shift(1) <= 0)
    df["zero_cross_down"] = (df["TRIX"] < 0) & (df["TRIX"].shift(1) >= 0)

    print("\n=== TRIX Crosses Above Zero ===")
    print(df[df["zero_cross_up"]][["close", "TRIX"]].to_string())
    print("\n=== TRIX Crosses Below Zero ===")
    print(df[df["zero_cross_down"]][["close", "TRIX"]].to_string())

    # Signal line crossover
    df["sig_cross_up"] = (df["TRIX"] > df["Signal"]) & \
                         (df["TRIX"].shift(1) <= df["Signal"].shift(1))
    df["sig_cross_down"] = (df["TRIX"] < df["Signal"]) & \
                           (df["TRIX"].shift(1) >= df["Signal"].shift(1))

    print("\n=== TRIX Crosses Above Signal Line ===")
    print(df[df["sig_cross_up"]][["close", "TRIX", "Signal"]].head(10).to_string())

IV. Problems the Indicator Solves

1. Filtering Market Noise

TRIX’s core value lies in its triple smoothing effect. A large volume of short-term random fluctuations are filtered layer by layer through the EMAs — only truly sustained price movements can significantly influence the TRIX value.

2. Zero-line Crossover (Trend Change)

SignalConditionMeaning
BuyTRIX crosses above zeroTriple-smoothed price begins rising -> sustained uptrend begins
SellTRIX crosses below zeroTriple-smoothed price begins falling -> sustained downtrend begins

3. Signal Line Crossover

  • TRIX crosses above signal line -> Momentum strengthening, buy signal
  • TRIX crosses below signal line -> Momentum weakening, sell signal

4. Divergence Signals

Because TRIX is highly smoothed, its divergence signals are more reliable:

  • Bearish divergence: New price high + TRIX fails to make new high -> reliable signal of long-term momentum decline
  • Bullish divergence: New price low + TRIX fails to make new low -> reliable signal of long-term momentum recovery

5. Trend Strength Assessment

  • TRIX absolute value continuously increasing -> trend accelerating
  • TRIX absolute value beginning to decrease -> trend decelerating
  • TRIX approaching zero line -> trend about to change
Note

TRIX’s triple smoothing makes it respond very slowly. It is suited for capturing major trends but will miss short-term swing opportunities. In fast-reversing markets, TRIX signals may lag severely.


V. Advantages, Disadvantages, and Use Cases

Advantages

AdvantageDescription
Exceptional noise filteringTriple EMA almost completely eliminates short-term noise
Very few false signalsHigh smoothing means only genuine trend changes produce signals
Reliable signalsZero-line and signal-line crossovers have relatively high accuracy
More reliable divergenceDivergence on smoothed data is more meaningful than on raw price

Disadvantages

DisadvantageDescription
Significant lagTriple smoothing causes large signal delay, potentially missing early moves
Not suited for short-termExcessive smoothing prevents response to short-term price changes
Parameter sensitivePeriod selection has a significant impact on signal timing
Requires trending marketsIn prolonged sideways markets, TRIX oscillates repeatedly around zero

Use Cases

  • Medium-to-long-term trend trading: Capturing trends lasting weeks to months
  • Position management: TRIX direction can serve as a reference for position direction
  • Filter: Only consider long strategies when TRIX > 0
  • Broad indices: Works well on indices with relatively smooth volatility
ComparisonTRIXMACDROC
Smoothing degreeVery high (triple EMA)Medium (dual EMA difference)None
LagLargeMediumSmall
False signal rateVery lowLowHigh
Suited forLong-termMedium-termShort-term
Signal lineOptional SMA(9)EMA(9)None
Practical Advice
  1. Complement with short-term indicators: Use TRIX to determine the big picture, and RSI or Stochastic to find specific entry points.
  2. Shorten the period: If more responsive signals are needed, reduce the period from 15 to 8–10.
  3. Watch slope changes: Even if TRIX is still positive, when its slope changes from positive to negative (from rising to falling), it serves as an early warning of trend deceleration.
  4. Monthly level: Using TRIX(12) on monthly charts can capture annual-scale major trends.