difM:=(Ema(C,240)-ema(C,520));
DEAM:=EMA(DIFM,180);
MacD(月):(DIFM-DEAM)/2,NODRAW,COLORFFFF00;
DIFW:=(EMA(CLOSE,60)-EMA(CLOSE,130));
DEAW:=EMA(DIFW,45);
macd(周):(DIFW-DEAW)*2,NODRAW,COLORBLUE;
DIFD:=(EMA(C,12)-EMA(C,26)),LINETHICK3,COLORLIMAGENTA;
DEAD:=EMA(DIFD,9),LINETHICK3,COLORYELLOW;
MACD(日):(DIFD-DEAD)*2,NODRAW,COLORWHITE;
STICKLINE(1,0,MACD(月),5.50,0),COLORFFFF00;
STICKLINE(1,0,MACD(周),3.50,0),COLORBLUE;
STICKLINE(1,0,MACD(日),2.25,0),COLORWHITE;
短期安全:MACD(日)>REF(MACD(日),1) AND MACD(周)>REF(MACD(周),1),NODRAW,COLORFF0000;
短期风险:(短期安全!=1),NODRAW,COLORFFFFFF;
中期安全:MACD(周)>REF(MACD(周),1) AND MACD(月)>REF(MACD(月),1),NODRAW,COLOR9900FF;
中期风险:(中期安全!=1),NODRAW,COLORCYAN;
DIF2:DIFD,LINETHICK2,COLORFFFFFF;
DIF1:IFF(短期安全,DIFD,DRAWNULL),LINETHICK2,COLORFF0000;
DEA1:DEAD,LINETHICK3,COLORCYAN;
DEA2:IFF(中期安全,DEAD,DRAWNULL),LINETHICK3,COLOR9900FF;