m:=5;
n1:=10;
n2:=20;
n3:=34;
n:=3;
JJH:=H;
JJL:=L;
AA2:=REF(JJH,N)=HHV(JJH,2*N+1);
AA3:=FILTER(AA2,N);
AA4:=BACKSET(AA3,N+1);
AA5:=FILTER(AA4,N);
AA7:=REF(JJL,N)=LLV(JJL,2*N+1);
AA8:=FILTER(AA7,N);
AA9:=BACKSET(AA8,N+1);
AA10:=FILTER(AA9,N);
AA11:=REF(H,BARSLAST(AA5));
AA12:=REF(L,BARSLAST(AA10));
AA13:=BARSLAST(AA5)<BARSLAST(AA10) AND NOT(AA5) ;
AA14:=BARSLAST(AA5)>BARSLAST(AA10) AND NOT(AA10);
AA15:=BARSLAST(AA5);
AA16:=CONST(AA15);
AA17:=REF(AA11,AA15+1);
AA18:=CONST(AA17);
AA19:=BARSLAST(H=AA18);
AA20:=CONST(AA19);
AA21:=BARSLAST(AA10);
AA22:=CONST(AA21);
AA23:=REF(AA12,AA21+1);
AA24:=CONST(AA23);
AA25:=BARSLAST(L=AA24);
AA26:=CONST(AA25);
RR:=BARSLAST(H=CONST(AA11));
BB2:=REF(JJH,M)=HHV(JJH,2*M+1);
BB3:=FILTER(BB2,M);
BB4:=BACKSET(BB3,M+1);
BB5:=FILTER(BB4,M);
BB7:=REF(JJL,M)=LLV(JJL,2*M+1);
BB8:=FILTER(BB7,M);
BB9:=BACKSET(BB8,M+1);
BB10:=FILTER(BB9,M);
BB11:=REF(H,BARSLAST(BB5));
BB12:=REF(L,BARSLAST(BB10));
BB13:=BARSLAST(BB5)<BARSLAST(BB10) AND NOT(BB5) ;
BB14:=BARSLAST(BB5)>BARSLAST(BB10) AND NOT(BB10);
BB15:=BARSLAST(BB5);
BB16:=CONST(BB15);
BB17:=REF(BB11,BB15+1);
BB18:=CONST(BB17);
BB19:=BARSLAST(H=BB18);
BB20:=CONST(BB19);
BB21:=BARSLAST(BB10);
BB22:=CONST(BB21);
BB23:=REF(BB12,BB21+1);
BB24:=CONST(BB23);
BB25:=BARSLAST(L=BB24);
BB26:=CONST(BB25);
CC2:=REF(JJH,N1)=HHV(JJH,2*N1+1);
CC3:=FILTER(CC2,N1);
CC4:=BACKSET(CC3,N1+1);
CC5:=FILTER(CC4,N1);
CC7:=REF(JJL,N1)=LLV(JJL,2*N1+1);
CC8:=FILTER(CC7,N1);
CC9:=BACKSET(CC8,N1+1);
CC10:=FILTER(CC9,N1);
CC11:=REF(H,BARSLAST(CC5));
CC12:=REF(L,BARSLAST(CC10));
CC13:=BARSLAST(CC5)<BARSLAST(CC10) AND NOT(CC5) ;
CC14:=BARSLAST(CC5)>BARSLAST(CC10) AND NOT(CC10);
CC15:=BARSLAST(CC5);
CC16:=CONST(CC15);
CC17:=REF(CC11,CC15+1);
CC18:=CONST(CC17);
CC19:=BARSLAST(H=CC18);
CC20:=CONST(CC19);
CC21:=BARSLAST(CC10);
CC22:=CONST(CC21);
CC23:=REF(CC12,CC21+1);
CC24:=CONST(CC23);
CC25:=BARSLAST(L=CC24);
CC26:=CONST(CC25);
DD2:=REF(JJH,N2)=HHV(JJH,2*N2+1);
DD3:=FILTER(DD2,N2);
DD4:=BACKSET(DD3,N2+1);
DD5:=FILTER(DD4,N2);
DD7:=REF(JJL,N2)=LLV(JJL,2*N2+1);
DD8:=FILTER(DD7,N2);
DD9:=BACKSET(DD8,N2+1);
DD10:=FILTER(DD9,N2);
DD11:=REF(H,BARSLAST(DD5));
DD12:=REF(L,BARSLAST(DD10));
DD13:=BARSLAST(DD5)<BARSLAST(DD10) AND NOT(DD5) ;
DD14:=BARSLAST(DD5)>BARSLAST(DD10) AND NOT(DD10);
DD15:=BARSLAST(DD5);
DD16:=CONST(DD15);
DD17:=REF(DD11,DD15+1);
DD18:=CONST(DD17);
DD19:=BARSLAST(H=DD18);
DD20:=CONST(DD19);
DD21:=BARSLAST(DD10);
DD22:=CONST(DD21);
DD23:=REF(DD12,DD21+1);
DD24:=CONST(DD23);
DD25:=BARSLAST(L=DD24);
DD26:=CONST(DD25);
EE2:=REF(JJH,N3)=HHV(JJH,2*N3+1);
EE3:=FILTER(EE2,N3);
EE4:=BACKSET(EE3,N3+1);
EE5:=FILTER(EE4,N3);
EE7:=REF(JJL,N3)=LLV(JJL,2*N3+1);
EE8:=FILTER(EE7,N3);
EE9:=BACKSET(EE8,N3+1);
EE10:=FILTER(EE9,N3);
EE11:=REF(H,BARSLAST(EE5));
EE12:=REF(L,BARSLAST(EE10));
EE13:=BARSLAST(EE5)<BARSLAST(EE10) AND NOT(EE5) ;
EE14:=BARSLAST(EE5)>BARSLAST(EE10) AND NOT(EE10);
EE15:=BARSLAST(EE5);
EE16:=CONST(EE15);
EE17:=REF(EE11,EE15+1);
EE18:=CONST(EE17);
EE19:=BARSLAST(H=EE18);
EE20:=CONST(EE19);
EE21:=BARSLAST(EE10);
EE22:=CONST(EE21);
EE23:=REF(EE12,EE21+1);
EE24:=CONST(EE23);
EE25:=BARSLAST(L=EE24);
EE26:=CONST(EE25);
压力:DRAWLINE(CURRBARSCOUNT=CONST(RR)+1,AA11,CURRBARSCOUNT=1,AA11,1),COLORYELLOW;
DRAWLINE(CURRBARSCOUNT=AA20+1,H,IF(CONST(AA11)>=CONST(AA17),CURRBARSCOUNT=AA20+1,CURRBARSCOUNT=AA16+1),H,1),COLORLIRED;
DRAWLINE(CURRBARSCOUNT=AA26+1,L,CURRBARSCOUNT=AA22+1,L,1),COLORRED;
DRAWLINE(CURRBARSCOUNT=BB20+1,H,IF(CONST(BB11)>=CONST(BB17),CURRBARSCOUNT=BB20+1,CURRBARSCOUNT=BB16+1),H,1),COLORBBFFFF;
DRAWLINE(CURRBARSCOUNT=BB26+1,L,CURRBARSCOUNT=BB22+1,L,1),COLORYELLOW;
DRAWLINE(CURRBARSCOUNT=CC20+1,H,IF(CONST(CC11)>=CONST(CC17),CURRBARSCOUNT=CC20+1,CURRBARSCOUNT=CC16+1),H,1),COLORFF00BB;
DRAWLINE(CURRBARSCOUNT=CC26+1,L,CURRBARSCOUNT=CC22+1,L,1),COLORMAGENTA;
DRAWLINE(CURRBARSCOUNT=DD20+1,H,IF(CONST(DD11)>=CONST(DD17),CURRBARSCOUNT=DD20+1,CURRBARSCOUNT=DD16+1),H,1),COLORC5AC72;
DRAWLINE(CURRBARSCOUNT=DD26+1,L,CURRBARSCOUNT=DD22+1,L,1),COLOREEAC72;
DRAWLINE(CURRBARSCOUNT=EE20+1,H,IF(CONST(EE11)>=CONST(EE17),CURRBARSCOUNT=EE20+1,CURRBARSCOUNT=EE16+1),H,1),COLORABD0BC;
DRAWLINE(CURRBARSCOUNT=EE26+1,L,CURRBARSCOUNT=EE22+1,L,1),COLORABD066;
LC:=REF(CLOSE,1);
RSI:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
DRAWTEXTEX(ISLASTBAR,1,800,950,' ■rsi=' +NUMTOSTR(rsi,0)),COLORGREEN;
MA5:=MA(CLOSE,5);
MA13:=MA(CLOSE,13);
MA60:=MA(CLOSE,60);
VK:=SQRT(VOL/CAPITAL*100*5);
持股线:=MA(C,13);
持股:IF(RSI>=50,持股线,DRAWNULL),LINETHICK2,COLORRED;
加仓:=RSI<15 AND COUNT(C<O,4)=4;
DRAWTEXT(加仓=1,LOW-0.03,'加'),COLORWHITE,ALIGN0;
获利盘:=WINNER(C)*100,LINETHICK0;
高控盘:IF(获利盘>90,H*1.02,DRAWNULL),LINETHICK4,COLORRED;
STICKLINE(CROSS(获利盘,90) ,O,C,4,0 ),COLORRED;
A:=MA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),19);
B:=-100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14));
D:=EMA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),4);
长期线:=A+100;
短期线:=B+100;
中期线:=D+100;
见顶:=((REF(中期线,1)>85 AND REF(短期线,1)>85 AND REF(长期线,1)>65) AND CROSS(长期线,短期线));
顶区:=(中期线<REF(中期线,1) AND REF(中期线,1)>80) AND (REF(短期线,1)>95 OR REF(短期线,2)>95 ) AND 长期线>60 AND 短期线<83.5
AND 短期线<中期线 AND 短期线<长期线+4,COLORRED;
STICKLINE( 顶区,L*0.9,H*1.1,0,0-1),COLORGREEN;
底区:IF((长期线<12 AND 中期线<8 AND (短期线<7.2 OR REF(短期线,1)<5) AND (中期线>REF(中期线,1) OR 短期线>REF(短期线,1)))
OR (长期线<8 AND 中期线<7 AND 短期线<15 AND 短期线>REF(短期线,1)) OR (长期线<10 AND 中期线<7 AND 短期线<1),H*1.02,DRAWNULL) ,CROSSDOT,LINETHICK5,COLORWHITE;
低叉:IF((长期线<15 AND REF(长期线,1)<15 AND 中期线<18 AND 短期线>REF(短期线,1) AND CROSS(短期线,长期线) AND 短期线>中期线
AND (REF(短期线,1)<5 OR REF(短期线,2)<5 ) AND (中期线>=长期线 OR REF( 短期线,1)<1 )),H*1.02,DRAWNULL),CROSSDOT,LINETHICK5,COLORLIRED;
{DIFZ:=EMA(C,12)-EMA(C,26);
DEAZ:=EMA(DIFZ,9);
MACDZ:=2*(DIFZ-DEAZ);
零轴:=DYNAINFO(3)*1.25,COLORFFFFFF;
STICKLINE(MACDZ>0,MACDZ*2+零轴,零轴,1,0),COLOR400080;
STICKLINE(MACDZ>0 AND MACDZ>REF(MACDZ,1),MACDZ*2+零轴,零轴,1,0),COLOR0000FF;
STICKLINE(MACDZ<0,MACDZ*2+零轴,零轴,1,0),COLOR00D900;
STICKLINE(MACDZ<0 AND MACDZ>REF(MACDZ,1),MACDZ*2+零轴,零轴,1,0),COLORC080FF;
ZDIF:(DIFZ*2+零轴),COLORRED;
(DEAZ*2+零轴),COLORFFFFFF;
IF(DIFZ<=REF(DIFZ,1),DIFZ*2+零轴,DRAWNULL),COLORFFF000;}
TJ1:=EMA((C-L),20)/EMA((H-L),20)*100;
TJ2:=(L-ABS(MIN(C,O)))/L<=1;
TJ3:=ABS |