k1:=IF(k8>ref(k8,5) and k3<ref(k3,5) ,1,0 ),COLORYELLOW;
k21:=IF(k8>ref(k8,7) and k3<ref(k3,7) ,1,0 ),COLORYELLOW;
k31:=IF(k8>ref(k8,9) and k3<ref(k3,9) ,1,0 ),COLORYELLOW;
k4:=IF(k8>ref(k8,11) and k3<ref(k3,11) ,1,0 ),COLORYELLOW;
nday := 3;
down := close/llv(low,60)<=1.2;
pma1 := ma(close,2);
pma2 := ma(close,5);
diff :=ema(close,12) - ema(close,26),colorwhite;
dea :=ema(diff,9),colorgreen;
vma1:=ma (vol,2)/100000,colorred;
vma2:=ma(vol,5)/100000,coloryellow;
ppday := barslast(cross(pma1,pma2));
vvday := barslast(cross(vma1,vma2));
macdday := barslast(cross(diff,dea));
A1:=BARSLAST(ref(cross("macd.diff"(5,12,9),"macd.dea"(5,12,9)),1));
背离、W底、金叉:=ref(c,A1+1)>c and ref("macd.diff"(5,12,9),A1+1)<"macd.diff"(5,12,9) and
cross("macd.diff"(5,12,9),"macd.dea"(5,12,9)),,colorred;
sjcjd:= if((ppday<=nday and vvday<=nday and macdday<=nday ) and (diff<0),1,0);
STICKLINE(sjcjd,50,60,6,0),colorwhite,linethick2;
MACD:= 2*(diff-dea), COLORSTICK;