通达信狄马克副图指标源码如下:
通达信狄马克副图指标
TD-DMKI
N(13,1,100);
DMH:=SUM(IF(H>REF(H,1),H-REF(H,1),0),N);
DML:=SUM(IF(L>REF(L,1),0,REF(L,1)-L),N);
DMKI:DMH/(DMH+DML);
0.75;
0.5;
0.25;
TD-DMKII
N(8,1,100);
DMKH:=SUM(IF(H-REF(C,1)>0,(H-REF(C,1))+(C-L),C-L),N);
DMKM:=SUM(IF(REF(C,1)-L>0,(REF(C,1)-L)+(H-C),H-C),N);
DMKII:DMKH/(DMKH+DMKM);
0.6;
0.5;
0.4;
TD-REI
N(8,1,100);
DIF1:=H-REF(H,2);
DIF2:=L-REF(L,2);
NUM1:=IF(REF(H,2)< REF(C,7) AND REF(H,2)< REF(C,8) AND H<REF(L,5) AND H< REF(L,6), 0,1);
NUM2:=IF(REF(L,2)>REF(C,7) AND REF(L,2)>REF(C,8) ANDL>REF(H,5) AND L>REF(H,6), 0,1);
REI1:=(DIF1+DIF2)*NUM1*NUM2;
REI2:=ABS(DIF1)+ABS(DIF2);
REI:SUM(REI1,N)/SUM(REI2,N);
0.4;
0;
-0.4;