ya..
check this .
this based on ema cross , when ema 5 is above ema 20 , candle is green ,
if ema 5 is below ema 20 candle will be red.
hope this helps
e1=EMA(C,5);
e2=EMA(C,20);
Plot(e1,"",6,1);
Plot(e2,"",4,1);
b1=Cross(e1,e2);
s1=Cross(e2,e1);
Buysetup=Flip(b1,s1);
Shortsetup=Flip(s1,b1);
trend=IIf(BarsSince(Buysetup)<BarsSince(Shortsetup ),1,0);
Col=IIf(trend==1,5,4);
SetBarFillColor(Col);
Plot(C,"Close",Col,64);