A1:=(H+L+O+3*C)/6;
A0:0,colorcyan;
bias1:(A1-EMA(A1,21))/EMA(A1,21)*100,colorwhite;
MX1:SMA(BIAS1,3,1),coloryellow;
MX2:SMA(MX1,3,1),colorblue;
M1:HHV(BIAS1,89),colorcyan;
M2:LLV(BIAS1,89),colorcyan;
DIFF:=BIAS1;
顶背离:=A1<=REF(A1,1) AND diff>REF(diff,1);
DRAWTEXT(顶背离,DIFF,'底'),colorred;
底背离:=A1>REF(A1,1) AND diff<REF(diff,1);
DRAWTEXT(底背离,DIFF,'顶'),colorgreen;
{-股票公式网站 }
STICKLINE(crOSS(BIAS1,5),0,BIAS1,1,0),colorred;
DRAWTEXT(CROSS(BIAS1,5) AND BIAS1<10,BIAS1,'5'),coloryellow;
STICKLINE(CROSS(BIAS1,10),0,BIAS1,2,0),colorred;
DRAWTEXT(CROSS(BIAS1,10) AND BIAS1<15,BIAS1,'10'),coloryellow;
STICKLINE(CROSS(BIAS1,15),0,BIAS1,3,0),colorred;
DRAWTEXT(CROSS(BIAS1,15) AND BIAS1<20,BIAS1,'15'),coloryellow;
STICKLINE(CROSS(BIAS1,20),0,BIAS1,3,0),colormagenta;
DRAWTEXT(CROSS(BIAS1,20),BIAS1,'20'),coloryellow;
STICKLINE(CROSS(-5,BIAS1),0,BIAS1,1,0),colorgreen;
DRAWTEXT(CROSS(-5,BIAS1) AND BIAS1> -10,BIAS1,'-5'),coloryellow;
STICKLINE(CROSS(-10,BIAS1),0,BIAS1,2,0),colorgreen;
DRAWTEXT(CROSS(-10,BIAS1) AND BIAS1> -15,BIAS1,'-10'),coloryellow;
STICKLINE(CROSS(-15,BIAS1),0,BIAS1,3,0),colorgreen;
DRAWTEXT(CROSS(-15,BIAS1) AND BIAS1> -20,BIAS1,'-15'),coloryellow;
STICKLINE(CROSS(-20,BIAS1),0,BIAS1,3,0),colormagenta;
DRAWTEXT(CROSS(-20,BIAS1),BIAS1,'-20'),coloryellow;