编写要求:
公式在线网解答:
网友求助:
现在这个公式只能选出当天收盘后二次金叉的股票,以前出现的不能选出,请老师给改成只要10天之内出现过的都能选出,谢谢。
原公式:
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,13)=1;
解答如下:
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
COUNT(低位金叉,10)>=1;