_SECTION_BEGIN("TSI");
r = Param( "TSI period 'R':", 25, 1, 100, 1 );
s = Param( "TSI period 'S':", 13, 1, 100, 1 );
u = Param( "TSI period 'U':", 1, 1, 100, 1 );
sig = Param( "Signal period:", 7, 1, 100, 1 );
Mtm = C - Ref ( C, -1 );
AbsMtm = abs ( Mtm );
Num_T = EMA ( EMA( EMA ( Mtm, r ), s ), u );
Den_T = EMA ( EMA( EMA ( AbsMtm, r ), s ), u);
TSI = 100 * Nz ( Num_T / Den_T );
TSIL = 100 * Nz ( Num_T / Den_T );
col = IIf( TSIL > Ref( TSIL, -1 ), colorGreen, colorRed );
Plot( TSIL, "TSI("+r+","+s+","+u+")", col, styleLine | styleThick);
col = IIf( EMA(TSI,sig) > Ref( EMA(TSI,sig), -1 ), colorGreen, colorRed );
Plot(0,"ZeroLine",ParamColor( "ColorZero", colorBlueGrey ),styleLine);
_SECTION_END();