How it is calculated
Three EMAs over the same length are chained: the second averages the first, the third the second, each seeded with the plain mean of its own first values. TRIX is the percent change of the third average from the bar before, (now divided by before, minus 1) times 100, and 0 when the earlier value is 0. The first value is on bar 3 times (length minus 1) plus 1, counted from 0. As TA-Lib TRIX, after Hutson 1983.
Reference: TA-Lib TRIX (Hutson 1983)
How to read it
Above zero the smoothed trend rises, below zero it falls; a zero crossing marks a turn of the triple average. The heavy smoothing filters small swings but makes it late: it confirms a turn rather than anticipating it. The values are small, often a fraction of a percent, and depend on the timeframe.
In a strategy
A trend filter that allows longs only while ctx.ind("trix", length=18) > 0, or an entry when it crosses above zero, compared with its value a bar earlier.
Inputs
| Input | Type | Default | Range or choices |
|---|---|---|---|
Lengthlength | Whole number | 18 | min 1, max 5000 |
Sourcesource | Price | "close" | close, open, high, low, hl2, hlc3, ohlc4, hlcc4 |
What it draws
| Line | Drawn as |
|---|---|
| TRIX | Line |
Guide lines at 0.
Used in
No strategy template reads it yet.