VALYNOX
VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / Indicators and signals

TRIX indicator: triple-smoothed EMA, signals and a futures backtest

TRIX is the one-bar percent change of a price series smoothed three times by an exponential moving average. The triple smoothing removes small moves and cuts false signals, but every signal arrives late. Whether that trade is worth it is decided by costs and trade count, which only a backtest with costs can show.

By · Published · updated · Editorial policy

Contents
  1. What is the TRIX indicator and how is it calculated?
  2. How does TRIX differ from MACD?
  3. Which TRIX signals do traders trade: signal line or zero line?
  4. How should you set TRIX parameters?
  5. Why does TRIX lag and what does the lag cost?
  6. What does a futures backtest of a TRIX-style rule show after costs?
  7. How do you test TRIX on your own market, step by step?
  8. Frequently asked questions
  9. References

What is the TRIX indicator and how is it calculated?

The TRIX indicator is the one-bar percent change of a price series that has been smoothed three times with an exponential moving average. The triple smoothing removes small moves, so TRIX gives fewer false signals than a single moving average, but every signal arrives later. In a futures backtest, the cost of that lag shows up as a smaller captured move per trade.

An exponential moving average (EMA) is an average of recent prices that gives more weight to the newest price and less weight to older ones. TRIX takes an EMA of price, then an EMA of that result, then an EMA of the second result, and finally measures how much the third line moved from one bar to the next, in percent. Think of three coffee filters stacked on top of each other: each layer catches more grounds, and the liquid that comes out is cleaner but takes longer to arrive.

  1. EMA1: an EMA of the closing price with a chosen length, for example 15 bars.
  2. EMA2: an EMA of EMA1 with the same length.
  3. EMA3: an EMA of EMA2 with the same length.
  4. TRIX: the percent change of EMA3 from the previous bar to the current bar.

The one formula worth knowing is the last step:

TRIX today = (EMA3 today − EMA3 yesterday) ÷ EMA3 yesterday × 100

Here EMA3 today is the value of the third smoothing layer on the current bar, EMA3 yesterday is its value on the previous bar, and the division turns the difference into a percent so that TRIX can be compared across markets with different price levels. Some charting packages scale the result by a different factor, which changes the numbers on the axis but not the shape of the line or where it crosses zero. A positive TRIX means the triple-smoothed line is rising; a negative TRIX means it is falling. A signal line, usually a short EMA of TRIX itself, is often drawn on top so that crossovers can be traded. For a map of which other technical analysis tools and indicators can be turned into testable rules, TRIX belongs to the group of smoothed momentum lines.

A hypothetical price line and three EMA layers stacked below it. Each layer is smoother and peaks later than the one above. At the bottom, the TRIX line, the one-bar percent change of the third layer, crosses zero where that layer peaks. Smoother, but later Peaks shift right with each layer Price EMA 1 EMA 2 EMA 3 TRIX 0 TRIX = % change of EMA 3. So: expect clean but late signals.
Each EMA layer is smoother and later than the one above it. TRIX is the one-bar percent change of the third layer.

How does TRIX differ from MACD?

TRIX smooths one price series three times and reports a percent change, while MACD subtracts two EMAs of price and reports a difference in price points, so TRIX is smoother and slower and its zero line means a different thing. The two indicators are often confused because both are drawn as a line with a signal line and a zero line, and both are used for crossover trades. The construction and the meaning of the numbers differ.

MACD (moving average convergence divergence) is the fast EMA of price minus the slow EMA of price, with standard lengths of 12 and 26 bars and a 9-bar signal line. When MACD is above zero, the fast EMA sits above the slow EMA. When TRIX is above zero, the triple-smoothed line is rising from one bar to the next. One measures the distance between two averages; the other measures the slope of one heavily smoothed average.

FeatureTRIXMACD
InputOne price series smoothed three timesTwo EMAs of price (fast and slow)
Output unitPercent change per barPrice points
Zero line meansTriple EMA turning up or downFast EMA above or below slow EMA
Signal lineEMA of TRIXEMA of MACD
Relative lagLongerShorter
Typical trade countFewerMore
TRIX and MACD compared: TRIX is measured in percent per bar and its zero line marks the smoothed slope turning, while MACD is measured in price points and its zero line marks two EMAs crossing; TRIX lags longer and trades less often Two lines, two meanings Unit and zero line differ most TRIX MACD Unit % per bar Points Zero line Slope turns EMAs cross Lag Longer Shorter Trades Fewer More A % unit carries across markets. So: test a TRIX rule on its own.
TRIX and MACD side by side. The output unit and the meaning of the zero line are the differences that change how a rule behaves.

