-
Notifications
You must be signed in to change notification settings - Fork 0
Indicator Tii
kingchenc edited this page May 24, 2026
·
1 revision
M.H. Pee's Trend Intensity Index — the share of the most recent
dev_periodSMA-deviations that sit on the positive side, scaled to[0, 100]. Saturates at extremes on sustained trends.
| Field | Value |
|---|---|
| Family | Trend & Directional |
| Input type |
f64 (single close) |
| Output type | f64 |
| Output range | [0, 100] |
| Default parameters | (sma_period = 60, dev_period = 30) |
| Warmup period |
sma_period + dev_period − 1 (89 for the defaults) |
| Interpretation |
> 80 strong uptrend, < 20 strong downtrend, 50 flat / no trend. |
Given an SMA(close, sma_period), for each bar t past warmup
compute the deviation dev_t = close_t − SMA_t. Then over the most
recent dev_period deviations:
SD_pos = Σ_{i in window, dev_i > 0} dev_i
SD_neg = Σ_{i in window, dev_i < 0} |dev_i|
TII = 100 · SD_pos / (SD_pos + SD_neg)
A perfectly flat window (every dev_i == 0) returns the neutral
mid-point 50. The output is clamped to [0, 100] against
floating-point drift in the rolling subtractions.
| Name | Type | Default | Valid range | Description |
|---|---|---|---|---|
sma_period |
usize |
60 |
>= 1 |
Long-horizon SMA reference. |
dev_period |
usize |
30 |
>= 1 |
Window of recent deviations. Pee's canonical setup uses dev_period = sma_period / 2. |
-
Pure uptrend. Every close sits above the lagging SMA, so every
deviation is positive and
TII == 100. -
Pure downtrend. Every close sits below the SMA →
TII == 0. -
Choppy market. Positive and negative deviations roughly cancel
and the indicator hovers near
50.
M.H. Pee, "Trend Intensity Index", Stocks & Commodities, June 2002.
- Adx — directional-strength complement that does not use a moving-average reference.
- VerticalHorizontalFilter — alternative trend-strength filter, range-based.
-
Warmup Periods — the
sma_period + dev_period − 1TII entry.
Wickra on GitHub · crates.io · PyPI · npm · License: PolyForm-Noncommercial-1.0.0
- Alligator
- Alma
- Dema
- Ema
- Evwma
- Frama
- Hma
- Jma
- Kama
- McGinleyDynamic
- Sma
- Smma
- T3
- Tema
- Trima
- Vidya
- Vwma
- Wma
- Zlema
- AwesomeOscillator
- Cci
- Cmo
- ConnorsRSI
- Inertia
- Kst
- LaguerreRSI
- Mfi
- Mom
- Pgo
- Pmo
- Roc
- Rsi
- Rvi
- Smi
- Stochastic
- StochRsi
- Tsi
- UltimateOscillator
- WilliamsR
- Adx
- Adxr
- Aroon
- AroonOscillator
- ChoppinessIndex
- MacdIndicator
- MassIndex
- Rwi
- Tii
- Trix
- VerticalHorizontalFilter
- Vortex
- WaveTrend
- Atr
- BollingerBands
- BollingerBandwidth
- ChaikinVolatility
- Donchian
- GarmanKlassVolatility
- HistoricalVolatility
- Keltner
- Natr
- ParkinsonVolatility
- PercentB
- RogersSatchellVolatility
- RviVolatility
- StdDev
- TrueRange
- UlcerIndex
- YangZhangVolatility