K1:=kdj.K#DAY;
D1:=kdJ.D#DAY;
J1:=KDJ.J#DAY;
K:IF(CURRBARSCOUNT>1,REFX(K1,1),DRAWNULL);
D:IF(CURRBARSCOUNT>1,REFX(D1,1),DRAWNULL);
J:IF(CURRBARSCOUNT>1,REFX(J1,1),DRAWNULL);
K2:=CONST(IF(K1-REF(K1,1)>0,Abs(K1-REF(K1,1)),0-ABS(K1-REF(K1,1))));
K3:=IF(ISLASTBAR,CONST(K1)+K2,DRAWNULL);
D2:=CONST(IF(D1-REF(D1,1)>0,ABS(D1-REF(D1,1)),0-ABS(D1-REF(D1,1))));
D3:=IF(ISLASTBAR,CONST(D1)+D2,DRAWNULL);
J2:=CONST(IF(J1-REF(J1,1)>0,ABS(J1-REF(J1,1)),0-ABS(J1-REF(J1,1))));
J3:=IF(ISLASTBAR,CONST(J1)+J2,DRAWNULL);
DRAWLINE(CURRBARSCOUNT=2,K,ISLASTBAR,K3,0),COLORWHITE,DOTLINE;
DRAWLINE(CURRBARSCOUNT=2,D,ISLASTBAR,D3,0),COLORYELLOW,DOTLINE;
DRAWLINE(CURRBARSCOUNT=2,J,ISLASTBAR,J3,0),COLORMAGENTA,DOTLINE;