dif:ema(CLOSE,12)-EMA(CLOSE,26),COLORWHITE,LINETHICK1;
DIF1:EMA(CLOSE,4)-EMA(CLOSE,7);
DIF2:EMA(CLOSE,6)-EMA(CLOSE,13);
DIF3:EMA(CLOSE,8)-EMA(CLOSE,17);
DIF4:EMA(CLOSE,10)-EMA(CLOSE,22);
DEA:EMA(DIF,9),COLORBLUE,LINETHICK3;
持仓段:=0,COLOR00CFFF;
空仓段:=0,COLORFFCCFF;
STICKLINE(DIF>DEA,-0.5,-0.6,10,1),COLOR00CFFF;
STICKLINE(DIF<DEA,-0.5,-0.6,10,1),COLORBLACK;
MacD:(DIF-DEA)*2,COLORSTICK;
STICKLINE(((macd<REF(MACD,1)) AND (MACD>0)),0,MACD,1,-1),COLORWHITE,LINETHICK1;
STICKLINE(((MACD<REF(MACD,1)) AND (MACD<0)),0,MACD,1,1),COLORBROWN,LINETHICK1;
STICKLINE(((MACD>REF(MACD,1))),0,MACD,1,0),COLORWHITE,LINETHICK1;
IF(DIF1<DIF2,DIF1,DRAWNULL),COLORRED;
IF(DIF2<DIF3,DIF2,DRAWNULL),COLORRED;
IF(DIF3<DIF4,DIF3,DRAWNULL),COLORRED;
IF(DIF4<DIF,DIF4,DRAWNULL),COLORRED;
IF(DIF<DEA,DIF,DRAWNULL),COLORRED;
IF(DIF1>DIF2,DIF1,DRAWNULL),COLORLIMAGENTA;
IF(DIF2>DIF3,DIF2,DRAWNULL),COLORLIMAGENTA;
IF(DIF3>DIF4,DIF3,DRAWNULL),COLORLIMAGENTA;
IF(DIF4>DIF,DIF4,DRAWNULL),COLORLIMAGENTA;
IF(DIF>DEA,DIF,DRAWNULL),COLORLIMAGENTA;