TSI - Trend Strength Indicator

Hi I’m looking for the AFL code of the Trend strength indicator by Frank Hassler, NOT the True strength index by W Blau.

TSI shows promise in being used as a superior replacement for the ADX. It can be looked at to help determine when a security is trending or mean reverting, and it can also be used as a filter or ranking element within a system. It works well in the stock indices. Readings above 1.65 indicate a strong trending market.

The actual formula for the indicator is as follows:

TSI = Average(Average(Ratio,10),100)
Ratio = (abs(today’s close - close of 10 days ago) / atr(10)

Where the atr10 is 10 day average true range

I don’t know how to code in AFL, so if someone would be kind enough to post or code it I’m much appreciative of it!

Thanks!

Ratio = abs(close - Ref(Close, -10)) / ATR(10);
TSI = MA(MA(Ratio,10),100);
Plot(TSI, "TSI", colorRed, styleLine);

6 Likes

Thank you very much!