{集合竞价选股 N=1 100 6}
N:=6;
下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100);
RRRSV:=SMA(下档线,3,1);
KKK:=SMA(RRRSV,3,1);
DDDDD:=((3 * RRRSV) - (2 * KKK));
JJ12:=(((CLOSE - LLV(LOW,55)) / (HHV(HIGH,55) - LLV(LOW,55))) * 100);
RSV24:=SMA(JJ12,3,1);
K24:=SMA(RSV24,3,1);
D24:=((3 * RSV24) - (2 * K24));
压力:=IF(CROSS(D24,DDDDD),HIGH,REF(HIGH,BARSLAST(CROSS(D24,DDDDD)))),COLORFFFFFF;
底部:=LLV(HIGH,30),COLOR00FF00;
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);
GDCS13:=CONST(REF(HIGH,GDCS1-1)); DDCS13:=CONST(REF(L,DDCS1-1));
DINGBUTS1:=REF(DINGBUTS,DDD+1); DDTS2:=REF(DDTS1,DD1+1);
GDCS2:=CONST(DINGBUTS1); DDCS2:=CONST(DDTS2);
GDCS23:=CONST(REF(HIGH,DINGBUTS1-1)); DDCS23:=CONST(REF(L,DDTS2-1));
XG1:=BACKSET(ISLASTBAR,GDCS1); XD1:=BACKSET(ISLASTBAR,DDCS1);
XG2:=BACKSET(ISLASTBAR,DINGBUTS1); XD2:=BACKSET(ISLASTBAR,DDTS2);
XDD:=IF(DDCS13<=DDCS23,XD1,XD2);
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);
HH1:= REF(H,GDCS1-1);
HH2:= REF(H,GDCS2-1);
HH11:= REF(H,GDCS11-1);
HH22:= REF(H,GDCS22-1);
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);
LX1:=(REF(L,DDCS1-1)-REF(L,DDCS2-1))/(DDCS2-DDCS1);
LX2:=(REF(L,DDCS11-1)-REF(L,DDCS22-1))/(DDCS22-DDCS11);
DDAA:=LX1<0 AND (REF(L,(DDCS1-1))+LX1*DDCS1)<DLL*0.95;
DDAB:=LX1>0 AND (REF(L,(DDCS1-1))+LX1*DDCS1)>GHH*1.05;
LLX1:=IF(DDAA OR DDAB,0,1);
DDBA:=LX2<0 AND (REF(L,(DDCS11-1))+LX2*DDCS11)<DLL*0.95;
DDBB:=LX2>0 AND (REF(L,(DDCS11-1))+LX2*DDCS11)>GHH*1.05;
LLLX1:=IF(DDBA OR DDBB,0,1);
强压:=DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,DDX1),COLORYELLOW,LINETHICK1;
支撑:=DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,LLX1),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 散户线<主力线;