Docs

ta.tsi

Measure momentum with a double smoothed ratio that stays between -100 and 100.

itm
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.

NameKindTypeDefaultRangeDescription
sourceSeriesnumber--The series to read.
shortLengthConstantnumber131 to 10000Window of the second smoothing.
longLengthConstantnumber251 to 10000Window of the first smoothing.

Output

NameType
valuenumber

Warm-up and missing values

Warm-up
longLength + shortLength bars. 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 longLength changes, and the short one needs shortLength of 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

itm
ta.tsi(close, 13, 25)
itm
plot(ta.tsi(close, 13, 25), "True strength")