True strength index
All indicators

LibraryMomentum

Indicator

True strength index

The smoothed bar to bar price change against the smoothed size of those changes, from -100 to 100: the direction of momentum and how steady it is.

MomentumOwn pane4 inputsTSI

How it is calculated

The change m is the price minus the previous price. TSI is 100 times an EMA over the short length of an EMA over the long length of m, divided by the same double EMA of the absolute m. The signal line is an EMA of TSI over the signal length. Every EMA is seeded with the plain mean of its own first values. There is no value while the smoothed absolute change is zero, which only happens before price first moves. After Blau 1991.

Reference: Blau 1991

How to read it

Above zero the smoothed changes are mostly up, below zero mostly down; values near 100 or -100 mean nearly every bar moved the same way. Crossings of zero and of the signal line mark turns. The double smoothing makes it calmer than RSI but also later. Divergences with price hint at a fading trend.

In a strategy

A trend entry when TSI crosses above its signal line while above zero: ctx.ind("tsi", long=25, short=13, signal=13) gives .tsi and .signal, each compared with the previous bar.

Inputs

InputTypeDefaultRange or choices
Long lengthlongWhole number25min 1, max 5000
Short lengthshortWhole number13min 1, max 5000
Signal lengthsignalWhole number13min 1, max 5000
SourcesourcePrice"close"close, open, high, low, hl2, hlc3, ohlc4, hlcc4

What it draws

LineDrawn as
TSILine
SignalLine

Guide lines at 0.

Used in

No strategy template reads it yet.

OrionQuant