虽说大家很多人都会用此指标,但我加上了一些信号,作为副图参考,也花了一些心思,但信号出现时也请看个股是在什么价处,
虽是第一次整合,但看上去还行的,给大家用用,{逃法,只要是MDI小于PDI时,股价在高位处,ADX向下死叉ADXR,后遇PDI又死叉MDI那你最好是先出来再说,等到PDI再次在20上方金叉MDI时再进也不迟,
信号过多,因为是初级版,有不好之处也请各位老师修改;
{闲鹤QL-DMI}
{N:=7;}
TR:=SMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),
ABS(LOW-REF(CLOSE,1))),N,1);
HD:=HIGH-REF(HIGH,1);
LD:=REF(LOW,1)-LOW;
DMP:=SMA(IF(HD>0 AND HD>LD,HD,0),N,1);
DMM:=SMA(IF(LD>0 AND LD>HD,LD,0),N,1);
PDI:DMP*100/TR,COLORWHITE;
MDI:DMM*100/TR,COLORYELLOW;
ADX:SMA(ABS(MDI-PDI)/(MDI+PDI)*100,N,1),COLORFF66FF;
ADXR:(ADX+REF(ADX,7))/2,COLOR66FF66;
超买1:=REF(ADXR,2)>REF(ADX,2) AND REF(ADX,2)>REF(PDI,2) AND
(REF(MDI,1)>REF(PDI,1) OR REF(MDI,1)>REF(ADX,1))
AND (CROSS(PDI,MDI) AND CROSS(PDI,ADX) AND CROSS(PDI,ADXR) AND
CROSS(ADX,ADXR)) AND ADX>REF(ADX,1) AND ADXR>REF(ADXR,1) AND (MDI<20 AND PDI>20);
超买D2:=(REF(ADXR,2)>REF(ADX,2) AND REF(ADX,2)>REF(MDI,2)) AND
(EXIST(CROSS(PDI,MDI),4) AND EXIST(CROSS(PDI,ADX),4) AND
EXIST(CROSS(PDI,ADXR),4) AND PDI>ADX) AND REF(ADXR,1)>REF(ADX,1) AND PDI>REF(PDI,1)
AND PDI>MDI AND ADX>REF(ADX,1) AND CROSS(ADX,ADXR) AND (MDI<20 AND PDI>20);
超买D3:=(EXIST(CROSS(PDI,MDI),4) AND EXIST(CROSS(PDI,ADX),4) AND
EXIST(CROSS(PDI,ADXR),4) AND EXIST(CROSS(ADX,MDI),3)) AND PDI>ADX AND ADX>ADXR AND
CROSS(ADXR,MDI) AND (MDI<20 AND PDI>20);
超买5:=((PDI>MDI AND MDI<20 AND ADX>20 AND PDI>20) AND REF(PDI,1)<REF(ADXR,1)
AND (ADX>REF(ADX,1) AND ADXR>REF(ADXR,1) AND PDI>REF(PDI,1) AND MDI<REF(MDI,1)))
AND ((CROSS(PDI,ADX) AND CROSS(PDI,ADXR)) OR CROSS(ADX,ADXR));
超买6:=((REF(PDI,1)>REF(MDI,1) OR CROSS(REF(PDI,1),REF(MDI,1))) AND REF(ADXR,1)>REF(ADX,1) AND
ADX>REF(ADX,1)) AND PDI>REF(PDI,1) AND PDI>ADX AND MDI<REF(MDI,1) AND
CROSS(ADX,ADXR) AND (MDI<20 AND PDI>20);
超买7:=(REF(MDI,1)>REF(ADX,1) AND MDI<REF(MDI,1)) AND ((EXIST(CROSS(PDI,ADX),2) AND EXIST(CROSS(PDI,ADX),2))
OR EXIST(CROSS(PDI,MDI),2)) AND (CROSS(PDI,MDI) AND CROSS(ADX,MDI) AND CROSS(ADXR,MDI))
AND (MDI<20 AND PDI>20);
短线买:IF(超买1 OR 超买D2 OR 超买D3 OR 超买5 OR 超买6 OR 超买7,30,5),COLORMAGENTA;
IF((ADX>=REF(ADX,1) AND PDI>20 AND PDI>MDI),ADX,DRAWNULL),COLORRED,LINETHICK1;
选股如下:
{闲鹤QL-DMI}
{N:=7}
TR:=SMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),N,1);
HD:=HIGH-REF(HIGH,1);
LD:=REF(LOW,1)-LOW;
DMP:=SMA(IF(HD>0 AND HD>LD,HD,0),N,1);
DMM:=SMA(IF(LD>0 AND LD>HD,LD,0),N,1);
PDI:=DMP*100/TR,COLORWHITE;
MDI:=DMM*100/TR,COLORYELLOW;
ADX:=SMA(ABS(MDI-PDI)/(MDI+PDI)*100,N,1),COLORFF66FF;
ADXR:=(ADX+REF(ADX,7))/2,COLOR66FF66;
超买1:=REF(ADXR,2)>REF(ADX,2) AND REF(ADX,2)>REF(PDI,2) AND
(REF(MDI,1)>REF(PDI,1) OR REF(MDI,1)>REF(ADX,1))
AND (CROSS(PDI,MDI) AND CROSS(PDI,ADX) AND CROSS(PDI,ADXR) AND
CROSS(ADX,ADXR)) AND ADX>REF(ADX,1) AND ADXR>REF(ADXR,1) AND (MDI<20 AND PDI>20);
超买D2:=(REF(ADXR,2)>REF(ADX,2) AND REF(ADX,2)>REF(MDI,2)) AND
(EXIST(CROSS(PDI,MDI),4) AND EXIST(CROSS(PDI,ADX),4) AND
EXIST(CROSS(PDI,ADXR),4) AND PDI>ADX) AND REF(ADXR,1)>REF(ADX,1) AND PDI>REF(PDI,1)
AND PDI>MDI AND ADX>REF(ADX,1) AND CROSS(ADX,ADXR) AND (MDI<20 AND PDI>20);
超买D3:=(EXIST(CROSS(PDI,MDI),4) AND EXIST(CROSS(PDI,ADX),4) AND
EXIST(CROSS(PDI,ADXR),4) AND EXIST(CROSS(ADX,MDI),3)) AND PDI>ADX AND ADX>ADXR AND
CROSS(ADXR,MDI) AND (MDI<20 AND PDI>20);
超买5:=((PDI>MDI AND MDI<20 AND ADX>20 AND PDI>20) AND REF(PDI,1)<REF(ADXR,1)
AND (ADX>REF(ADX,1) AND ADXR>REF(ADXR,1) AND PDI>REF(PDI,1) AND MDI<REF(MDI,1)))
AND ((CROSS(PDI,ADX) AND CROSS(PDI,ADXR)) OR CROSS(ADX,ADXR));
超买6:=((REF(PDI,1)>REF(MDI,1) OR CROSS(REF(PDI,1),REF(MDI,1))) AND REF(ADXR,1)>REF(ADX,1) AND
ADX>REF(ADX,1)) AND PDI>REF(PDI,1) AND PDI>ADX AND MDI<REF(MDI,1) AND
CROSS(ADX,ADXR) AND (MDI<20 AND PDI>20);
超买7:=(REF(MDI,1)>REF(ADX,1) AND MDI<REF(MDI,1)) AND ((EXIST(CROSS(PDI,ADX),2) AND EXIST(CROSS(PDI,ADX),2))
OR EXIST(CROSS(PDI,MDI),2)) AND (CROSS(PDI,MDI) AND CROSS(ADX,MDI) AND CROSS(ADXR,MDI))
AND (MDI<20 AND PDI>20);
短线买:=IF(超买1 OR 超买D2 OR 超买D3 OR 超买5 OR 超买6 OR 超买7,30,5),COLORMAGENTA;
牛股起动:短线买=30;
|