SW1:= (EMA(CLOSE,5)*7+EMA(CLOSE,10)*3)/10;
tt:(c-SW1)/SW1*100;
pt:ma(tt,6);
买入:=IF((tt<-5),-10,-20);
卖出:=IF((tt>5 ),10,20);
买入1:=ref(买入,1);
买入2:=ref(买入,2);
卖出1:=ref(卖出,1);
卖出2:=ref(卖出,2);
反弹1:IF(crOSS(tt,pt) AND 买入1=-10 ,-10,-20);
反弹2:IF(CROSS(tt,pt) AND 买入2=-10 ,-10,-20);
回落:IF(CROSS(pt,tt) AND 卖出1=10 ,10,20);
回落1:IF(CROSS(pt,tt) AND 卖出2=10 ,10,20);