Variable TREND_STRENGTH_INDEXConst

TREND_STRENGTH_INDEX: IndicatorDescriptor = ...

Trend Strength Index: the correlation between price and the passage of time.

A perfectly straight rising line correlates +1 with the bar index and a straight fall correlates -1, so the reading is "how close to a straight line has this been", not "how fast". Being a correlation it is bounded to -1..1, hence the declared range.

Pearson correlation is invariant under shifting either input, so counting the position within the supplied bars, rather than from the start of all history, changes nothing.

The published study paints gradient fills between the line and zero, which this library cannot express (a fill needs two plot edges and one flat colour). The two colour inputs it spends on those gradients tint the +1 / -1 bands here instead, so they still mean bullish and bearish.