关于dmi指标公式源码内容导航:
1、dmi指标公式源码
DMI指标公式源码:
// DMI指标
// 计算PDI
PDI:=EMA(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),N1)/EMA(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),N1)*100;
// 计算MDI
MDI:=EMA(MAX(HIGH-LOW,ABS(LOW-REF(CLOSE,1))),N2)/EMA(MAX(HIGH-LOW,ABS(LOW-REF(CLOSE,1))),N2)*100;
// 计算ADX
ADX:=MA(ABS(MDI-PDI)/(MDI+PDI)*100,M);
// 计算ADXR
ADXR:=MA(ADX,M);
// 计算DMI
DMI:=IF(ADX>ADXR,MDI,-PDI);
2、dmi指标公式源码改良
来自"dmi.adx">50 and "dmi.adx"-"dmi.pdi">40;{试试看}
3、dmi指标公式源码1986年
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)<20;
ADX:=(EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,6))<20;
CROSS(ADX,MDI);