Found and modified this one,try this now.
Code:
SetChartOptions(0,chartShowDates|chartShowArrows|chartLogarithmic|chartWrapTitle);
GraphXSpace = 5;
Plot(C,"",colorBlack,styleCandle);
x = Ref(H,-1);
Y = Ref(L,-1);
a=x+1;
b=y-1;
aa=EMA(C,20);
bb=EMA(C,50);
Buy = Cover = C>a AND aa>bb;
Sell = Short = C<b AND aa<bb;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorBlue,0,L,-15);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,H,-15);
Buy1 = Cross(EMA1,EMA2);
Sell1 = Cross(EMA2,EMA1);
Buy2=ValueWhen(Buy1,H);
sell2=ValueWhen(Sell1,L);
Buy=Cross(C,Buy2);
Sell=Cross(Sell2,C);