Skip to main content

TSI for Amibroker (AFL)

Anonymous over 15 years ago Amibroker (AFL)

  • Rating:
    4 / 5 (Votes 2)
  • Tags:
    oscillator, amibroker

This is a tweaked TSI from William Blau, plotted in a different way.
Gives very nice signals, when both lines are crossing!

Screenshots

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("TSI");
r = Param( "TSI period 'R':", 7, 1, 100, 1 );
s = Param( "TSI period 'S':", 27, 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 );

//Green TSIL Line=Rising; Red TSIL Line=Falling
col = IIf( TSIL > Ref( TSIL, -1 ), colorGreen, colorRed );
Plot( TSIL, "TSI("+r+","+s+","+u+")", col, styleLine | styleThick);
//Green EMA TSI,sig Line=Rising; Red EMA TSI,sig Line=Falling
col = IIf( EMA(TSI,sig) > Ref( EMA(TSI,sig), -1 ), colorGreen, colorRed );
Plot( EMA(TSI,sig), "", col, styleThick);
Plot( TSI, "TSI("+r+","+s+","+u+")", ParamColor( "Color", colorBlueGrey ), ParamStyle("Histogram style", styleThick | styleHistogram | styleNoLabel, maskHistogram ) );
Plot(0,"ZeroLine",ParamColor( "ColorZero", colorBlueGrey ),styleLine);

Title =FullName();
_SECTION_END();

9 comments

over 15 years ago

this param is original from William Blau

r = Param( "TSI period 'Length':", 25, 1, 100, 1 );
s = Param( "TSI period 'Smoothing':", 13, 1, 100, 1 );
over 15 years ago

Hi baby.learn.to.trade

As I mentioned, this one is tweaked!
This one is calculated with 3 variables…
Let me know what you think about it!

Regards,

Ceurami

4. morgen
almost 15 years ago

“astrotrade”, try this:

_SECTION_BEGIN("TSI");
r = Param( "TSI period 'R':", 7, 1, 100, 1 );
s = Param( "TSI period 'S':", 27, 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 );

//Green TSIL Line=Rising; Red TSIL Line=Falling
col = IIf( TSIL > Ref( TSIL, -1 ), colorGreen, colorRed );
Plot( TSIL, "TSI("+r+","+s+","+u+")", col, styleLine | styleThick);
//Green EMA TSI,sig Line=Rising; Red EMA TSI,sig Line=Falling
col = IIf( EMA(TSI,sig) > Ref( EMA(TSI,sig), -1 ), colorGreen, colorRed );
Plot( EMA(TSI,sig), "", col, styleThick);
Histcol= IIf(TSI>0,colorLime,colorRed) ;
Plot( TSI, "", histcol, ParamStyle("Histogram style", styleThick |
     styleHistogram | styleNoLabel, maskHistogram ) );
Plot(0,"",ParamColor( "ColorZero", colorBrown ),styleLine);

//Title = "TSI";
_SECTION_END();

mybuy=  TSIL > Ref( TSIL, -1 ) AND EMA(TSI,sig) > Ref( EMA(TSI,sig), -1 ) AND TSIL>EMA(TSI,sig) ;
mysell= TSIL < Ref( TSIL, -1 ) AND EMA(TSI,sig) < Ref( EMA(TSI,sig), -1 ) AND TSIL<EMA(TSI,sig) ;

Buy = ExRem(myBuy, mysell);
Sell = ExRem(mysell, myBuy);

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBlue,0);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0);
5. morgen
almost 15 years ago

Try this:

mybuy=  TSIL > Ref( TSIL, -1 ) AND EMA(TSI,sig) > Ref( EMA(TSI,sig), -1 ) AND TSIL>EMA(TSI,sig) AND TSIL>0 ;
mysell= TSIL < Ref( TSIL, -1 ) AND EMA(TSI,sig) < Ref( EMA(TSI,sig), -1 ) AND TSIL<EMA(TSI,sig) ;

Buy = ExRem(myBuy, mysell);
Sell = ExRem(mysell, myBuy);

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBlue,0);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0);
almost 15 years ago

dear sir morgen

the formula aditions for buy and sell and plot arrows shows syntex error. can u pl check and post the entire formula ?

with regards
ravi
qatar

almost 15 years ago

// Add this to TSI FORMULA code

mybuy= TSIL > Ref( TSIL, - 1 ) AND EMA(TSI,sig) > Ref( EMA(TSI,sig), -1 ) AND TSIL>EMA(TSI,sig) AND TSIL>0 ;
mysell= TSIL < Ref( TSIL, - 1 ) AND EMA(TSI,sig) < Ref( EMA(TSI,sig), -1 ) AND TSIL<EMA(TSI,sig);

Buy = ExRem(myBuy, mysell);
Sell = ExRem(mysell, myBuy);

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBlue,0);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0);
almost 14 years ago

Error is due to TSI Period R, S, U not defined, any solution where to initiatlise that

Leave Comment

Please login here to leave a comment.