N:=6;
AA:=REF(H,N)=HHV(H,2*N+1);
AA1:=REF(L,N)=LLV(L,2*N+1);
QY:=BACKSET(AA,N+1);
QY1:=BACKSET(AA1,N+1);
CC:=FILTER(QY,N) AND H=HHV(H,N+1);
CC1:=FILTER(QY1,N) AND L=LLV(L,N+1);
DDD:=BARSLAST(CC);
DD1:=BARSLAST(CC1);
GDTS:=IF(CC,CURRBARSCOUNT,0);
DDTS:=IF(CC1,CURRBARSCOUNT,0);
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
GDCS1:=CONST(DINGBUTS);
DDCS1:=CONST(DDTS1);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
DDTS2:=REF(DDTS1,DD1+1);
GDCS2:=CONST(DINGBUTS1);
DDCS2:=CONST(DDTS2);
M:=INTPART(3*N/5);
AAA:=REF(H,M)=HHV(H,2*M+1);
QYY:=BACKSET(AAA,M+1);
CCC:=FILTER(QYY,M) AND H=HHV(H,M+1);
DDDD:=BARSLAST(CCC);
GDTSS:=IF(CCC,CURRBARSCOUNT,0);
DINGBUTSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS);
GDCS11:=CONST(DINGBUTSS);
DINGBUTS11:=REF(DINGBUTSS,DDDD+1);
GDCS22:=CONST(DINGBUTS11);
AA11:=REF(L,M)=LLV(L,2*M+1);
QY11:=BACKSET(AA11,M+1);
CC11:=FILTER(QY11,M) AND L=LLV(L,M+1);
DD11:=BARSLAST(CC11);
DDTSS:=IF(CC11,CURRBARSCOUNT,0);
DDTS11:=IF(DD11,REF(DDTSS,DD11),DDTSS);
DDCS11:=CONST(DDTS11);
DDTS22:=REF(DDTS11,DD11+1);
DDCS22:=CONST(DDTS22);
GHH1:=MAX(MAX(REF(H,GDCS1-1),REF(H,GDCS2-1)),MAX(REF(H,GDCS11-1),REF(H,GDCS22-1)));
DLL1:=MIN(MIN(REF(L,DDCS1-1),REF(L,DDCS2-1)),MIN(REF(L,DDCS11-1),REF(L,DDCS22-1)));
GHH:=MAX(GHH1,HHV(H,10));
DLL:=MIN(DLL1,LLV(L,10));
DX1:=(REF(H,GDCS1-1)-REF(H,GDCS2-1))/(GDCS2-GDCS1);
DX2:=(REF(H,GDCS11-1)-REF(H,GDCS22-1))/(GDCS22-GDCS11);
GGAA:=DX1>0 AND (REF(H,(GDCS1-1))+DX1*GDCS1)>GHH*1.05;
GGAB:=DX1<0 AND (REF(H,(GDCS1-1))+DX1*GDCS1)<DLL*0.95;
DDX1:=IF(GGAA OR GGAB,0,1);
GGBA:=DX2>0 AND (REF(H,(GDCS11-1))+DX2*GDCS11)>GHH*1.05;
GGBB:=DX2<0 AND (REF(H,(GDCS11-1))+DX2*GDCS11)<DLL*0.95;
DDDX1:=IF(GGBA OR GGBB,0,1);
强压:=DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,DDX1),COLORYELLOW,LINETHICK1;
红线:=DRAWLINE(CURRBARSCOUNT=GDCS22 ,H,CURRBARSCOUNT=GDCS11,H,DDDX1),COLORRED,LINETHICK1;
散户线:=100*(HHV(HIGH,30)-CLOSE)/(HHV(HIGH,30)-LLV(LOW,30)),COLORGREEN,LINETHICK2;
RSV:=(CLOSE-LLV(LOW,6))/(HHV(HIGH,6)-LLV(LOW,6))*100;
K:=SMA(RSV,5,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
主力线:=EMA(J,6),COLORRED,LINETHICK2;
(CROSS(C,红线) OR CROSS(C,强压)) AND 散户线<主力线;