M1:=2;M2:=60;
MID1:=(3*CLOSE+LOW+OPEN+HIGH)/6;
乖离率:(SMA(MID1,M1,1)-MA(SMA(MID1,2,1),M2))/MA(SMA(MID1,2,1),M2)*100,COLOR999999;
MID:=乖离率;
MA1:(10*MID+9*REF(MID,1)+8*REF(MID,2)+7*REF(MID,3)+6*REF(MID,4)+5*REF(MID,5)
+4*REF(MID,6)+3*REF(MID,7)+2*REF(MID,8)+1*REF(MID,9))/55,COLOR0000DD;
{ _通达信股票指标公式}
MA2:EMA(MA1,8),COLORWHITE; {MA1取普通平均值}
IF(MA1<=REF(MA1,1) ,MA1,DRAWNULL),COLOR22FF22;
IF(MA2<=REF(MA2,1),MA2,DRAWNULL),COLOR33FF33;
{长中短周期把握}
N1A:=BArslAST(crOSS(C,MA(C,13)));
N2A:=BARSLAST(CROSS(MA(C,13),C));
短线跟踪:IF(N1A<N2A,N1A+1,N2A+1)*0.01,COLORYELLOW,NODRAW;{上穿或下穿13线计时};
N1B:=BARSLAST(CROSS(C,MA(C,60)));
N2B:=BARSLAST(CROSS(MA(C,60),C));
中线跟踪:IF(N1B<N2B,N1B+1,N2B+1)*0.01,COLORRED,NODRAW;{上穿或下穿60线计时};
N1C:=BARSLAST(CROSS(C,MA(C,250)));
N2C:=BARSLAST(CROSS(MA(C,250),C));
长线跟踪:IF(N1C<N2C,N1C+1,N2C+1)*0.01,COLORGRAY,NODRAW;{上穿或下穿250线计时};
V0:0,COLOR666666;{零轴};