A1:=MA(C,5);
A2:=MA(C,10);
A3:=MA(C,20);
A4:=MA(C,60);
A5:=MA(C,30);
B1:=IF(A1=DRAWNULL,0,A1);
B2:=IF(A2=DRAWNULL,A1,A2);
B3:=IF(A3=DRAWNULL,A1,A3);
B4:=IF(A4=DRAWNULL,A1,A4);
B5:=IF(A5=DRAWNULL,A1,A5);
A:=MAX6(B1,B2,B3,B4,B5,0);
B:=MIN6(B1,B2,B3,B4,B5,1000);
T1:=(A/B-1)*100,NODRAW;
T:RANGE(T1,0,数)=1,COLORCYAN,NODRAW;
{区间}
A点:=CROSS(T,0.01);
区间:=BARSLAST(A点);
B点:=CROSS(0.01,T);
条件一:=B点 AND 区间
条件二:=LLV(L,区间+1);
C1:=BARSLAST(条件一);
C2:=CROSS(REF(条件二,C1),L);
新低:C2 AND COUNT(C2,C1)=1,NODRAW;
条件三:=HHV(H,区间+1);
C3:=CROSS(H,REF(条件三,C1));
新高:C3 AND COUNT(C3,C1)=1,NODRAW;
XXX:=T;
FT:=BARSNEXT(XXX);
{HH:=REF(条件三,C1);
LL:=REF(条件二,C1);}
HH:=条件三;
LL:=条件二;
TA:=MIN(BARSLAST(H HH AND FT 5),BARSLAST(L
FTT:=REFX(TA,FT);
STICKLINE(FT AND BARSLAST(T=1) =0,HH,LL,8,0),COLOR770022;
STICKLINE((FT=FTT OR XXX) AND BARSLAST(T=1) =0,HH,LL,8,0),COLOR770022;
STICKLINE(新低=1,LL,HH,0,-1),COLORGREEN;
DRAWICON(新低=1,L*0.99,37);
STICKLINE(新高=1,LL,HH,0,-1),COLORLIMAGENTA;
DRAWICON(新高=1,H*1.023,38);
所属:=STRCAT('所属:',STRCAT(STRCAT(STRCAT('
【行业】-',HYBLOCK),STRCAT(' 【地域】-',DYBLOCK)),STRCAT('
【概念】-',GNBLOCK))); DRAWTEXT_FIX(O 0,0.00,0.012,0,所属);
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
DD:=O C AND (C-REF(C,1))/REF(C,1) =-0.03;
DDC:=VALUEWHEN(DD,MAX(C,O));
DAYSDD:=BARSLAST(DD);
FB:=C =DDC AND REF(C,1)
DAYSFB:=BARSLAST(FB);
JGDAYS:=DAYSDD-DAYSFB;
反包:DAYSDD DAYSFB AND JGDAYS =9,NODRAW;
STICKLINE(CROSS(反包=1,0.01),C,O,2.5,0),COLOR0066FF;
STICKLINE(CROSS(反包=1,0.01),H,L,0,0),COLOR0066FF;
DDA0:=DOWNNDAY(C,2),NODRAW;
DDA1:=O C AND (C-REF(C,1))/REF(C,1) =-0.03 AND DOWNNDAY(C,2),NODRAW;
DDCA1:=VALUEWHEN(CROSS(DDA1=1,0.01),REF(HHV(H,1),1)),NODRAW;
DAA1:=BARSLAST(DDA1);
FBA1:=H =DDCA1 AND REF(C,1) DDCA1;
DAA2:=BARSLAST(FBA1);
JGA1:=DAA1-DAA2;
反包2:DAA1 DAA2 AND JGA1 =13,NODRAW;
STICKLINE(CROSS(反包2=1,0.01),C,O,2.5,0),COLORGRAY;
STICKLINE(CROSS(反包2=1,0.01),H,L,0,0),COLORGRAY;
DD0:=DOWNNDAY(C,2),NODRAW;
DD1:=O C AND (C-REF(C,1))/REF(C,1) =-0.03 AND DOWNNDAY(C,2),NODRAW;
DDC1:=VALUEWHEN(CROSS(DD1=1,0.01),REF(HHV(H,2),1)),NODRAW;
DA1:=BARSLAST(DD1);
FB1:=C =DDC1 AND REF(C,1) DDC1;
DA2:=BARSLAST(FB1);
JG1:=DA1-DA2;
反包1:DA1 DA2 AND JG1 =13,NODRAW;
STICKLINE(CROSS(反包1=1,0.01),C,O,2.5,0),COLORFF66FF;
STICKLINE(CROSS(反包1=1,0.01),H,L,0,0),COLORFF66FF;
DDB0:=HHV(C,5)/LLV(C,5) =1.08,NODRAW;
DDB1:=O C AND DDB0=1 AND DOWNNDAY(C,2),NODRAW;
DDBA1:=VALUEWHEN(CROSS(DDB1=1,0.01),REF(HHV(C,4),1)),NODRAW;
DAB1:=BARSLAST(DDB1);
FBB1:=H =DDBA1 AND REF(C,1) DDBA1;
DAB2:=BARSLAST(FBB1);
JGB1:=DAB1-DAB2;
反包3:DAB1 DAB2 AND JGB1 =17,NODRAW;
STICKLINE(CROSS(反包3=1,0.01),C,O,2.5,0),COLORLIRED;
STICKLINE(CROSS(反包3=1,0.01),H,L,0,0),COLORLIRED;
DDD0:=HHV(C,10)/LLV(C,10) =1.18,NODRAW;
DDD1:=O C AND DDD0=1 AND DOWNNDAY(C,2),NODRAW;
DDDA1:=VALUEWHEN(CROSS(DDD1=1,0.01),REF(HHV(C,9),1)),NODRAW;
DAD1:=BARSLAST(DDD1);
FBD1:=H =DDDA1 AND REF(C,1) DDDA1;
DAD2:=BARSLAST(FBD1);
JGD1:=DAD1-DAD2;
反包4:DAD1 DAD2 AND JGD1 =25,NODRAW;
STICKLINE(CROSS(反包4=1,0.01),C,O,2.5,0),COLORWHITE;
STICKLINE(CROSS(反包4=1,0.01),H,L,0,0),COLORWHITE;
中位线:EMA(C,34),COLORYELLOW,LINETHICK1;