M1:=MA(CLOSE,20);
M2:=MA(CLOSE,30);
MA5:=MA(C,15);
乖离率:=((((C-MA(C,5))/MA(C,5)+(C-MA(C,20))/MA(C,20)+(C-MA(C,25))/MA(C,25))*100)/3);
止损:=IF(HHV(乖离率>20,10) AND FILTER(乖离率<REF(乖离率,1),6) AND crOSS(MA(C,5),MA(C,2)),-10,0),
,LINETHICK2,COLOR00CC00;
乖离率10:=((((C-MA(C,10))/MA(C,10)+(C-MA(C,30))/MA(C,30)+(C-MA(C,40))/MA(C,40))*100)/3);
乖离率30:=((((C-MA(C,30))/MA(C,30)+(C-MA(C,60))/MA(C,60)+(C-MA(C,80))/MA(C,80))*100)/3);
A:=MA(乖离率,60);
乖:=MA(乖离率10,3);
乖2:=MA(乖离率30,3);
ZJ:=(乖+乖2)/2,LINETHICK2;
乖3:=MA(乖离率30,20);
乖4:=MA(乖离率10,35),LINETHICK2;
B2:=乖3<-20 AND 乖3>REF(乖3,1);
超跌反弹:=A>0 AND ZJ<=A AND 乖3<0;
STICKLINE(乖3>0,乖3,0,2,1),COLOR0000FF;
STICKLINE(乖3<0,乖3,0,2,1),COLORCCCC00;
STICKLINE(乖3<-20 AND 乖3>REF(乖3,1),0,乖3,2,0),COLOR00FFFF;
STICKLINE(乖3>20 AND 乖3<REF(乖3,1),0,乖3,2,0),COLORFFFFFF;
STICKLINE(ZJ>乖4,乖4,ZJ,2,1),COLORLIMAGENTA;
STICKLINE(乖3<乖4 AND 乖3<0 AND 乖4<0,乖3,乖4,2,1),COLORWHITE;
STICKLINE(乖4>0,乖4,0,2,1),COLOR00FFFF;
STICKLINE(乖4<0,乖4,0,2,1),COLOR80FF80;
STICKLINE(乖4<-20 AND 乖4>REF(乖4,1),0,乖4,2,0),COLOR00FFFF;
STICKLINE(乖4>20 AND 乖4<REF(乖4,1),0,乖4,2,0),COLOR00CC00;
DRAWICON(ZJ>乖4 AND B2 AND CROSS(ZJ,乖4),6,13);
DRAWICON(乖4>20 AND 乖4<REF(乖4,1) AND 乖3>20 AND 乖3<REF(乖3,1),-6,2);
STICKLINE(乖离率>20 AND 乖离率<REF(乖离率,1),0,ZJ,2,0),COLORFF8000;
STICKLINE(乖3>0 AND ZJ>乖3,乖3,ZJ,2,1),COLORFFFF80;
STICKLINE(乖3>0 AND ZJ<乖3 AND ZJ>乖4,ZJ,乖4,2,1),COLOR008000;
下跌途中:=乖4<REF(乖4,1) AND 乖3<REF(乖3,1) AND ZJ<REF(ZJ,1);
STICKLINE(超跌反弹=1,ZJ,0,2,1),COLOR400080;
STICKLINE(下跌途中=1,2,0,2,1),COLORGREEN;