diff:=ema(close,5)-ema(close,24);dea:=ema(diff,5);a2:=barslast(ref(cross(dea,diff),1));顶背离:=ref(close,a2+1)<close and ref(diff,a2+1)>diff and cross(dea,diff);count(顶背离,5)>=1 and cross(diff,dea); 20210311
diff:=ema(close,12)-ema(close,26);dea:=ema(diff,9);macd:=2*(diff-dea);c1:=barslast(ref(cross(dea,diff),1));xg:ref(c,c1+1)(diff,c1+1)>diff and cross(dea,diff);