{乖离率指标公式}
BIAS1:=(CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100;
BIAS2:=(CLOSE-MA(CLOSE,12))/MA(CLOSE,12)*100;
BIAS3:=(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100;
BIAS:=(BIAS1+2*BIAS2+3*BIAS3)/6;
乖离:=MA(BIAS,3);
DRAWTEXT(CROSS(BIAS,乖离) AND 乖离<-9,0.5,'底'),COLORWHITE;
STICKLINE(CROSS(BIAS,乖离) AND 乖离<-9,0,0.4,4,0),COLORLIGRAY;
短买:IF(BIAS1<=-6,0.2,0),COLORYELLOW,LINETHICK2;
中买:IF(BIAS2<=-10,0.4,0),COLORMAGENTA,LINETHICK2;
长买:IF(BIAS3<=-16,0.6,0),COLORRED,LINETHICK2;
短卖:IF(BIAS1>=6,0.8,1),COLORFF8000,LINETHICK2;
中卖:IF(BIAS2>=10,0.6,1),COLORCYAN,LINETHICK2;
长卖:IF(BIAS3>=16,0.4,1),COLORGREEN,LINETHICK2