同花顺分时KDJ指标
源码
LOWV:=LLV(NEW,15);
HIGHV:=HHV(NEW,15);
RSV:=EMA((NEW-LOWV)/(HIGHV-LOWV)*100,3);
K:=EMA(rsv,3);
D:=MA(K,3);
zero1:20,POINTDOT,colorwhtite;
zero2:80,POINTDOT,colorwhite;
zero3:0;
zero4:100;
PARTLINE(d,d>=REF(d,1),RGB(255,0,0),d<=REF(d,1),RGB(0,255,0));
a1:=BARSLAST(REF(CROSS(k,d),1));
b1:=REF(NEW,a1+1)>NEW AND REF(K,a1+1)<K AND CROSS(k,d) AND k<30;
DRAWTEXT(IF(b1>0,1,0),d,'k底背'),colorgreen;
c1:=BARSLAST(REF(CROSS(d,k),1));
d1:=REF(NEW,c1+1)<NEW AND REF(K,c1+1)>K AND CROSS(d,k) AND k>70;
DRAWTEXT(IF(d1>0,1,0),d,'k顶背'),coloryellow;
中趋势线:=3*SMA((NEW-LLV(NEW,27))/(HHV(NEW,27)-LLV(NEW,27))*100,5,1)-2*SMA(SMA((NEW-LLV(NEW,27))/(HHV(NEW,27)-LLV(NEW,27))*100,5,1),3,1);
长趋势线:=3*SMA((NEW-LLV(NEW,55))/(HHV(NEW,55)-LLV(NEW,55))*100,5,1)-2*SMA(SMA((NEW-LLV(NEW,55))/(HHV(NEW,55)-LLV(NEW,55))*100,5,1),3,1);
DRAWGBK(中趋势线>=90,STRIP(RGB(100,0,100),RGB(100,0,100),2));
DRAWGBK(中趋势线<=10,STRIP(RGB(0,100,100),RGB(0,100,100),2));
DRAWGBK(长趋势线>=90,STRIP(RGB(150,0,150),RGB(150,0,150),2));
DRAWGBK(长趋势线<=10,STRIP(RGB(0,150,150),RGB(0,150,150),2));