Triple Exponential Moving Average (TRIX)
Calculate the Trix (Triple Exponential Moving Average) for a given price series.
Trix is a momentum oscillator that calculates the percentage rate of change of a triple exponentially smoothed moving average. It helps identify overbought and oversold conditions in a market.
The formula is as follows:
\[\text{EMA1} = \operatorname{EMA}(\text{Close},\; \text{Window})\] \[\text{EMA2} = \operatorname{EMA}(\text{EMA1},\; \text{Window})\] \[\text{EMA3} = \operatorname{EMA}(\text{EMA2},\; \text{Window})\] \[\text{TRIX} = (\text{EMA3} - \text{EMA3} \left[- 1\right]) / \text{EMA3} \left[- 1\right]\]Also known as: triple smoothed EMA, rate of change oscillator.
Reference: Hutson, J. (1983). “TRIX - Triple Exponential Smoothing Oscillator.” Technical Analysis of Stocks & Commodities, 1(5).
Triple Exponential Moving Average (TRIX) in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_trix as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
tickers=["^IXIC"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.technicals.get_trix(rounding=6).tail(5)
Or, after setting up the Finance Toolkit MCP, ask:
How did the TRIX of the Nasdaq Composite move from 24 to 31 December 2025?
Which returns:
| Date | ^IXIC | Benchmark |
|---|---|---|
| 2025-12-24 | 0.000367 | 0.000541 |
| 2025-12-26 | 0.000402 | 0.000582 |
| 2025-12-29 | 0.000432 | 0.00062 |
| 2025-12-30 | 0.000454 | 0.000651 |
| 2025-12-31 | 0.000452 | 0.00066 |
Parameters
get_trix accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The time period to consider for historical data. Can be “intraday”, “daily”, “weekly”, “monthly”, “quarterly” or “yearly”. Defaults to “daily”. | "weekly" |
close_column | str | The column name for closing prices in the historical data. Defaults to “Adj Close”. | "Close" |
window | int | The number of periods of each of the three exponential moving averages. Defaults to 15, the window of Hutson (1983) and StockCharts. | 20 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the Trix. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |