In essence, it is simply the standard deviation of the last x bars of a
y-bar moving average. Thus, the TAI is a simple trend indicator when prices
trend with authority, the slope of the moving average increases, and when
prices meander in a trendless range, the slope of the moving average decreases.
y-bar moving average. Thus, the TAI is a simple trend indicator when prices
trend with authority, the slope of the moving average increases, and when
prices meander in a trendless range, the slope of the moving average decreases.
//////////////////////////////////////////////////////////// // Copyright by HPotter v1.0 28/05/2014 // In essence, it is simply the standard deviation of the last x bars of a // y-bar moving average. Thus, the TAI is a simple trend indicator when prices // trend with authority, the slope of the moving average increases, and when // prices meander in a trendless range, the slope of the moving average decreases. //////////////////////////////////////////////////////////// study(title="Trend Analysis Index", shorttitle="TAI") AvgLen = input(28, minval=1) TAILen = input(5, minval=1) hline(0, color=purple, linestyle=dashed) xPrice = close xSMA = sma(xPrice, AvgLen) xHH = highest(xSMA, TAILen) xLL = lowest(xSMA, TAILen) nRes = (xHH - xLL) * 100 / xPrice plot(nRes, color=blue, title="TAI")