通达信公式,求高手,20日内MA5两次金叉(与MA10,MA20,MA60,MA120,MA250任意两个金叉)

2024-12-25 17:23:01
推荐回答(1个)
回答1:

MA2:=MA(C,10);
MA3:=MA(C,20);
MA4:=MA(C,60);
MA5:=MA(C,120);
MA6:=MA(C,250);
XG1:=CROSS(MA1,MA2) AND COUNT(CROSS(MA1,MA2),20)=2;
XG2:=CROSS(MA1,MA3) AND COUNT(CROSS(MA1,MA3),20)=2;
XG3:=CROSS(MA1,MA4) AND COUNT(CROSS(MA1,MA4),20)=2;
XG4:=CROSS(MA1,MA5) AND COUNT(CROSS(MA1,MA5),20)=2;
XG5:=CROSS(MA1,MA6) AND COUNT(CROSS(MA1,MA6),20)=2;
XG:XG1 OR XG2 OR XG3 OR XG4 OR XG5;