A1:=EMA(CLOSE,7)-EMA(CLOSE,21);
CD:EMA(A1,2),COLORSTICK;
STICKLINE(CD>REF(CD,1),0,CD,1,-1),COLOR00003C;
STICKLINE(CD<REF(CD,1),0,CD,1,-1),COLOR003F00;
B1:=EMA((0.668*REF(A1,1)+0.333*A1),1);
DRAWBAND(0,RGB(0,0,0),0,RGB(0,0,0)),COLORGRAY,DOTLINE;
做多:IF(A1>=B1,A1,B1),COLORRED;
做空:IF(B1-A1,B1,A1),COLORGREEN;
持股:IF(BARSLAST(做多=做空),BARSLAST(做多=做空),0),NODRAW,COLORRED;
持币:IF(BARSLAST(做多>做空),BARSLAST(做多>做空),0),NODRAW,COLORGREEN;