结构背离之DMI底背选股指标公式

TRR := SUM(MAX(MAX(HIGH-LOW,Abs(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14);

HD := HIGH-REF(HIGH,1);

LD := REF(LOW,1)-LOW;

PDM:= SUM(IF(HD>0 AND HD>LD,HD,0),14);

MDM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);

pdi:= PDM*100/TRR;

mdi:= MDM*100/TRR;

A4:=BArslAst(REF(crOSS(PDI,MDI),1));

B4:=REF(C,A4+1)>C AND REF(PDI,A4+1)<PDI AND CROSS(PDI,MDI);

dmi底背:B4>0;