```
_SECTION_BEGIN("SINI");
r = Param( "SINI period 'R':", 12, 1, 100, 1 );
s = Param( "SINI period 'S':", 26, 1, 100, 1 );
u = Param( "SINI period 'U':", 10, 1, 100, 1 );
sig = Param( "Signal period:", 9, 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);
SINI = 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 ), colorLime, colorRed );
Plot( TSIL, "SINI("+r+","+s+","+u+")", col, styleLine | styleThick);
//Green EMA SINI,sig Line=Rising; Red EMA SINI,sig Line=Falling
col = IIf( EMA(SINI,sig) > Ref( EMA(SINI,sig), -1 ), colorBrightGreen,
colorRed );
Plot( EMA(SINI,sig), "", col, styleThick);
Histcol= IIf(SINI>0,colorIndigo,colorWhite) ;
//Plot( SINI, "", histcol, ParamStyle("Histogram style", styleThick |styleHistogram | styleNoLabel, maskHistogram ) );
Plot(0,"",ParamColor( "ColorZero", colorWhite ),styleLine);
//Title = "SINI";
_SECTION_END();
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//FORMULA
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 ;
ma21up= MA(C,21)>=Ref(MA(C,21),-1) ;
ma55up= MA(C,55)>=Ref(MA(C,55),-1) ;
EMA89up= EMA(C,89)>=Ref(EMA(C,89),-1) ;
Cupma21= C>MA(C,21) ;
Cupma55= C>MA(C,55) ;
cupema89= C>EMA(C,89) ;
Vup50= V>50000 ;
CCIup0= CCI()>0 ;
Cupo= C>O ;
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
mybuy= TSIL > Ref( TSIL, -1 ) AND EMA(SINI,sig) > Ref( EMA(SINI,sig), -1
) AND TSIL>EMA(SINI,sig) AND
macdup AND ema89up AND mfiup ;
mysell= TSIL < Ref( TSIL, -1 ) AND EMA(SINI,sig) < Ref( EMA(SINI,sig), -1
) AND TSIL<EMA(SINI,sig) ;
Buy = ExRem(myBuy, mysell);
Sell = ExRem(mysell, myBuy);
AlertIf( Buy, "", "BUY @ " + C, 1 );
AlertIf( Sell, "", "SELL @ " + C, 2 );
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorLime,0);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0);
```