N250:=250;
PT250:=CONST(HHVBARS(V,N250));
T250:IF(CURRBARSCOUNT<=N250,CONST(IF(PT250=0,C,REF(C,PT250))),DRAWNULL),COLOR990000,LINETHICK2;
IF(CURRBARSCOUNT=PT250+1,T250*1.01,DRAWNULL),CIRCLEDOT,COLORYELLOW,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=N250,T250,'250'),COLOR990000;
N120:=120;
PT120:=CONST(HHVBARS(V,N120));
T120:IF(CURRBARSCOUNT<=N120,CONST(IF(PT120=0,C,REF(C,PT120))),DRAWNULL),COLORAAAA00,LINETHICK2;
IF(CURRBARSCOUNT=PT120+1,T120,DRAWNULL),CIRCLEDOT,COLORYELLOW,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=N120,T120,'120'),COLORAAAA00;
N60:=60;
PT60:=CONST(HHVBARS(V,N60));
T60:IF(CURRBARSCOUNT<=N60,CONST(IF(PT60=0,C,REF(C,PT60))),DRAWNULL),COLOR00BB00,LINETHICK2;
IF(CURRBARSCOUNT=PT60+1,T60,DRAWNULL),CIRCLEDOT,COLORYELLOW,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=N60,T60,'60'),COLOR00BB00;
N30:=30;
PT30:=CONST(HHVBARS(V,N30));
T30:IF(CURRBARSCOUNT<=N30,CONST(IF(PT30=0,C,REF(C,PT30))),DRAWNULL),COLOR0000CC,LINETHICK2;
IF(CURRBARSCOUNT=PT30+1,T30,DRAWNULL)CIRCLEDOT,COLORYELLOW,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=N30,T30,'30'),COLOR0000CC;
N20:=20;
PT20:=CONST(HHVBARS(V,N20));
T20:IF(CURRBARSCOUNT<=N20,CONST(IF(PT20=0,C,REF(C,PT20))),DRAWNULL),COLORDD00DD,LINETHICK2;
IF(CURRBARSCOUNT=PT20+1,T20,DRAWNULL),CIRCLEDOT,COLORYELLOW,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=N20,T20,'20'),COLORDD00DD;
N10:=10;
PT10:=CONST(HHVBARS(V,N10));
T10:IF(CURRBARSCOUNT<=N10,CONST(IF(PT10=0,C,REF(C,PT10))),DRAWNULL),COLOR00EEEE,LINETHICK2;
IF(CURRBARSCOUNT=PT10+1,T10,DRAWNULL)CIRCLEDOT,COLORYELLOW,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=N10,T10,'10'),COLOR00EEEE;
N5:=5;
PT5:=CONST(HHVBARS(V,N5));
T5:IF(CURRBARSCOUNT<=N5,CONST(IF(PT5=0,C,REF(C,PT5))),DRAWNULL),COLORFFFFFF,LINETHICK2;
IF(CURRBARSCOUNT=PT5+1,T5,DRAWNULL),CIRCLEDOT,COLORYELLOW,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=N5,T5,'5'),COLORFFFFFF;
DRAWKLINE(H,O,L,C);
VAR3:=(C+H+O+L)/4;
买入:=XMA(VAR3,32)*(1-100/1000);
低吸线:买入,COLORFF937F,LINETHICK2;
卖出:=XMA(VAR3,20)*(1+80/1000);
高抛线:卖出,COLORWHITE,LINETHICK2;
{买:CROSS(买入,LOW),NODRAW;
卖:CROSS(HIGH,卖出),NODRAW;}
MA1:=MA(VAR3,3);
DRAWICON(CROSS(买入,LOW),LOW*0.95,11);
DRAWICON(CROSS(HIGH,卖出),HIGH*1.02,12);
G:=5;
AAB:=REF(H,G)=HHV(H,2*G+1); AAB1:=REF(L,G)=LLV(L,2*G+1);
QYB:=BACKSET(AAB,G+1); QYB1:=BACKSET(AAB1,G+1);
CCB:=FILTER(QYB,G) AND H=HHV(H,G+1); CCB1:=FILTER(QYB1,G) AND L=LLV(L,G+1);
DDDB:=BARSLAST(CCB); DDB1:=BARSLAST(CCB1);
GDTSB:=IF(CCB,CURRBARSCOUNT,0); DDTSB:=IF(CCB1,CURRBARSCOUNT,0);
DINGBUTSB:=IF(DDDB,REF(GDTSB,DDDB),GDTSB); DDTSB1:=IF(DDB1,REF(DDTSB,DDB1),DDTSB);
GDCSB1:=CONST(DINGBUTSB); DDCSB1:=CONST(DDTSB1);
GDCS13:=CONST(REF(HIGH,GDCSB1-1)); DDCS13:=CONST(REF(L,DDCSB1-1));
DINGBUTSB1:=REF(DINGBUTSB,DDDB+1); DDTSB2:=REF(DDTSB1,DDB1+1);
GDCSB2:=CONST(DINGBUTSB1); DDCSB2:=CONST(DDTSB2);
GDCS23:=CONST(REF(HIGH,DINGBUTSB1-1)); DDCS23:=CONST(REF(L,DDTSB2-1));
XG1:=BACKSET(ISLASTBAR,GDCSB1); XD1:=BACKSET(ISLASTBAR,DDCSB1);
XG2:=BACKSET(ISLASTBAR,DINGBUTSB1); XD2:=BACKSET(ISLASTBAR,DDTSB2);
XDD:=IF(DDCS13<=DDCS23,XD1,XD2);
M:=INTPART(3*G/5);
AAAA:=REF(H,M)=HHV(H,2*M+1);
QYY:=BACKSET(AAAA,M+1);
CCC:=FILTER(QYY,M) AND H=HHV(H,M+1);
DDDD:=BARSLAST(CCC),NODRAW;
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,GDCSB1-1),NODRAW;
HH2:= REF(H,GDCSB2-1),NODRAW;
HH11:= REF(H,GDCS11-1),NODRAW;
HH22:= REF(H,GDCS22-1),NODRAW;
GHH1:=MAX(MAX(REF(H,GDCSB1-1),REF(H,GDCSB2-1)),MAX(REF(H,GDCS11-1),REF(H,GDCS22-1))),NODRAW;
DLL1:=MIN(MIN(REF(L,DDCSB1-1),REF(L,DDCSB2-1)),MIN(REF(L,DDCS11-1),REF(L,DDCS22-1))),NODRAW;
GHH:=MAX(GHH1,HHV(H,10));
DLL:=MIN(DLL1,LLV(L,10));
DX1:=(REF(H,GDCSB1-1)-REF(H,GDCSB2-1))/(GDCSB2-GDCSB1),NODRAW;
DX2:=(REF(H,GDCS11-1)-REF(H,GDCS22-1))/(GDCS22-GDCS11),NODRAW;
GGAA:=DX1>0 AND (REF(H,(GDCSB1-1))+DX1*GDCSB1)>GHH*1.05,NODRAW;
GGAB:=DX1<0 AND (REF(H,(GDCSB1-1))+DX1*GDCSB1)<DLL*0.95,NODRAW;
DDX1:=IF(GGAA OR GGAB,0,1),NODRAW;
GGBA:=DX2>0 AND (REF(H,(GDCS11-1))+DX2*GDCS11)>GHH*1.05,NODRAW;
GGBB:=DX2<0 AND (REF(H,(GDCS11-1))+DX2*GDCS11)<DLL*0.95,NODRAW;
DDDX1:=IF(GGBA OR GGBB,0,1),NODRAW;
LX1:=(REF(L,DDCSB1-1)-REF(L,DDCSB2-1))/(DDCSB2-DDCSB1),NODRAW;
LX2:=(REF(L,DDCS11-1)-REF(L,DDCS22-1))/(DDCS22-DDCS11),NODRAW;
DDAA:=LX1<0 AND (REF(L,(DDCSB1-1))+LX1*DDCSB1)<DLL*0.95,NODRAW;
DDAB:=LX1>0 AND (REF(L,(DDCSB1-1))+LX1*DDCSB1)>GHH*1.05,NODRAW;
LLX1:=IF(DDAA OR DDAB,0,1);
DDBA:=LX2<0 AND (REF(L,(DDCS11-1))+LX2*DDCS11)<DLL*0.95,NODRAW;
DDBB:=LX2>0 AND (REF(L,(DDCS11-1))+LX2*DDCS11)>GHH*1.05,NODRAW;
LLLX1:=IF(DDBA OR DDBB,0,1),NODRAW;
高压力:DRAWLINE(CURRBARSCOUNT=GDCSB2,H,CURRBARSCOUNT=GDCSB1,H,DDX1),COLORABFF46,LINETHICK1;
低支撑:DRAWLINE(CURRBARSCOUNT=DDCSB2,L,CURRBARSCOUNT=DDCSB1,L,LLX1),COLORABFF46,LINETHICK1;
DRAWLINE(CURRBARSCOUNT=GDCS22 ,H,CURRBARSCOUNT=GDCS11,H,DDDX1),COLORRED,LINETHICK1;
DRAWLINE(CURRBARSCOUNT=DDCS22 ,L,CURRBARSCOUNT=DDCS11,L,LLLX1),COLORRED,LINETHICK1;
{涨停标注}
STICKLINE(C/REF(C,1)>1.095,C,O,2,0),COLORYELLOW;
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
A1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
A2:=BARSLAST(REF(CROSS(DIFF,DEA),1));
VAR1:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;
HONGJU:=IF(VAR1>0,VAR1,0);
GAOPAO:=CROSS(DIFF,DEA) AND HONGJU>=40;
DRAWICON(GAOPAO,HIGH*1.01,6);
DRAWTEXT(GAOPAO,HIGH*1.02,'顶背'),COLORGREEN;
LLVV:=LLV(LOW,5);
DIXI:=CROSS(DEA,DIFF) AND REF(DEA,A1+1)>0 AND DEA<0;
DRAWICON(DIXI,LOW*0.90,38);
DRAWTEXT(DIXI,LOW*0.90,'波段低吸'),COLORYELLOW;
MA20:=MA(CLOSE,20);
M0:=MA(CLOSE,5);
M10:=MA(CLOSE,12);
M1:=MA(CLOSE,20);
M30:=MA(CLOSE,30);
M2:=MA(CLOSE,60);
M3:=MA(CLOSE,240);
M4:=MA(CLOSE,120);
M41:=MA(CLOSE,41);
TJ2:=MA(CLOSE,3)<M2;
VAR2:=(CLOSE*2+HIGH+LOW)/4;
SK:=EMA(VAR2,13)-EMA(VAR2,73);
SD:=EMA(SK,2);
短线:=CROSS(SK,SD) AND SK<0.05 AND (VOL/MA(VOL,5)>2 OR CLOSE/REF(CLOSE,1)>0.035 AND CLOSE>EMA(CLOSE,17));
{STICKLINE(短线,HIGH,LOW,0.5,0),COLORFFFF00;
STICKLINE(短线,OPEN,CLOSE,10,1),LINETHICK2,COLORFFFF00;}
CY:=BARSLAST(短线);
MACD双底:=REF(LOW,A2+1)<CLOSE AND CROSS(DIFF,DEA);
介入:=COUNT(短线,4)=1 AND COUNT(MACD双底,1)=1 AND CLOSE/MA(CLOSE,56)*1000>980 AND CLOSE>OPEN AND VOL>=MA(VOL,5) AND DIFF>=-0.1;
DRAWTEXT(介入,LOW*0.92,'起涨点'),COLORRED;
DRAWICON(介入,LOW*0.92,1);
反向顶背:=REF(CLOSE,A2+1)>CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
逃顶:=CROSS(SD,SK) AND SK>0.2 AND VOL/MA(VOL,5)<2;
逃顶成立:=COUNT(逃顶,4)=1 AND COUNT(反向顶背,1)=1;
DRAWICON(逃顶成立,HIGH*1.01,15);
DRAWTEXT(逃顶成立,HIGH*1.01,'逃顶'),COLORGREEN;
N1G:=CLOSE/REF(CLOSE,1)>=1.097 AND HIGH=CLOSE AND NOT(OPEN=HIGH);
A1G:=BARSLAST(N1G);
A2G:=LLV(LOW,A1G-1)>REF(LOW,A1G) AND CLOSE/REF |