编写条件:
编写方法:
网友求助:
TRA:=EMA(MAX(MAX(HIGH-LOW,Abs(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),3);
HD:=HIGH-REF(HIGH,1);
LD:=REF(LOW,1)-LOW;
DMP:=EMA(IF(HD>0&&HD>LD,HD,0),3);
DMM:=EMA(IF(LD>0&&LD>HD,LD,0),3);
pdi:=DMP*100/TRA;
mdi:=DMM*100/TRA;
ADX:=EMA(ABS(MDI-PDI)/(MDI+PDI)*100,2);
OK:PDI<1 AND ADX>90;
解答如下:
TRA:=EMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),3);
HD:=HIGH-REF(HIGH,1);
LD:=REF(LOW,1)-LOW;
DMP:=EMA(IF(HD>0&&HD>LD,HD,0),3);
DMM:=EMA(IF(LD>0&&LD>HD,LD,0),3);
PDI:=DMP*100/TRA;
MDI:=DMM*100/TRA;
ADX:=EMA(ABS(MDI-PDI)/(MDI+PDI)*100,2);
OK:=PDI<1 AND ADX>90;
OK=1;