dif:ema(close,12)-ema(close,26);dea:ema(dif,9);macd:(dif-dea)*2,colorstick;jccount:=count(cross(dif,dea),barslast(dea>=0));二金:=cross(dif,dea) and dea<0 and count(jccount=2,21)=1;stickline(二金,0,-0.10,6,0),colorff00ff;drawicon(二金,dea*1.04,13);drawtext(二金,-0.08,' 二金'),colorff00ff;a1:=barslast(ref(cross(dif,dea),1));底背离:=ref(close,a1+1)>close and dif>ref(dif,a1+1) and cross(dif,dea);stickline(底背离,0,0.13,6,0),colorred;drawtext(底背离,dea,' 底背离'),colorred;a2:=barslast(ref(cross(dea,dif),1));顶背离:=ref(close,a2+1)<close and ref(dif,a2+1)>dif and cross(dea,dif);drawtext(顶背离,dea,' 顶背离'),colorgreen;aa1:=dif<0 and dea<0;aa2:=aa1>ref(aa1,1);aa3:=barslast(aa2);aa4:=count(dea>0 and dif>0,aa3)=0;aa5:=cross(dif,dea);{金叉}aa6:=barslast(aa5);aa7:=ref(aa6,aa6+1)+aa6;aa8:=(dif+dea)/2;aa9:=(high+low)/2;aa10:=aa5 and aa7<aa3 and aa4 and aa8>ref(aa8,aa7) and aa9<ref(aa9,aa7) and macd>0;drawtext(aa10,dif*0.95,'★'),coloryellow; 20210311