DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD收阳:=(DIF-DEA)*2>0;
A1:=MACD收阳 >REF(MACD收阳,1);
MACD收阴:=(DIF-DEA)*2<0;
A2:=MACD收阳<REF(MACD收阳,1);
K线收阴:=C<O;
K线收阳:=C>O;
A3:=MACD收阳 AND K线收阴 AND A1 AND O<20;
A4:=MACD收阳 AND K线收阳 AND A2 AND O<20;
XG:A3 OR A4;