MA20:=MA(CLOSE,20);
macd2:=2*(C-MA20);
MA5:=MA(CLOSE,5);
MacD1:=2*(C-MA5);
VAR1:=MACD2>REF(MACD2,1) AND REF(MACD2,1)< REF(MACD2,2) AND REF(MACD2,2)< REF(MACD2,3);
VAR2:=REF(MACD1,1)< 0 AND MACD1>0;
VAR3:=MA20>REF(MA20,1);
XG:VAR1 AND VAR2 AND VAR3;
MA20:=MA(CLOSE,20);
macd2:=2*(C-MA20);
MA5:=MA(CLOSE,5);
MacD1:=2*(C-MA5);
VAR1:=MACD2>REF(MACD2,1) AND REF(MACD2,1)< REF(MACD2,2) AND REF(MACD2,2)< REF(MACD2,3);
VAR2:=REF(MACD1,1)< 0 AND MACD1>0;
VAR3:=MA20>REF(MA20,1);
XG:VAR1 AND VAR2 AND VAR3;