编写要求:
macd三次金叉的公式,要求每一次金叉时,DEA要大于等于前一次DEA,同时第三次金叉在0轴附近,
解答:
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=(DIFF-DEA)*2;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=1,21)=1;
T1:=BARSLAST(金叉);
二金叉:=CROSS(DIFF,DEA) AND DEA<0 AND DEA>REF(DEA,T1) AND COUNT(JCCOUNT=2,21)=1;
T2:=BARSLAST(二金叉);
三金叉:CROSS(DIFF,DEA) AND BETWEEN(DEA,0,0.2) AND DEA>REF(DEA,T2) AND COUNT(JCCOUNT=3,28)=1;
Copyright 2018- www.dyjian.com/ 大宇股票知识网 海口美兰韩哲棚百货商行 版权所有 琼ICP备2023001966号
免责声名:本站所发表的内容仅用于学术交流和学习,内容所带来的一切后果均与本站无关。若您发现本站存在您非授权的原创作品,请第一时间联系本站删除!