源碼: DRAWGBKLAST(C>0,STRIP(RGB(25,15,0),RGB(60,200,0),70)); DRAWTEXTREL(999,999,'<span style="display:none;"><a data-cke-saved-href=" http://www.kzuj.com.cn" href=" http://www.kzuj.com.cn">程序化交易</a></span>'); stickline(HHV(HIGH,5)>=REF(HHV(HIGH,5),1),-40,40,0.5,0),POINTDOT,color808080; B5:=(C-MA(C,5))/MA(C,5)*100;{5天乖離} B10:=(C-MA(C,10))/MA(C,10)*100;{10天乖離} Bj10:=ma(B10,3); B55:=(C-MA(C,55))/MA(C,55)*100;{N天乖離,取55} Bj55:= MA(B55,8); {-----------------【圖解模板】---------------------} {填色} FILLRGN(Bj55,0,Bj55>0 and Bj55>ref(Bj55,1)),ColorFF55FF; FILLRGN(Bj55,0,Bj55<0 and Bj55<ref(Bj55,1)),colorblue; FILLRGN(Bj55,0,Bj55>0 and Bj55<ref(Bj55,1)),Color00FF00; FILLRGN(Bj55,0,Bj55<0 and Bj55>ref(Bj55,1)),COLORFF55FF; {背離} A1:=BARSLAST(REF(CROSS(B55,Bj55),1)); 底背離:=REF(C,A1+1)>C AND B55>REF(B55,A1+1) AND CROSS(B55,Bj55); DRAWTEXTREL(10,880,'www.kzuj.com.cn'),coloryellow; DRAWLINE(A1=0,Bj55,底背離,Bj55,0),Color0098FF,linethick3; A2:=BARSLAST(REF(CROSS(Bj55,B55),1)); 頂背離:=REF(C,A2+1)<C AND REF(Bj55,A2+1)>B55 AND CROSS(Bj55,B55); DRAWLINE(A2=0,Bj55,頂背離,Bj55,0),COLORGREEN,DOTLINE; {乖離} 乖離5:=B5; 均離10:=Bj10; 乖離55:B55,PRECIS2,LINETHICK2,COLORWHITE; 均離55:Bj55,PRECIS2,LINETHICK2,COLOR0000FF; 點擊復制上述代碼粘貼到到公式管理器