Returns the true strength index: double-smoothed momentum divided by double-smoothed absolute momentum, between -1 and 1.
ta.tsi takes the bar-to-bar change of source and smooths it twice with EMAs, first over long_length bars and then short_length. It does the same to the absolute change and divides the two results.
The output runs from -1 to +1; multiply by 100 for a percentage scale. The first value appears on bar number short_length + long_length.
Syntax
ta.tsi(source: series int/float, short_length: simple int, long_length: simple int) -> series floatArguments
| Name | Type | Default | Description |
|---|---|---|---|
| source | series int/ | required | Series whose changes are smoothed. |
| short_length | simple int | required | Length of the second, shorter EMA pass. A whole number of 1 or more. |
| long_length | simple int | required | Length of the first, longer EMA pass. A whole number of 1 or more. |
Returns
series float: the true strength index from -1 to 1, or na during warm-up.
Remarks
- Crossings of zero mark a change in the net direction of smoothed momentum.
Example
//@version=6
indicator("TSI")
value = 100 * ta.tsi(close, 13, 25)
plot(value, "TSI", color = color.blue)
plot(ta.ema(value, 13), "Signal", color = color.orange)
hline(0)See also
Runs on Sidechair