我是这么写的:
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA : EMA(DIFF,M);
MACD : 2*(DIFF-DEA);
Zero : 0;
A=CROSS(diff,dea);
B=REF(a,1);
但是测试没反应。
不知道哪儿错了,希望有高人来指点。
就用A和B表示吧
解答如下:
IFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
JC:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));//首先界定金叉条件:
XG:CROSS(DIFF,DEA) AND DEA<0 AND JC=2; //定位金叉的次数: