DIF:100*(EMA(CLOSE,5)/EMA(CLOSE,34)-1);1 H& N9 K% _4 C( z
DEA:EMA(DIF,5);BOLL:=MA(CLOSE,21);3 b* _; N1 v$ x9 o, j* W
MACDDIF-DEA)*2,COLORSTICK;+ U) [* D6 ?, e6 ~' m& w; Q5 E4 ?
UB:=BOLL+2*STD(CLOSE,21);$ X# _ y7 X6 {# n
LB:=BOLL-2*STD(CLOSE,21);. {1 O& e- u$ F. H2 q* j+ B
T1:=LONGCROSS(CLOSE,LB*0.98,2);T2:=LONGCROSS(UB,CLOSE*1.02,2);
& K4 p! }6 J5 R9 g7 K5 _GT:=DIF-REF(DIF,1);T3:=LONGCROSS(GT,0,2);4 j+ _3 _3 y* h8 \' T
MT:=MACD-REF(MACD,1);T4:=LONGCROSS(MT,0,2);
+ ~+ [ w/ K1 t) x* bGD:=LONGCROSS(DIF,DEA,3); M5:=MA(CLOSE,5);; Q Z$ B' ?# ]. A4 a
A1:=SUMBARS(GD,1);A2:=SUMBARS(GD,2);A3:=SUMBARS(GD,3);; N7 ~* `* j( `3 r0 c3 Y
B1:=SUMBARS(T4,1);B2:=SUMBARS(T4,2);B3:=SUMBARS(T4,3);; j: o& u3 W' u5 O" O" w T' G" V
M0:=REF(MACD,B1*(B1>2)),NODRAW; M1:=MIN(REF(MACD,B2),REF(MACD,B3)),NODRAW;
8 l9 {1 z% M/ `* A6 x$ rZ0:=REF(DIF,A1*(A1>2)),NODRAW;Z1:=MIN(REF(DIF,A2),REF(DIF,A3));
4 M. R' \, y! k背离选:=DIF>Z1 AND MACD>M1 AND CROSS((M5-REF(M5,1)),0),NODRAW,COLORRED;* g. x2 d- C% h: Y+ _
减仓:=(CLOSE |