DRAWGBK(CLOSE>0, COLORRGB(1,0,0), COLORRGB(1,0,0),2);
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;
LC:=REF(CLOSE,1);
RSI1:=(SMA(MAX(CLOSE-LC,0),6,1))/(SMA(ABS(CLOSE-LC),6,1))*100;
RSI3:=(SMA(MAX(CLOSE-LC,0),24,1))/(SMA(ABS(CLOSE-LC),24,1))*100;
VAR1:=REF(LLV(LOW,BARSLAST(CROSS(d,k))+1),BARSLAST(CROSS(k,d)));
VAR2:=REF(LLV(LOW,BARSLAST(CROSS(RSI3,RSI1))+1),BARSLAST(CROSS(RSI1,RSI3)));
VAR3:=REF(MAX(VAR1,VAR2),1);
VAR4:=REF(HHV(HIGH,BARSLAST(CROSS(REF(j,1),j))+2),BARSLAST(CROSS(d,k)));
VAR5:=REF(HHV(HIGH,BARSLAST(CROSS(REF(j,1),j))+2),BARSLAST(CROSS(k,d)));
VAR6:=IF(CLOSE<MIN(VAR4,VAR5),MIN(VAR4,VAR5),MAX(VAR4,VAR5));
LC:=REF(CLOSE,1);
R1:=(SMA(MAX(CLOSE-LC,0),2,1))/(SMA(ABS(CLOSE-LC),2,1))*100;
R3:=(SMA(MAX(CLOSE-LC,0),34,1))/(SMA(ABS(CLOSE-LC),34,1))*100;
R2:=2;
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;
A:=((100-2*REF(K,1)+2*K+4*REF(D,1)/3)/3*(HHV(HIGH,9)-LLV(LOW,9))+100*LLV(LOW,9))/100;
B:=((-2*REF(K,1)+2*K+4*REF(D,1)/3)/3*(HHV(HIGH,9)-LLV(LOW,9))+100*LLV(LOW,9))/100;
A1:=IF(CROSS(D,K),LOW,0);
A2:=IF(CROSS(R1,R3) AND COUNT(CROSS(50,D),BARSLAST(CROSS(D,K)))=1 AND CLOSE<HHV(CLOSE,11) AND COUNT(CROSS(R1,R3),BARSLAST(CROSS(55,D)))=1 OR CROSS(R2,R1) AND COUNT(CROSS(55,D),BARSLAST(CROSS(D,K)))=1 AND CLOSE<HHV(CLOSE,10) AND COUNT(CROSS(R2,R1),BARSLAST(CROSS(55,D)))=1 OR CROSS(50,D) AND REF(CLOSE,1)>A AND REF(CLOSE,1)>REF(OPEN,1),1,0);
B1:REF(A,BARSLAST(A2)),LINETHICK5,colorFF;
B4:MA(B,21),LINETHICK0;
B5:MA(B,34),LINETHICK0;
B2:=IF(b4<b5 ,REF(B,BARSLAST(A1)),REF(A,BARSLAST(A1)));
B3:=IF(B1<B2 AND CLOSE>B1 AND B1<B2*0.9618 ,B2*0.9618,REF(A,BARSLAST(A2)));
M1:IF(VAR3>MAX(B2,B3) ,VAR3,B2),LINETHICK2,colorFFFF;
M2:IF(VAR3>MAX(B2,B3) ,VAR3,B3),LINETHICK2,colorFF00FF;
PARTLINE(B2<=B1,B2),LINETHICK2,colorFF00;
PARTLINE(B2<=B1,B3),LINETHICK5,colorFFFFFF;
STICKLINE(M1>M2 AND CLOSE>B1 AND B1<B2*0.9618,M1,M2,0,0),colorFF00;
FILLRGN(B1>=B2 AND (B1-B2)/B2*100<3,B1,B2),colorFFFFFF;
FILLRGN(B1<B2 AND (ABS(B1-B2))/B2*100<3,B1,B2),colorFFFFFF;
STICKLINE(B2<B1,VAR6,VAR6*1.0015,12,0),colorFFffff;
{阳线}
tj:=c>o or c=o and c>ref(c,1);
STICKLINE(tj,HIGH,LOW,1.5,0) ,COLOR0055ff;
STICKLINE(tj,CLOSE,OPEN,8,0) ,COLOR000055;
STICKLINE(tj,CLOSE,OPEN,7,0) ,COLOR000066;
STICKLINE(tj,CLOSE,OPEN,6,0) ,COLOR000077;
STICKLINE(tj,CLOSE,OPEN,5,0) ,COLOR000099;
STICKLINE(tj,CLOSE,OPEN,3,0) ,COLOR0000bb;
STICKLINE(tj,CLOSE,OPEN,2,0) ,COLOR0000dd;
STICKLINE(tj,CLOSE,OPEN,1,0) ,COLOR0000ff;
{阴线}
STICKLINE(not(tj) ,HIGH ,LOW,1.5,0 ),COLORffee44;
STICKLINE(not(tj) ,CLOSE ,OPEN,1,0 ),COLOrffaa00;
STICKLINE(not(tj) ,CLOSE ,OPEN,8,0 ),COLOrffaa00;
STICKLINE(not(tj) ,CLOSE ,OPEN,7,0 ),COLORffbb11;
STICKLINE(not(tj) ,CLOSE ,OPEN,6,0 ),COLOrffcc22;
STICKLINE(not(tj) ,CLOSE ,OPEN,5,0 ),COLORffdd33;
STICKLINE(not(tj) ,CLOSE ,OPEN,4,0 ),COLORffdd33;
STICKLINE(not(tj) ,CLOSE ,OPEN,3,0 ),COLORffee44;
STICKLINE(not(tj) ,CLOSE ,OPEN,2,0 ) ,COLORffff55;
MTM:=C-REF(C,1);
DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
买:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2)),1,0);
DRAWICON(filter(买=1,5),LOW-0.01,1);
DRAWTEXT(filter(买=1,5),LOW-0.01,'↑试买'),ColorFFFFFF;