文化财经 macd 面积显示+macd背离指标
macd面积显示:
DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,NODRAW;
MACDHS:=IF(MACD>0 AND MACD>REF(MACD,1),MACD,0);
MACDHX:=IF(MACD>0 AND MACD<REF(MACD,1),MACD,0);
MACDLX:=IF(MACD<0 AND MACD<REF(MACD,1),MACD,0);
MACDLS:=IF(MACD<0 AND MACD>REF(MACD,1),MACD,0);
STICKLINE1(MACDHS>0,0,MACD,0,0),COLORLIGHTRED;
STICKLINE1(MACDHX>0,0,MACD,0,0),COLORYELLOW;
STICKLINE1(MACDLX<0,MACD,0,0,0),COLORCYAN;
STICKLINE1(MACDLS<0,MACD,0,0,0), COLORLIGHTGREEN;
绿柱面积:10*IF (MACD<0,SUM(MACD,BARSLAST(MACD>0)),0),NODRAW,COLORCYAN;
红柱面积:10*IF (MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),NODRAW,COLORRED;
DRAWNUMBER(REF(MACD,1)>0 AND MACD<=0 ,HHV(MACD,8), REF(ABS(红柱面积),1),2,COLORRED);
DRAWNUMBER(REF(MACD,1)<0 AND MACD>=0 ,LLV(MACD,13),REF(ABS(绿柱面积),1),2,COLORGREEN);
DRAWNUMBER(ISLASTBAR AND MACD<0,LLV(MACD,8), ABS(绿柱面积),2,COLORGREEN);
DRAWNUMBER(ISLASTBAR AND MACD>0,HHV(MACD,13),ABS(红柱面积),2,COLORRED);
macd背离指标
DIFF :EMA(CLOSE,12) - EMA(CLOSE,26);