S:=CROSS(CLOSE,EMA2(HIGH,30));
X:=CROSS(EMA2(LOW,30),CLOSE);
WS:=BARSLAST(S)+1;
WX:=BARSLAST(X)+1;
SS:=CROSS(SUM(S,WX),0.5);
XX:=CROSS(SUM(X,WS),0.5);
STICKLINE(CLOSE>EMA2(HIGH,30),EMA2(HIGH,30),EMA2(LOW,30),COLORMAGENTA,1);
STICKLINE(CLOSE
STICKLINE(CLOSE
PARTLINE(CLOSE
PARTLINE(CLOSE
PARTLINE(CLOSE
PARTLINE(CLOSE
STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,COLORCYAN,0);
DRAWTEXT(SS,LOW,'买入');
DRAWTEXT(XX,HIGH,'卖出');