The true strength index (TSI) is a technical indicator used in the analysis of financial markets that attempts to show both trend direction and overbought/oversold conditions. It was first published William Blau in 1991. The indicator uses moving averages of the underlying momentum of a financial instrument. Momentum is considered a leading indicator of price movements, and a moving average characteristically lags behind price. The TSI combines these characteristics to create an indication of price and direction more in sync with market turns than either momentum or moving average. (source: wikipedia)
a = (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close))))
b = (ExponentialAverage[13](ExponentialAverage[25](ABS(ROC[1](close)))))
TSI = 100 * (a/b)
RETURN TSI as "True Strength Index", 0
You must be logged in to post a comment.
I think if you substitute Momentum for ROC in the code you get the tool values.
Hello, The formula you describe in this post is not the same as in the prorealtime tool (predefined indicators). Could you please show the formula used in prorealtime? Thanks
Hi I had same problem, so I translated from NinjaTrader TSI's formula to PRT code, seems the same values now! Fast = 3 Slow = 14 constant1 = 2 / (1 + Slow) constant2 = 1 - (2 / (1 + Slow)) constant3 = 2 / (1 + Fast) constant4 = 1 - (2 / (1 + Fast)) IF BarIndex = 0 THEN fastAbsEma = 0 fastEma = 0 slowAbsEma = 0 slowEma = 0 Valor = 0 ELSE momento = Close[0] - Close[1] slowEma = momento * constant1 + constant2 * slowEma fastEma = slowEma * constant3 + constant4 * fastEma slowAbsEma = Abs(momento) * constant1 + constant2 * slowAbsEma fastAbsEma = slowAbsEma * constant3 + constant4 * fastAbsEma[1] IF fastAbsEma = 0 THEN Valor = 0 ELSE Valor = 100 * fastEma[0] / fastAbsEma[0] ENDIF ENDIF Return Valor AS "TSI"