Jm:=cross( Macd.DIFF (12,26,9), Macd.DEA (12,26,9)); JmCOUNT:=COUNT(Jm,BARSLAST( Macd.DEA (12,26,9) =0)); Jmtj:=1*( Macd.DEA (12,26,9) 0 and Count(JmCount=2,21)=1); xg:if(jmtj,1,0);