通达信DMI和MACD同时金叉的选股公式
MTR:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),14);
HD:=HIGH-REF(HIGH,1);
LD:=REF(LOW,1)-LOW;
DMP:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),14);
DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),14);
PDI:=DMP*100/MTR;
MDI:=DMM*100/MTR;
XG:=CROSS(PDI,MDI);
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
OK:=CROSS(DIF,DEA);
ZQ:XG AND OK;