EMA10:EMA(C,10),COLOR0000FF;
A1:=REF(HIGH,3)=HHV(HIGH,2*6+1);
B1:=FILTER(A1,3);
C1:=BACKSET(B1,3+1);
D1:=FILTER(C1,3+1);{高点}
A2:=REF(LOW,3)=LLV(LOW,2*6+1);
B2:=FILTER(A2,3+1);
C2:=BACKSET(B2,3+1);
D2:=FILTER(C2,3);{低点}
E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2;
E2:=(HIGH+LOW)/2;{高低点出现在同一K线上时可作取舍}
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
L1:=(D2 AND NOT(D1 AND E1 H2:=D1 AND NOT(D2 AND E1>=E2); X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1)); G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);{过滤后低点} L2:=LD OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1; X2:=REF(BARSLAST(L2),1)+1; F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2)); G2:=F2>REF(F2,1); I2:=BACKSET(G2,2); HD:=I2>REF(I2,1);{过滤后高点} DRAWLINE(LD,L,HD,H,0),COLORWHITE; DRAWLINE(HD,H,LD,L,0),COLORWHITE; J1:=BACKSET(BARSTATUS=2 ,MIN(BARSLAST(HD),BARSLAST(LD))+1); J2:=J1>REF(J1,1); DRAWLINE(J2,IF(HD,H,L),BARSTATUS=2 ,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),COLORWHITE; C点:=BARSLAST(LD); DRAWTEXT(LD AND BARSLAST(HD) DRAWTEXT(HD,H*1.005,'卖点'),COLORYELLOW; A11:=REF(L,BARSLAST(LD)); B11:=REF(H,BARSLAST(HD)); TA11:=BARSLAST(LD); TB11:=BARSLAST(HD); KF:=SQRT(B11/A11); ZKF:=SQRT(SQRT(B11/A11)); C测低1:=B11/(KF+ZKF-1); C测高1:=B11/ZKF; C测中1:=B11/KF; 选C31:=L>0.93*C测低1 AND L<1.03*C测低1 AND LLV(L,3)=LLV(L,10) AND B1>1.1*C AND B1>1.1*A1 AND L>1.1*A1 ; 选C21:=L>0.93*C测中1 AND L<1.03*C测中1 AND LLV(L,3)=LLV(L,10) AND B1>1.1*C AND B1>1.1*A1 AND L>1.1*A1 ; 选C11:=L>0.9*C测高1 AND L<1.05*C测高1 AND LLV(L,5)=LLV(L,10) AND B1>1.1*C AND B1>1.1*A1 AND L>A1 AND COUNT(选C21,30)>=1; 选C2:=COUNT(选C21,3)>=1 AND C>1.02*C测中1 AND C>1.02*REF(C,1) AND LLV(L,3)>=0.93*C测中1; C1预选:=L>0.96*C测高1 AND L<1.04*C测高1; C2预选:=L>0.96*C测中1 AND L<1.04*C测中1; C3预选:=L>0.96*C测低1 AND L<1.04*C测低1; N:=8; HHD:=FILTER(BACKSET(FILTER(REF(H,N)=HHV(H,2*N+1),N),N+1),N); LLD:=FILTER(BACKSET(FILTER(REF(L,N)=LLV(L,2*N+1),N),N+1),N); DRAWNUMBER(HHD,1.025*HIGH,HIGH),COLORFF00FF,LINETHICK6; DRAWNUMBER(LLD,0.98*LOW,LOW),COLORGREEN,LINETHICK6; DRAWNUMBER(ISLASTBAR,C测高1,C测高1),COLOR0000FF,LINETHICK7; DRAWNUMBER(ISLASTBAR,C测中1,C测中1),COLOR0000FF,LINETHICK7; DRAWNUMBER(ISLASTBAR,C测低1,C测低1),COLOR0000FF,LINETHICK7; STICKLINE(C/REF(C,1)>=1.096 AND H=C,O,C,1,0),COLORYELLOW; 上趋势线:"CYX.NOTEXT1"DOTLINE,COLOR0000FF;下趋势线:"CYX.NOTEXT2"DOTLINE,COLOR00FFFF;