急求:帮忙把趋向指标(钱龙版本)DMI—QL,给改写成通达信...1
发布网友
发布时间:2023-11-26 19:04
我来回答
共2个回答
热心网友
时间:2024-08-30 00:11
N:=14;
M:=6;
VV:=SMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),N,1);
HD:=HIGH-REF(HIGH,1);
LD:=REF(LOW,1)-LOW;
DMP:=SMA(IF(HD>0 AND HD>LD,HD,0),N,1);
DMM:=SMA(IF(LD>0 AND LD>HD,LD,0),N,1);
PDI:DMP*100/VV;
MDI:DMM*100/VV;
ADX:SMA(ABS(MDI-PDI)/(MDI+PDI)*100,N,1);
ADXR:(ADX+REF(ADX,M))/2;
{已测试,复制可直接引用,如果回答满意,请记得给采纳}
热心网友
时间:2024-08-30 00:13
{N和M自己填在参数里,并赋值,如果不准备修改,你也可以把下边公式中所有N改成14,M改成6}
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
DMP:= SMA(IF(HD>0 AND HD>LD,HD,0),N,1);
DMM:= SMA(IF(LD>0 AND LD>HD,LD,0),N,1);
PDI: DMP*100/SMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),N,1);
MDI: DMM*100/SMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),N,1);
ADX: SMA(ABS(MDI-PDI)/(MDI+PDI)*100,N,1);
ADXR:(ADX+REF(ADX,M))/2;