{改编KDJ副图}
STICKLINE(C>0,120,110,4,0),COLORBLACK;
STICKLINE(C>0,-20,-10,4,0),COLORBLACK;
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
A:=SMA(RSV,3,1);
B:=SMA(A,3,1);
TA:=A>B;
STICKLINE(A-B>0,0,A-B,7,0),COLORRED;
STICKLINE(A-B<0,0,A-B,7,0),COLORBLUE;
STICKLINE(A-B>0,0,A-B,1,0),COLORWHITE;
STICKLINE(A-B<0,0,A-B,1,0),COLORWHITE;
DRAWBAND(IF(TA,A,DRAWNULL),RGB(100,0,0),IF(TA,B,DRAWNULL),RGB(0,0,0));
K:A,COLORWHITE;
D:B,COLORYELLOW;
J:A*3-B*2,COLORMAGENTA,DOTLINE;
KD乖离:(K-D),COLORCYAN,NODRAW;
STICKLINE(K>80 AND REF(K,1)>80 AND REF(K,2)>80,120,110,2,0),COLORGREEN;
STICKLINE(K<80 AND REF(K,1)>80,120,110,2,0),COLORBLUE;
STICKLINE(K<20 AND REF(K,1)<20 AND REF(K,2)<20,-10,-20,2,0),COLORYELLOW;
STICKLINE(K>20 AND REF(K,1)<20,-10,-20,2,0),COLORRED;
===================================
{改编KDJ选股}
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
k:=SMA(RSV,3,1);
XG:K>20 AND REF(K,1)<20;