TSI & Buy Sell Signals for Amibroker (AFL)
morgen almost 15 years ago Amibroker (AFL)
On request!
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);
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();
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//FORMULE
Cuptop1= C>BBandTop( C,20,1 ) ;
top1up= BBandTop( C,20,1 )>=Ref(BBandTop( C,20,1 ),-1) ;
top2up= BBandTop( C,20,2 )>=Ref(BBandTop( C,20,2 ),-1) ;
MACDup= MACD()>Signal() ;
Hist= MACD()-Signal() ;
Histup= Hist>Ref(Hist,-1) ;
stochup= StochK()>StochD() ;
stoch80= StochK()<80 ;
MFIup= MFI()>EMA(MFI(),5) AND MFI()>20 ;
ma10up= MA(C,10)>=Ref(MA(C,10),-1) ;
ma20up= MA(C,20)>=Ref(MA(C,20),-1) ;
EMA50up= EMA(C,50)>=Ref(EMA(C,50),-1) ;
Cupma10= C>MA(C,10) ;
Cupma20= C>MA(C,20) ;
cupema50= C>EMA(C,50) ;
Vup50= V>50000 ;
CCIup0= CCI()>0 ;
Cupo= C>O ;
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
mybuy= TSIL > Ref( TSIL, -1 ) AND EMA(TSI,sig) > Ref( EMA(TSI,sig), -1 ) AND TSIL>EMA(TSI,sig) AND
macdup AND ema50up AND mfiup ;
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);
8 comments
Leave Comment
Please login here to leave a comment.
Dear Morgan
Buy & Sell arrow not appearing as shown in picture.
I verified, it works fine.
Dear morgen,
afl for eod /intraday ?
It is for EOD.
Dear morgen
can u modify afl for intraday ?
I don’t no how to modify this afl for intraday.
No need to modify intraday chart, just change your chart time frame i.e. 15 Min, 30 Min or One Hour.
Hi Morgan,
Excellent.
It would be great if you add the functionality of the scanner with option to choose volume and spread values.
Hence any stock just the breakout could be caught.
Regards
Anand