The practical consequence of the percent unit is that a TRIX threshold written for one market carries over to another with a different price level, while a MACD threshold in points does not. The practical consequence of the extra smoothing is that a TRIX rule and a MACD rule with similar lengths will not enter on the same bar: TRIX will usually be later and will skip some of the short swings that MACD trades.

Which TRIX signals do traders trade: signal line or zero line?

A signal-line crossover fires earlier and more often, a zero-line crossover fires later and less often, and the choice decides how many trades costs will eat. A signal-line crossover is the moment TRIX crosses above or below its own short EMA. A zero-line crossover is the moment TRIX itself changes sign. Because the signal line follows TRIX closely, the two lines cross whenever TRIX bends, which happens many times in a sideways market. TRIX crosses zero only when the triple-smoothed trend actually reverses.

ChoiceSignal-line crossoverZero-line crossover
RuleBuy when TRIX crosses above its signal line, sell when it crosses belowBuy when TRIX crosses above zero, sell when it crosses below
TimingEarlierLater
Trade countHigherLower
Sideways marketSeveral quick whipsaw tradesFew or no trades
Captured move per tradeSmaller, but more of themLarger, but fewer of them
Weight of costsHeavierLighter
Over one hypothetical market stretch of up, flat and down, signal-line crossovers trade earlier and produce three whipsaw trades in the flat part, while zero-line crossovers trade later and produce no trades in the flat part Earlier, but more whipsaws Each dot is a trade Market Up Flat Down Signal line 3 whipsaws Zero line none Flat stretch: 3 trades vs none. So: let costs pick the signal.
On the same chart, signal-line crosses fire earlier and more often; in the flat stretch they produce three whipsaw trades while the zero line produces none.

A whipsaw is a trade that enters on a signal and exits on the opposite signal a few bars later with little or no price movement in between, so the trade result is mostly the commission and slippage. The signal-line rule produces more whipsaws because it reacts to every bend. Some traders combine the two: enter on a signal-line cross only when TRIX is on the same side of zero as the trade direction. That filter removes the counter-trend whipsaws but keeps the earlier timing in a trend. Whichever variant you choose, write it down exactly before you test it, because the trade count difference between the variants is large and decides the cost burden. The test method is the same one used for a Bollinger Bands strategy backtest: one rule, one cost setting, one date split.

How should you set TRIX parameters?

The common length settings sit between roughly 9 and 30 bars; a shorter length trades more and lags less, a longer length trades less and lags more, and neighbouring values should behave alike before you trust any of them. The length is the number of bars used in each of the three EMA layers. A default of 15 with a 9-bar signal line is widely used, but there is nothing special about those numbers.

SettingLength 9Length 15Length 30
Lag after a price turnShortestMediumLongest
Zero-line crosses per yearMostFewerFewest
Whipsaws in sideways marketsManySomeFew
Share of a long trend keptSmaller per trade, often re-enteredMediumLarger per trade
Usual bar sizeIntraday barsHourly to daily barsDaily to weekly bars
Illustration of one price stretch at three TRIX lengths: length 9 crosses zero 7 times with the shortest lag, length 15 crosses 4 times with medium lag, length 30 crosses 2 times with the longest lag Fewer crosses, more lag Illustration: same prices, 3 lengths Length Zero crosses Lag 9 15 30 7 4 2 No length is free of trade-offs. So: test 12, 15 and 18 together.
The same price stretch at three lengths: shorter lengths cross zero more often and sooner after a price turn; longer lengths cross less often and later.

The way to choose a length is not to pick the one with the best backtest. It is to run several neighbouring lengths, for example 12, 15 and 18, and look for a region where the results are similar. If 15 is good and both 12 and 18 are poor, the 15 result is most likely a lucky fit to one stretch of history. If all three are similar, the rule is responding to something in the market rather than to noise. The method for reading such a parameter plateau against a lucky spike applies to TRIX exactly as to any other indicator. Intraday traders who shorten the length to get faster signals should check the trade count first, because the question of which indicator holds up for intraday trading is usually settled by costs per trade long before it is settled by signal quality.

Why does TRIX lag and what does the lag cost?

Three layers of EMA smoothing mean a trend turn shows up in TRIX only after price has already moved, so each trade gives up part of the move at the entry and again at the exit. Lag is the number of bars between the moment price changes direction and the moment the indicator reports the change. Each EMA responds to a new price only partly on the bar it arrives and finishes responding over the following bars. Stacking three EMAs stacks three delays.

Think of a message passed along three people in a row. Each person waits a moment before repeating it. The message arrives clean, because each person drops the stutters, but it arrives after the event it describes. A rule that enters on the TRIX signal is always buying into a move that has already begun and selling after a top that has already formed.

Hypothetical example

