ta.tsi
Measure momentum with a double smoothed ratio that stays between -100 and 100.
ta.tsi(source, shortLength, longLength)True Strength Index: 100 * ema(ema(change, longLength), shortLength) / ema(ema(abs(change), longLength), shortLength), where change is the one-bar difference of the source. It is scaled by 100 and bounded to [-100, 100], so divide by 100 for the unscaled ratio in [-1, 1]. The averages are ta.ema, seeded with the simple average of the first full window.
Parameters
A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.
| Name | Kind | Type | Default | Range | Description |
|---|---|---|---|---|---|
source | Series | number | - | - | The series to read. |
shortLength | Constant | number | 13 | 1 to 10000 | Window of the second smoothing. |
longLength | Constant | number | 25 | 1 to 10000 | Window of the first smoothing. |
Output
| Name | Type |
|---|---|
value | number |
Warm-up and missing values
- Warm-up
longLength + shortLengthbars. Names in the warm-up are this operator’s parameters.- Missing values
- na until both averages have warmed up on top of one another. The first change needs two bars, the long average needs
longLengthchanges, and the short one needsshortLengthof the long average's values. The first value lands on the bar at index longLength + shortLength - 1, so longLength + shortLength bars in all. An na in the source resets the momentum and both smoothings. na when the smoothed absolute momentum is zero.
Example
ta.tsi(close, 13, 25)plot(ta.tsi(close, 13, 25), "True strength")