MACD拐点和面积公式原码 czsc :MACD拐点和面积公式原码 说明:本公式不需要设置参数,按1分钟级别走势做T+0效果不错。公式原码如下: DIF:=EMA(CLOSE,24)-EMA(CLOSE,52); MACD:=EMA(DIF,18),COLOR33CCFF; DEF:2*(DIF-MACD),COLORFFFF00,LINETHICK0; STICKLINE(DEF>=0 AND DEF>=REF(DEF,1),0,DEF,0,0),COLORRED; STICKLINE(DEF>=0 AND DEF< REF(DEF,1),0,DEF,0.0,0),COLORRED; STICKLINE(DEF<0 AND DEF>=REF(DEF,1),0,DEF,0.0,0),COLORGREEN; STICKLINE(DEF<0 AND DEF< REF(DEF,1),0,DEF,0.0,0),COLORGREEN; IF(DIF<1000,0,DRAWNULL),COLORBROWN; K1:=BACKSET(DIF>REF(DIF,1),2); 强DIF:IF(K1,DIF,DRAWNULL),COLORRED,LINETHICK2; K2:=BACKSET(DIF<REF(DIF,1),2); 弱DIF:IF(K2,DIF,DRAWNULL),COLORFF8B80,LINETHICK2; K3:=BACKSET(MACD>REF(MACD,1),2); 强MACD:IF(K3,MACD,DRAWNULL),COLORLIRED,LINETHICK2; K4:=BACKSET(MACD<REF(MACD,1),2); 弱MACD:IF(K4,MACD,DRAWNULL),COLORFF8B80,LINETHICK2; 底拐:DRAWLINE(DIF>=HHV(DIF,21),DIF,DIF<=LLV(DIF,21),DIF,0),COLORGREEN,LINETHICK3; 顶拐:DRAWLINE(DIF<=LLV(DIF,21),DIF,DIF>=HHV(DIF,21),DIF,0),COLORYELLOW,LINETHICK3; DRAWICON(底拐=LLV(DIF,21),底拐*0.97,23); DRAWICON(顶拐=HHV(DIF,21),顶拐*1.03,14); AA1:=IF(DEF>0,1,-1); AA2:=REF(AA1,1); AA3:=AA1*AA2; AA4:=BARSLAST(AA3<0); AA5:=AA4+1; 面积:SUM(DEF,AA5)/10,COLORGREEN,LINETHICK2;