N:=14;
M0:=9;
M1:=9;
M2:=9;
BCT:=3;
SCT:=2;
TYP := (IF(ISNULL(HIGH),CLOSE,HIGH) + IF(ISNULL(LOW),CLOSE,LOW) + CLOSE)/3;
cci:(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N));
CCI1:=REF(CCI,1);
Cdif:=CCI-CCI1;
a:0;
RSV=(CLOSE-LLV(LOW,M0))/(HHV(HIGH,M0)-LLV(LOW,M0))*100;
a=SMA(RSV,M1,1);
b=SMA(a,M2,1);
J:3*a-2*b;
J1=REF(J,1);
Jdif:=J-J1;
Jind:10*IF((Cdif>0)OR(Jdif>0),1,-1);
Jud2:=IF((Jind=REF(Jind,1)),Jind,REF(Jind,2));
Jud3:=IF(((Jind=REF(Jind,1))AND(REF(Jind,1)=REF(Jind,2))),Jind,0);
Jud4:=IF((Jud3=0),REF(Jud3,BARSLAST(Jud3)),Jud3);
b1=BARSLAST(Jind<0);
s1=BARSLAST(Jind>0);
Jud5org:=IF((b1>=BCT)OR(s1>=SCT),Jind,0);
Jud5:IF((Jud5org=0),REF(Jud5org,BARSLAST(Jud5org)),Jud5org);
DRAWGBK(Jud5>0),RGB(50,10,10);