AAA1:="DMI.PDI";
AAA2:="DMI.ADX";
AAA1>REF(AAA1,1) AND AAA1>30 AND AAA2>30;
测试合格!
为了更好看出你的要求 我改了DMI指标 把PDI 和ADX 线加粗2倍,增加30的线 你另外加个名字吧 叫DMI 优化
MTR:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N);
HD :=HIGH-REF(HIGH,1);
LD :=REF(LOW,1)-LOW;
DMP:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),N);
DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),N);
PDI: DMP*100/MTR, LINETHICK2;
MDI: DMM*100/MTR;
ADX: EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,MM) ,LINETHICK2;
ADXR:EXPMEMA(ADX,MM);
AAA8:30;
选股选出20个 还不错
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;
ADX:=EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,6);
ADXR:=EXPMEMA(ADX,6);
IF(PDI>REF(PDI,1),PDI,0) AND PDI>=30 AND IF(ADX>REF(ADX,1),ADX,0) AND ADX>=30;
你的这个选股条件有毛病,你自己观察一下各个个股每当在底部区间时,PDI和ADX各处于什么状态。
MTR:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N);
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;
ADX:=EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,6);
PDI>30 AND ADX>30 AND REF(PDI,1)REF(PDI,1);