# Trend Intensity Index

A Trend concept (Trend strength & direction) in the LuxAlgo Library, with 1 indicator implementation.

## What is the Trend Intensity Index?

The Trend Intensity Index (TII) measures how one-sided price has been relative to its own moving average. Instead of asking how fast price is moving, it asks what fraction of recent deviations from a [SMA](https://www.luxalgo.com/library/concept/sma/) landed on the upside. When nearly every recent close sits above the average, the index approaches 100; when nearly every close sits below, it approaches 0; a market oscillating around its average reads near 50. The result is a bounded 0 to 100 gauge of trend persistence.

The indicator was introduced by M.H. Pee in a 2002 Technical Analysis of Stocks & Commodities article. Its design choice is deliberate: by summing the magnitudes of positive and negative deviations rather than counting bars, a market that hugs its average from above scores as strongly trending even if individual bars are small, while a market that whips violently to both sides scores near neutral no matter how large the bars are.

Traders use it because trend-following entries taken in non-trending conditions are the largest source of whipsaw losses. A persistence gauge like the TII is a cheap way to require that the market has already been picking a side before committing to a directional system.

## How it's calculated

Deviations of close from a moving average are split by sign over a recent window and the upside share is expressed as a percentage.

```
MA_t = SMA(close, n)
dev_t = close_t - MA_t
SD_pos = sum of dev_t over the last m bars where dev_t > 0
SD_neg = sum of abs(dev_t) over the last m bars where dev_t < 0
TII = 100 * SD_pos / (SD_pos + SD_neg)

  close_t: close at bar t
  n: moving average length (default 60)
  MA_t: simple moving average of close over n bars
  dev_t: deviation of close from the average at bar t
  m: deviation window, conventionally n / 2 (default 30)
  SD_pos: summed magnitude of positive deviations over the window
  SD_neg: summed magnitude of negative deviations over the window
  TII: trend intensity reading, 0 to 100
```

Pee's original uses a 60-bar average with a 30-bar deviation window.

Some implementations count bars above and below the average instead of summing deviation magnitudes; readings differ modestly but the interpretation is the same.

## How traders use it

- As a directional filter: readings above 80 are commonly treated as an established uptrend and readings below 20 as an established downtrend, gating which side a trend system may trade. The 80/20 thresholds are conventions, not optimized values.
- As a breakout confirmation: a TII rising through 50 to 60 while price clears a range suggests the move has persistence behind it rather than a single impulsive bar.
- As an early-warning gauge: a TII rolling over from extreme readings while price still grinds to marginal new highs often precedes a transition into range conditions, though it gives no timing for the turn.
- Its limitations follow from the moving average inside it: the TII lags at trend starts, and in slow drifts it can pin near 100 or 0 for long stretches, so it works better as a regime gate than as a standalone entry signal. Broader alternatives are covered under [trend/range classifiers](https://www.luxalgo.com/library/concept/trend-range-classifiers/).

## Trend Intensity Index vs adjacent strength gauges

- **ADX / DMI system** (https://www.luxalgo.com/library/concept/adx-dmi-system/): ADX builds trend strength from directional movement of highs and lows; it is bounded at 100 in theory but rarely reads above 60 in practice, and it carries no direction of its own. The TII is a simpler bounded ratio anchored to one moving average, with direction encoded directly in whether it sits above or below 50.
- **Vertical Horizontal Filter** (https://www.luxalgo.com/library/concept/vertical-horizontal-filter/): The VHF measures path efficiency and deliberately ignores direction, so it cannot say which way the trend points. The TII is directional by construction: high readings mean up-persistence, low readings mean down-persistence.
- **R-squared trend fit** (https://www.luxalgo.com/library/concept/r-squared-trend-fit/): R-squared scores how well a straight line explains recent prices, a regression view of trendiness. The TII scores which side of a moving average price has favored, so a curved but persistent trend can score high on TII while fitting a line poorly.

## FAQ

### What are the standard Trend Intensity Index settings?

The original specification uses a 60-period simple moving average with deviations measured over the most recent 30 bars. Shorter pairs such as 30/15 react faster at the cost of more false regime flips.

### What TII levels indicate a trend?

Common practice reads above 80 as a strong uptrend, below 20 as a strong downtrend, and the middle band as rangebound or transitioning. These are conventions; the useful thresholds vary by market and timeframe.

### Is the TII an overbought/oversold oscillator?

No. Extreme readings signal persistence, not exhaustion, so a TII near 100 is an argument for trend continuation rather than a reversal signal. Treating it like a stochastic inverts its intended meaning.

### Does the TII repaint?

No. Each value uses only completed closes and a fixed-length window, so historical readings do not change as new bars arrive.

## Implementations in the Library

- Trend Intensity Index (LuxAlgo): https://www.luxalgo.com/library/indicator/trend-intensity-index/

## Related concepts

- Trend Regime Label: https://www.luxalgo.com/library/concept/trend-regime-label/
- ADX / DMI System: https://www.luxalgo.com/library/concept/adx-dmi-system/
- Aroon: https://www.luxalgo.com/library/concept/aroon/
- Vortex: https://www.luxalgo.com/library/concept/vortex/
- Vertical Horizontal Filter: https://www.luxalgo.com/library/concept/vertical-horizontal-filter/
- R-squared Trend Fit: https://www.luxalgo.com/library/concept/r-squared-trend-fit/
- Kaufman Efficiency Ratio: https://www.luxalgo.com/library/concept/kaufman-efficiency-ratio/
- Correlation Trend Indicator: https://www.luxalgo.com/library/concept/correlation-trend-indicator/
- Random Walk Index: https://www.luxalgo.com/library/concept/random-walk-index/
- Trend-quality Composites: https://www.luxalgo.com/library/concept/trend-quality-composites/

---

Source: https://www.luxalgo.com/library/concept/trend-intensity-index/ (LuxAlgo Library, the encyclopedia of trading & technical analysis). Free to use with attribution: https://www.luxalgo.com/library/license/