通達信KDJ背離畫線指標公式N:=5;M1:=3;M2:=3; RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K:SMA(RSV,M1,1),COLORYELLOW,LINETHICK1; D:SMA(K,M2,1),COLORCYAN,LINETHICK1; J:3*K-2*D,COLORMAGENTA,LINETHICK1; 高安全區(qū):0,COLORRED; 安全區(qū):20,COLORCYAN; 風險區(qū):100,COLORGREEN; U1:=BARSLAST(REF(CROSS(K,D),1)); U2:=REF(C,U1+1)>C AND REF(K,U1+1)<K AND CROSS(K,D)AND D<50; 底背離:=IF(U2>0,1,0); DRAWLINE(U1=0,D,底背離,REF(D,U1),0),COLORRED,LINETHICK2; DRAWLINE(底背離,D,底背離,REF(D,U1),0),COLORRED,LINETHICK2; DRAWTEXT(底背離,REF(D,U1)*1.00,' 底背離'),COLORYELLOW; RR:=MAX(C,O); Q1:=HHV(RR,5); Q2:=D<REF(D,1) AND REF(D,1)>REF(D,2); A2:=BARSLAST(REF(Q2,1)); 頂背離:= REF(Q1,A2+1)<Q1 AND K<REF(K,A2+1) AND Q2; DRAWLINE(A2=0 ,D,頂背離,REF(D,A2),0),COLORWHITE,LINETHICK2; DRAWLINE(頂背離,D,頂背離,REF(D,A2),0),COLORWHITE,LINETHICK2; DRAWTEXT(頂背離,REF(D,A2)*1.02,' 頂背離'),COLORGREEN;
|