AA:=(3*CLOSE+OPEN+LOW+HIGH)/6;
AB:=(20*AA+19*REF(AA,1)+18*REF(AA,2)+17*REF(AA,3)+16*REF(AA,4)+15*REF(AA,5)+14*REF(AA,6)
+13*REF(AA,7)+12*REF(AA,8)+11*REF(AA,9)+10*REF(AA,10)+9*REF(AA,11)+8*REF(AA,12)
+7*REF(AA,13)+6*REF(AA,14)+5*REF(AA,15)+4*REF(AA,16)+3*REF(AA,17)+2*REF(AA,18)+
REF(AA,20))/210;
DT:=MA(AMOUNT,6)>MA(AMOUNT,12) AND MA(AMOUNT,12)>MA(AMOUNT,24);
COUNT(REF(NOT(DT),1) AND DT,30)>=2 AND DT AND "MACD.DEA">0 AND CROSS("MACD.DIF","MACD.DEA") AND CROSS(AA,AB);