indicator · own pane · open source
True Strength Index
Running…
Loading chart…
About
True Strength Index (TSI) double-smooths price momentum and divides it by the smoothed absolute momentum, scaled to ±100. Quieter than RSI but with cleaner zero-line crosses.
- Above +25 = strong bullish, below -25 = strong bearish.
- Zero-line crosses are momentum signals.
- Raise
Slowfor fewer, slower swings.
Source code
//@version=5
indicator("True Strength Index", overlay=false)
rlen = input.int(13, "Short Length", minval=2, maxval=100)
slen = input.int(25, "Long Length", minval=2, maxval=200)
src = input.source("close", "Source")
momentum = ta.ema(ta.ema(ta.change(src), rlen), slen)
absm = ta.ema(ta.ema(math.abs(ta.change(src)), rlen), slen)
tsi = 100 * momentum / absm
hline(25, "Overbought", color=color.gray, linestyle=hline.style_dashed)
hline(-25, "Oversold", color=color.gray, linestyle=hline.style_dashed)
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)
p_TSI = plot(tsi, "TSI", color=color.purple, linewidth=2)
alertcondition(ta.crossover(tsi, 0), "TSI crosses zero up", "True Strength Index turned positive")
alertcondition(ta.crossunder(tsi, 0), "TSI crosses zero down", "True Strength Index turned negative")
No comments yet.
Sign in to comment.