Suppose a futures contract turns up at 100 on bar 0, rises to 110, and turns down. A TRIX zero-line rule confirms the turn several bars later, when price is already at 103, and enters long there. After the top, TRIX turns negative when price has fallen back to 107, and the rule exits there. The full swing was 10 points. The trade captured 4 points. The entry lag gave up 3 points and the exit lag gave up another 3. With commission and slippage subtracted, the net result is smaller still.

Hypothetical example: a swing from 100 to 110 is 10 points; a TRIX rule enters at 103 and exits at 107, capturing 4 points, while 3 points are lost to entry lag and 3 to exit lag Lag costs 6 of 10 points Hypothetical swing, 100 to 110 Entry lag Captured Exit lag 3 pts 4 pts 3 pts 100 103 107 110 Full swing: 10 points Lag eats both ends of a move. So: trade trends that outlast the lag.
Hypothetical example: of a 10-point swing, the TRIX rule captures 4 points; 3 are lost to entry lag and 3 to exit lag.

The lag is also why TRIX does well in long trends and poorly in short swings. In a trend that lasts many times longer than the lag, the lost points at each end are a small share of the move. In a swing that lasts only slightly longer than the lag, the lost points can be the whole move, and the trade becomes a whipsaw. Indicators built on price position rather than on a smoothed slope, such as the ATR-based flip line explained in the Supertrend indicator backtest, make a different trade-off: they react to price directly and accept more noise in return. Neither choice is free; the backtest with costs shows which one your market pays for.

What does a futures backtest of a TRIX-style rule show after costs?

The run tested a rate-of-change stand-in on ES daily bars with commission and slippage, and its results come from the one kept candidate out of 1,024, which flatters it and must be read as a sample result, not an expectation. The rule used a Rate Of Change signal as its only entry and exit, long and short, one contract, with no stop, no target and no filters. It is a stand-in: TRIX is itself a rate of change of a triple-smoothed series, so a plain rate-of-change rule is a close cousin, but it is not TRIX and its lag is shorter. The market was the E-mini S&P 500 future (ES) on daily bars from 2019-01-02 to 2025-06-30.

Source: AlphaPrime product engine (CPU), run 2026-10-31. ES daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $25 slippage per trade.

NumberResult
Net profit (closed trades)$68,585
Max drawdown$64,677.5
Trades47
Win rate57.45%
Profit factor1.638
Average trade$1,459.26
Time in market94.01%
Look at how far the curve falls from its peaks relative to how far it climbs, and where the out-of-sample stretch sits on the time axis.
Look at how far the curve falls from its peaks relative to how far it climbs, and where the out-of-sample stretch sits on the time axis. ES · daily · 2019-01-02 to 2025-06-30 · CPU engine backtest
Read the net profit against the max drawdown and note the small trade count over six and a half years.
Read the net profit against the max drawdown and note the small trade count over six and a half years. ES · daily · 2019-01-02 to 2025-06-30 · CPU engine backtest

Four readings matter. First, the search kept this candidate out of 1,024 it tried, for its return against its drawdown; the other candidates did worse on that measure, and choosing the winner after the fact makes the winner look better than a rule chosen in advance would. Bailey, Borwein, López de Prado and Zhu (2014) show how quickly the best of many trials becomes an inflated result. Second, the max drawdown of $64,677.5 is almost as large as the net profit of $68,585, so a trader following this rule with one contract would have sat through a loss nearly equal to everything the rule made over the period. Third, 47 trades is a small sample; a handful of different trades would move the average trade of $1,459.26 a long way. Fourth, time in market of 94.01% means the rule was almost always holding a position, long or short, which is what a slow trend-following signal with no exit of its own does.

What the run does show about costs is useful. The $20 commission and $25 slippage per trade were charged inside every one of the 1,024 evaluations, which is how AlphaPrime (Valynox) runs backtesting: fees and slippage are part of each candidate's score during the search, not a deduction made afterwards, so the candidate ranking already reflects what could be traded. On daily bars with 47 trades, $45 per trade is a small share of the average trade. The same rule on 5-minute bars would trade many times more often with a far smaller move per trade, and the same $45 would become the deciding number. That is the point the lag section made in reverse: a slow indicator loses points to lag but keeps the trade count low enough that costs stay small.

How do you test TRIX on your own market, step by step?

