YS1:=(HIGH+CLOSE)/2;

YS2:=( LOW+CLOSE)/2;

HD :=YS1-REF(YS1,1);

LD :=REF(YS2,1)-YS2;

DMP:=EMA(IF(HD>0 AND HD>LD,HD,0),11);

DMM:=EMA(IF(LD>0 AND LD>HD,LD,0),11);

AD:= EMA((DMP-DMM)/(DMP+DMM)*82,11);

ADV:=EMA(AD,3);

RSV:=(CLOSE-LLV(LOW,11))/(HHV(HIGH,11)-LLV(LOW,11))*100;

X:=EMA((ADV*0.667+RSV*0.333),2);

K:=EMA(X,3);

D:=EMA(K,3);

J:=EMA(3*K-2*D*0.999,4);

JJ:EMA(J,3),LINETHICK2,COLOR000080;

DY:EMA(D,3),LINETHICK2,COLOR808080;

STICKLINE((JJ>DY), 10,0,2,0),COLORYELLOW;

STICKLINE((JJ<DY),-10,0,2,0),COLORGREEN;