RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
A1:=CROSS(J,D);
A2:=D<50;
A3:=J<20;
TH:=MAX(HIGH,REF(CLOSE,1));
TL:=MIN(LOW,REF(CLOSE,1));
ACC1:=SUM(CLOSE-TL,7)/SUM(TH-TL,7);
ACC2:=SUM(CLOSE-TL,14)/SUM(TH-TL,14);
ACC3:=SUM(CLOSE-TL,28)/SUM(TH-TL,28);
ACC4:=(ACC1*7*28+ACC2*14*28+ACC3*7*14)*100/(7*14+7*28+14*28);
ACC5:=EMA(ACC4,6);
A4:=CROSS(ACC4,ACC5);
A5:=ACC4>35;
XG:A1 AND A2 AND A3 AND A4 AND A5;