dif:ema(close,12)-ema(close,26);dea:ema(dif,9);macd:(dif-dea)*2,colorstick;drawicon(dif>0 and cross(dif,dea),0,1);零轴上金叉次数:if(dif>0,sum(cross(dif,dea),if(dif>0,barslast(cross(dif,0))+1,0)),0),nodraw; 20210311
最好依据公式:diff:=ema(close,12)-ema(close,26);dea:=ema(diff,9);a0:=cross(diff,dea);a:=a0 and diff<0;ft:=barslast(a);b:=count(a0,ft);第二个金叉:diff>0 and dea>0 and a0 and b<2;编写周日同时二次金叉的公式。