经典DMI优化指标(源码及用法)介绍
经典DMI优化指标(源码及用法)
源码:
{N 3 2 90 1
M 2 2 60 1}
TR:=MEMA(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:=MEMA(IF(HD>0 AND HD>LD,HD,0),N);
DMM:=MEMA(IF(LD>0 AND LD>HD,LD,0),N);
PDI: DMP*100/TR;
MDI: DMM*100/TR;
ADX: MEMA(ABS(MDI-PDI)/(MDI+PDI)*100,M);
ADXR:MEMA(ADX,M);
FILLRGN(PDI,MDI,PDI>MDI,rgb(220,30,60),PDI<MDI,rgb(220,220,0));
FILLRGN(ADX,ADXR,ADX>ADXR,rgb(220,100,60),ADX<ADXR,rgb(40,120,60));
用法:PDI>MDI,ADX>ADXR时买入,再配合CCI更为准确。当PDI.MDI金叉时必须ADX>ADXR,缺一不可!
附图:
gd16144