DMI按此思路如何编写预警公式
2019/12/5 18:48:28
公式编写说明:
预警公式条件:第一、PDI大于ADX且同时大于ADXR和MDI;第二、ADX上穿ADXR成金叉第三、PDI数值大于25;以上条件同时满足的预警公式,望解答。DMI源码如下:参数:N= 2 90 14 M= 2 60 6TR:=EXPMEMA(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:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),N);DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),N);PDI: DMP*100/TR;MDI: DMM*100/TR;ADX: EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,M);ADXR:EXPMEMA(ADX,M);
公式源码回答:
N:=14;M:=6;
TR1:=EXPMEMA(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:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),N);
DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),N);
PDI:=DMP*100/TR1;
MDI:=DMM*100/TR1;
ADX:=EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,M);
ADXR:=EXPMEMA(ADX,M);
XG:PDI>MDI AND PDI>ADX AND PDI>ADXR AND CROSS(ADX,ADXR) AND PDI>25;
投股票 网 www.tou18. cn
股市公式下载推荐