_SECTION_BEGIN("Stochastic Momentum");
LookBack = Param("Lookback", 13, 2, 100 );
Smooth1 = Param("Smooth 1", 25, 1, 100 );
Smooth2 = Param("Smooth 2", 2, 1, 100 );
HH = HHV( H, LookBack );
LL = LLV( L, LookBack );
StoMom = 100 * EMA( EMA( C - 0.5 * ( HH + LL ), Smooth1 ), Smooth2 ) /
( 0.5 * EMA( EMA( HH - LL, Smooth1 ), Smooth2 ) );
Plot(StoMom, _DEFAULT_NAME(), ParamColor("Color", ColorCycle ) );
_SECTION_END();
Graph2=-50;
Graph3=50;
Graph4=-48;
Graph6=48;
Graph5=0;
Plot(Graph5,"",2,1);
Plot(Graph2,"",8,1);
Plot(Graph3,"",4,1);
Buy = Cross(Graph2,StoMom); buy1= StoMom > Graph4;
Sell= Cross( StoMom,Graph3 ); sell1= StoMom <Graph6;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Buy1 = ExRem(Buy1,Sell1);
Sell1 = ExRem(Sell1,Buy1);
PlotShapes( shapeUpArrow* Buy , colorBlue);
PlotShapes( shapeDownArrow* Sell ,colorRed);
Filter=1;
AddColumn(IIf(Buy ,Ref(c,0) ,Null),"Buy ",6.2,2,29);
AddColumn(IIf(Sell ,-Ref(c,0),Null),"Sell ",6.2,2,4);