DIF:=EMA(CLOSE,12)-EMA(CLOSE,26); DEA:=EMA(DIF,9); MACD:=(DIF-DEA)*2; AA:=CROSS(DIF,DEA) AND DEA>0; BB:=BARSLAST(CROSS(DEA,DIF)) AND DEA>0; CC:=REF(BARSLAST(CROSS(DIF,0))<20,BARSLAST(CROSS(DEA,DIF))+1); AA AND BB AND CC;
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26); DEA:=EMA(DIF,9); MACD:=(DIF-DEA)*2; AA:=CROSS(DIF,DEA) AND DEA>0; BB:=BARSLAST(CROSS(DEA,DIF)) AND DEA>0; CC:=REF(BARSLAST(CROSS(DIF,0))<20,BARSLAST(CROSS(DEA,DIF))+1); XG:AA AND BB AND CC;