年线:MA(C,250),LINETHICK1,COLORWHITE,DOTLINE;
{十均线指标}
E3:EMA(C,5),DOTLINE,COLORCYAN;
E5:EMA(C,8),DOTLINE,COLORCYAN;
E8:EMA(C,10),DOTLINE,COLORCYAN;
E10:EMA(C,12),DOTLINE,COLORCYAN;
E12:EMA(C,15),DOTLINE,COLORCYAN;
E30:EMA(C,60),DOTLINE,COLORGREEN;
E35:EMA(C,65),DOTLINE,COLORGREEN;
E40:EMA(C,70),DOTLINE,COLORGREEN;
E45:EMA(C,75),DOTLINE,COLORGREEN;
E50:EMA(C,80),DOTLINE,COLORGREEN;
IF(E3>REF(E3,1),E3,DRAWNULL),COLORMAGENTA;
IF(E5>REF(E5,1),E5,DRAWNULL),COLORMAGENTA;
IF(E8>REF(E8,1),E8,DRAWNULL),COLORMAGENTA;
IF(E10>REF(E10,1),E10,DRAWNULL),COLORMAGENTA;
IF(E12>REF(E12,1),E12,DRAWNULL),COLORMAGENTA;
IF(E30>REF(E30,1),E30,DRAWNULL),COLORRED;
IF(E35>REF(E35,1),E35,DRAWNULL),COLORRED;
IF(E40>REF(E40,1),E40,DRAWNULL),COLORRED;
IF(E45>REF(E45,1),E45,DRAWNULL),COLORRED;
IF(E50>REF(E50,1),E50,DRAWNULL),COLORRED;
H3:=IF(C>E3 AND L<E3,1,0);H5:=IF(C>E5 AND L<E5,1,0);H8:=IF(C>E8 AND L<E8,1,0);
H10:=IF(C>E10 AND L<E10,1,0);H12:=IF(C>E12 AND L<E12,1,0);H30:=IF(C>E30 AND L<E30,1,0);
H35:=IF(C>E35 AND L<E35,1,0);H40:=IF(C>E40 AND L<E40,1,0);H45:=IF(C>E45 AND L<E45,1,0);
H51:=IF(C>E50 AND L<E50,1,0);
N1:=H3+H5+H8+H10+H12;
N2:=H30+H35+H40+H45+H51;
TS10:=MIN(MIN(MIN(MIN(E3,E5),E8),E10),E12);
TS11:=MAX(MAX(MAX(MAX(E30,E35),E40),E45),E50);
ZF:=(C/REF(C,1)-1)*100;
穿8线:=N1+N2>=8 AND ZF>0 ;
穿5线:=EVERY(TS10>TS11,5) AND N1=5 AND ZF>0;
STICKLINE(穿8线,O,C,3,0),COLORYELLOW;
STICKLINE(穿5线,O,C,3,0),COLORMAGENTA;
ZRSI:="RSI.RSI1#WEEK"(9);
ZA:=ZRSI>50;
ZB:=CROSS(ZA>REF(ZA,1),0.5);
DRAWTEXT(ZB,L, '阶底'),COLORGREEN;
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2,COLORSTICK;
JZX1:=CROSS(DIF,DEA);
JZX2:=CROSS(DEA,DIF);
前高:IF(CONST(SUMBARS(JZX1,2)-BARSLAST(JZX2))>2,IF(CURRBARSCOUNT<=CONST(FINDHIGHBARS(DIF,BARSLAST(JZX2),SUMBARS(JZX1,2)-BARSLAST(JZX2),1))+1,CONST(FINDHIGH(H,BARSLAST(JZX2),SUMBARS(JZX1,2)-BARSLAST(JZX2),1)),DRAWNULL),DRAWNULL),COLORMAGENTA,DOTLINE;
前低:IF(CONST(SUMBARS(JZX1,2)-BARSLAST(JZX2))>2,IF(CURRBARSCOUNT<=CONST(FINDLOWBARS(DIF,BARSLAST(JZX1),SUMBARS(JZX1,2)-BARSLAST(JZX2),1))+1,CONST(FINDLOW(L,BARSLAST(JZX1),SUMBARS(JZX1,2)-BARSLAST(JZX2),1)),DRAWNULL),DRAWNULL),COLORGREEN,DOTLINE;