N:=8;
TR:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
ATR:=MA(TR,N);
RWH:=(C-REF(L,N))/(ATR);
RWL:=(REF(H,N)-C)/(ATR);
PK:=MA((3*(RWH-C)+2*REF((RWH),1)+1*REF((RWH-3),2))/(3+2),3);
KCD:=PK-MA(PK,N);
SD:=SQRT(VAR(KCD,N));
{MADE BY 风尘秀吉}
VAL2:=1;VAL1:=1;
LN1:IF(REF(KCD,1)>=0 AND KCD>0,VAL1,IF(REF(KCD,1)<=0 AND
KCD<0,VAL2,0));
STICKLINE(1,IF(REF(KCD,1)>KCD,KCD,0),0,0.5,1),COLORGREEN;
STICKLINE(1,IF(KCD>REF(KCD,1),KCD,0),0,0.5,1),COLORRED;