macd面積公式指標(biāo):
P:=26;S:=12;M:=9; DIFF1:=(EMA(CLOSE,s) - EMA(CLOSE,p)){/EMA(CLOSE,s)}; DEA1:=EMA(DIFF1,m); MACD:2*(DIFF1-DEA1){,COLORSTICK},LINETHICK0; 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 MACDls:=IF(MACD<0 AND MACD>REF(MACD,1),MACD,0); STICKLINE(MACDhs>0,0,MACD,1,0), COLORRED; STICKLINE(MACDhx>0,0,MACD,1,0), COLORRED; STICKLINE(MACDlx<0,MACD,0,1,0), COLORGREEN; STICKLINE(MACDls<0,MACD,0,1,0), COLORGREEN; DIFF:DIFF1,Colorwhite; DEA:DEA1,Coloryellow; 紅柱面積:IF(MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),LINETHICK0,Color0000FF; 綠柱面積:IF(MACD<0,SUM(MACD,BARSLAST(MACD>0)),0),LINETHICK0,Color006000; DRAWNUMBER(ref(MACD,1)>0 and MACD<=0 ,HHV(MACD,4),ref(紅柱面積,1),2),ALIGN1,pxup10,colorgreen; DRAWNUMBER(ref(MACD,1)<0 and MACD>=0 ,LLV(MACD,4),ref(abs(綠柱面積),1),2),ALIGN1,pxdn5,Colorred; DRAWNUMBER(BARSTATUS=2 AND MACD<0,LLV(MACD,4),abs(綠柱面積),2),align2,pxdn5,Colorred; DRAWNUMBER(BARSTATUS=2 AND MACD>0,HHV(MACD,4),abs(紅柱面積),2),align2,pxup10, colorgreen; DRAWNUMBER(MACD>0 AND MACD=HHV(MACD,BARSLAST(MACD<0)) AND MACD>=REFX(MACD,1) AND MACD>=REFX(MACD,2),MACD,MACD,2),align0,pxup20,ColorFF0000; DRAWNUMBER(MACD<0 AND MACD=LLV(MACD,BARSLAST(MACD>0)) AND MACD<=REFX(MACD,1) AND MACD<=REFX(MACD,2),MACD,MACD,2),align5,pxup10,ColorFF0000; |
|