A:=zig(2,0.8);
FXDD:=A>REF(A,1) AND REF(A,2)>REF(A,1);
GDDZ:=IF(FXDD,REF(LOW,1),0);
支撑位:=IF(GDDZ=0,REF(LOW,BArslAST(FXDD)+1),REF(LOW,1));
ZCW:=IF(支撑位=REF(支撑位,1),支撑位,DRAWNULL);
B:=ZIG(1,1);
FXGD:=B<REF(B,1) AND REF(B,2)<REF(B,1);
GGDZ:=IF(FXGD,REF(HIGH,1),0);
压力位:=IF(GGDZ=0,REF(HIGH,BARSLAST(FXGD)+1),REF(HIGH,1));
YLW:=IF(压力位=REF(压力位,1),压力位,DRAWNULL);
SCMD1:=BARSLAST((支撑位>REF(支撑位,1)OR 支撑位<REF(支撑位,1)) AND CLOSE>支撑位);
SCMD2:=BARSLAST(压力位>REF(压力位,1)OR 压力位<REF(压力位,1));
中间位:=(压力位-支撑位)*0.5+支撑位,COLORFFFF00;
ZIF:=EMA(C,12)-EMA(C,26);
ZEA:=EMA(ZIF,9);
ZBC:=2*(ZIF-ZEA);
ZJS:=1.25*ZIF-0.25*ZEA;
信号:=(ZJS*13*27-27*11*EMA(C,12)+13*25*EMA(C,26))/28,COLORWHITE;
平滑:=(ZIF*13*27-27*11*EMA(C,12)+13*25*EMA(C,26))/28,COLORYELLOW;
反趋势:=(ZEA*13*27-27*11*EMA(C,12)+13*25*EMA(C,26))/28,COLORCYAN;
牛熊:=(信号+反趋势)/2,COLORMAGENTA;{已更正};
DRAWBAND(信号,RGB(255,128,0),平滑,RGB(8,46,84));
HX:=HHV(HIGH,2);
LX:=LLV(LOW,2);
H1:=IF(HX<REF(HX,1)&&HX<REF(HX,2)&&HX<REF(HX,4)&&LX<REF(LX,1)&&LX<REF(LX,3)&&LX<REF(LX,5)&&OPEN>CLOSE&&(HHV(OPEN,0)-CLOSE)>0,REF(HX,4),0);
L1:=IF(LX>REF(LX,1)&&LX>REF(LX,3)&&LX>REF(LX,5)&&HX>REF(HX,1)&&HX>REF(HX,2)&&HX>REF(HX,4)&&OPEN<CLOSE&&(CLOSE-LLV(OPEN,0))>0,REF(LX,4),0);
H2:=VALUEWHEN(H1>0,H1);
L2:=VALUEWHEN(L1>0,L1);
K1:=IF(CLOSE>H2,-3,IF(CLOSE<L2,1,0));
K2:=VALUEWHEN(K1<>0,K1);
G:=IF(K2=1,H2,L2);
G1:=VALUEWHEN(ISLASTBAR,G);
DRAWNUMBER(LX>0,G1,G1);
TMP:=K2;
W1:=K2;
W2:=OPEN-CLOSE;
HT:=IF(OPEN>CLOSE,OPEN,CLOSE);
LT:=IF(OPEN<CLOSE,OPEN,CLOSE);
STICKLINE(K2>0,H,L,0,1),COLORGREEN;
STICKLINE(K2>0,O,C,2.8,1),COLORGREEN;
STICKLINE(K2>0 AND W2>0,H,L,0,1),COLORGREEN;
STICKLINE(K2>0 AND W2>0,O,C,2.8,0),COLORGREEN;
STICKLINE(K2<=0,H,L,0,1),COLORRED;
STICKLINE(K2<=0,O,C,2.8,1),COLORRED;
STICKLINE(K2<=0 AND W2>0,H,L,0,1),COLORRED;
STICKLINE(K2<=0 AND W2>0,O,C,2.8,0),COLORRED;
支撑线:=VALUEWHEN(K2=-3,G),COLORRED;
压力线:=VALUEWHEN(K2=1,G),COLORGREEN;
生命线:=EMA(((SLOPE(CLOSE,21) * 23) + CLOSE),48),COLORYELLOW,LINETHICK1;
SK:=SMA(生命线,2,1),NODRAW;
P2:HHV(C,30),LINETHICK1,COLORRED;
P1:LLV(C,30),LINETHICK3,COLORGREEN;
MA1:MA(C,5),COLORWHITE;
MA2:MA(C,10),COLORYELLOW;
MA3:MA(C,20),COLORFF00FF;