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);
condtion_a:=cross("macd.dif","macd.dea");condtion_b:=cross("kd.k","kd.d");condtion_c:=l=llv(l,60);condtion:condtion_a and condtion_b and condtion_c;公式中的数值”60”表示为60个交易周期,并非指六十天,你可以计算一下,一个月几个交易周期,根据你的需要...
dif:=ema(c,12)-ema(c,26);dea:=ema(dif,9);macd:=(dif-dea)*2;m1:=macd<0 andmacd>ref(macd,1);m2:=dif;m3:=(dif-ref(dea,1))/ref(dea,1)*100;m4:=between(m3,20,40);mxg:m1 and m2 and m4;