编写条件:
编写方法:
网友求助:
要求:macd前金叉时收盘价大于后金叉时收盘价并且macd前金叉值小于后金叉值
解答如下:
a:=MACD.diff;
b:=MACD.dea;
mm:=MACD.MACD;
tt:=BArslAST(a>0);
d:=crOSS(A,b);
e:=d AND tt;
t1:=BARSLAST(e);
t2:=REF(t1,t1+1)+t1+1;
xg:CROSS(REF(b,t1)>REF(b,t2) AND REF(mm,t1)>REF(mm,t2),0.5) ;
b:=MACD.dea;
mm:=MACD.MACD;
tt:=BArslAST(a>0);
d:=crOSS(A,b);
e:=d AND tt;
t1:=BARSLAST(e);
t2:=REF(t1,t1+1)+t1+1;
xg:CROSS(REF(b,t1)>REF(b,t2) AND REF(mm,t1)>REF(mm,t2),0.5) ;