DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
红面积:SUM(MACD,BARSLAST(MACD<0))*(MACD>0),COLOR0000FF,NODRAW;
绿面积:SUM(MACD,BARSLAST(MACD>0))*(MACD<0),COLORFFFF00,NODRAW;
KA:=IF(MACD>0,BARSLAST(MACD<0),BARSLAST(MACD>0)),NODRAW;
KB:=SUM(MACD,KA)*100,NODRAW;
当前面积:ROUND(ABS(KB)),NODRAW;
AA:=ROUND(REF(绿面积,1)*100);
BB:=ROUND(REF(红面积,1)*100);
DRAWNUMBER(CROSS(0,MACD),HHV(REF(MACD,1),5)+0.01,ABS(BB)),COLORMAGENTA;
DRAWNUMBER(CROSS(MACD,0),LLV(REF(MACD,1),5)-0.01,ABS(AA)),COLORGREEN;
DRAWNUMBER(ISLASTBAR AND KB>0 , HHV(REF(MACD,1),KA),当前面积),COLORWHITE;
DRAWNUMBER(ISLASTBAR AND KB<0 , LLV(REF(MACD,1),KA), 当前面积),COLORWHITE;
|