编写要求:
通达信自带的DMI趋向指标,其中MDI数值小于等于13选股。
www.gszx.com.cn网解答:
N:=14;
MTR:=SUM(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;
DMM:=SUM(IF(LD>0&&LD>HD,LD,0),N);
MDI:=DMM*100/MTR;
XG:MDI<=13;