Sidechair

ta.tsi()

Browse the reference

Returns the true strength index: double-smoothed momentum divided by double-smoothed absolute momentum, between -1 and 1.

Try it in the editor

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

Pine Script
ta.tsi(source: series int/float, short_length: simple int, long_length: simple int) -> series float

Arguments

NameTypeDefaultDescription
sourceseries int/floatrequiredSeries whose changes are smoothed.
short_lengthsimple intrequiredLength of the second, shorter EMA pass. A whole number of 1 or more.
long_lengthsimple intrequiredLength 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

Pine ScriptTrue strength index in percentOpen in editor
//@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