mac交叉点统计
2019/12/5 18:55:35
公式编写说明:
试图找一macd指标,能统计某一时间段内0轴上交叉点的个数和轴下交叉点个数
公式源码回答:
N:=240;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA :=EMA(DIFF,9);
轴上金叉:=CROSS(DIFF,DEA) AND DEA>0;
轴上死叉:=CROSS(DEA,DIFF) AND DEA>0;
轴下金叉:=CROSS(DIFF,DEA) AND DEA<0;
轴下死叉:=CROSS(DEA,DIFF) AND DEA<0;
轴上交叉点数:COUNT(轴上金叉,240)+COUNT(轴上死叉,240);
轴下交叉点数:COUNT(轴下金叉,240)+COUNT(轴下死叉,240);
投股 票网 www.tou1 8.cn
股市公式下载推荐