通信达公式导入 MACD+KDJ多重背离副图公式源码(2)
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
DRAWTEXT(底背离,DIF*0.5,'日底背'),COLORRED;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
DRAWTEXT(顶背离,DIF*1.12,'日顶背'),COLORGREEN;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9));
K:=SMA(RSV,9,3),NODRAW;
D:=SMA(K,9,3),NODRAW;
J:=3*K-2*D,NODRAW;
M&K金共:=CROSS(DIF,DEA) AND CROSS(K,D) AND CROSS(J,D);
DRAWTEXT(M&K金共,DEA*1.12,'金叉共振'),COLORYELLOW;
MACD高:=HHV(MACD,5);
C1:=BARSLAST(REF(CROSS(DEA,DIF),1));
E:=REF(C,C1+1)>C AND DEA>0 AND REF(MACD高,C1+1)<MACD高 AND CROSS(DEA,DIF) ;
DRAWTEXT(E>0,-0.5,'柱顶背'),COLORCYAN;
F:=REF(C,A1+1)>C AND DEA<0 AND REF(MACD高,A1+1)<MACD高 AND CROSS(DIF,DEA);
DRAWTEXT(F>0,0.5,'柱底背'),COLORLIRED;
JC:= DEA-DIF;
绿柱面积:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);
红柱面积:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);(股票知识网zhishi.southmoney.com)