Write the rule, set the costs first, split the data by date, check neighbouring settings and read the trade list before deciding anything. The order matters because each step protects the next one from a decision made by feel. Long studies of simple moving-average rules, such as Brock, Lakonishok and LeBaron (1992), found patterns on long histories but left open how much survived realistic costs, and the survey by Park and Irwin (2007) found that reported results depend heavily on how costs and the number of rules tried were handled. Your own test should settle both before it starts.

  1. Write the exact entry and exit rule. State the length, the signal-line length if used, whether you trade the signal-line cross or the zero-line cross, whether you trade both directions, and what closes a trade. "TRIX 15, zero-line cross, long and short, exit on the opposite cross" is a rule. "TRIX crossover" is not.
  2. Set commission and slippage before the first run. Use your broker's round-trip commission plus at least one tick of slippage per side for a liquid future. A rule that is tested first without costs will be ranked by trade count, and TRIX variants with short lengths will look best for the wrong reason.
  3. Split the history by date into in-sample and out-of-sample. Choose the length and the signal variant on the earlier part and run the chosen rule unchanged on the later part. Write the split date down before you look at any result.
  4. Run neighbouring lengths and compare. If you chose 15, run 12 and 18 as well. Similar results mean the setting sits on a plateau; a sharp peak at 15 means it was fitted to noise.
  5. Read the trade list and the average trade after costs before accepting or rejecting. Count the trades, find the largest winners and ask whether the result survives without them, and compare the average trade with the round-trip cost. A per-trade edge that is only a little larger than the cost will not survive a small rise in slippage.
Five steps to test a TRIX rule, in order: write the exact rule, set costs first, split in-sample and out-of-sample by date, run neighbouring lengths 12, 15 and 18, and read the trade list after costs Five steps, in this order Each step before seeing results 1 2 3 4 5 Write the exact rule Set costs first Split IS and OOS by date Run lengths 12, 15 and 18 Read the trade list Each step guards the next. So: write it all down before run 1.
The five steps in order. Each one is done before the next so that no decision is made after seeing the result it should have been protected from.

A good result from these five steps looks like this: a plateau of similar results across neighbouring lengths, an out-of-sample average trade that is positive and not far below the in-sample figure, and a result that stays positive after the five largest winners are removed. A bad result looks like a sharp peak at one length, a flat or falling out-of-sample curve, or a profit that lives in two or three trades.

The next thing to do is concrete. Take the market and bar size you actually trade, write a TRIX zero-line rule with length 15, add your real commission and one tick of slippage per side, and run it alongside lengths 12 and 18 on the first 70 percent of your history. Before you look at any equity curve, open the trade list and count the trades. If the count is below about 30, the result is a hint and not a finding, and the first change to make is a longer history, not a different length.

Frequently asked questions

Is TRIX a leading or lagging indicator?

TRIX is a lagging indicator. It is built from three layers of exponential moving averages, and each layer responds to a new price only after several bars. A trend turn therefore appears in TRIX after price has already moved. The benefit of the lag is that short, noisy moves are filtered out, so TRIX produces fewer false signals than faster momentum lines.

What is the difference between TRIX and MACD?

TRIX smooths one price series three times and reports its one-bar percent change, so its zero line marks the point where the smoothed trend turns up or down. MACD subtracts a slow EMA of price from a fast EMA and reports the gap in price points, so its zero line marks the point where the two averages cross. TRIX is smoother and slower and produces fewer trades; MACD reacts sooner and produces more.

What is a good TRIX setting for day trading?

Shorter lengths, often between 9 and 15 bars, are used on intraday bars because they lag less, but they also trade more often and produce more whipsaws in sideways sessions. There is no single good setting. Test the length you plan to use together with its neighbours, with your real commission and slippage included, and count the trades before you judge the equity curve. On intraday bars the cost per trade usually decides the result before the signal quality does.

What does it mean when TRIX crosses zero?

A cross above zero means the triple-smoothed price line has started rising from one bar to the next; a cross below zero means it has started falling. Because the line is heavily smoothed, a zero cross happens only after a sustained change in direction, which is why zero-line rules trade less often than signal-line rules and enter later. Many traders use the sign of TRIX as a trend filter and take entries from a faster signal.

Can TRIX be used on its own as a strategy?

A TRIX crossover can be written as a complete rule with an entry and an exit, and it can be backtested as it stands. Whether it should be traded alone depends on what the test shows on your market after costs: the trade count, the average trade after commission and slippage, the drawdown, and whether neighbouring lengths behave alike. Most traders who keep a TRIX rule add a stop or a time exit, because a crossover-only exit can hold a losing position for many bars while it waits for the slow line to turn.

References

  • Bailey, D. H., Borwein, J., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458–471.
  • Brock, W., Lakonishok, J., & LeBaron, B. (1992). Simple Technical Trading Rules and the Stochastic Properties of Stock Returns. The Journal of Finance, 47(5), 1731–1764.
  • Park, C.-H., & Irwin, S. H. (2007). What Do We Know About the Profitability of Technical Analysis? Journal of Economic Surveys, 21(4), 786–826.