源码如下:
{DMI新花样}
N:=30;M:=6;
TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),N);
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
DMP:= SUM(IF(HD>0 AND HD>LD,HD,0),N);
DMM:= SUM(IF(LD>0 AND LD>HD,LD,0),N);
PDI:DMP*100/TR,colorwhite,linethick2;
MDI:DMM*100/TR,coloryellow;
A:(PDI+MDI)/2,COLOR0000FF;
AA:(PDI-MDI)/2,COLOR00FF00;
IF(AA>0 AND AA>REF(AA,1),AA,0),STICK,COLOR00FF00;
IF(AA<0 AND AA>REF(AA,1),AA,0),STICK,COLORffffff;
V0:0,COLORFFA2AF;
V10:10,COLORFFA2AF,pointdot;
V20:20,COLORFFA2AF,pointdot;
V40:40,COLORff99ff,pointdot;
V50:50,COLORred,pointdot;
{DMI用法:
市场行情趋向明显时,指标效果理想。
PDI(上升方向线)(白线),MDI(下降方向线)(黄线);
1.PDI线从下向上突破MDI线,显示有新多头进场,为买进信号;
2.PDI线从上向下跌破MDI线,显示有新空头进场,为卖出信号;
3.PDI线从0-20无行情,也是底部区;
4。PDI线从40-50强行情,也是顶部区;
5.绿柱是多头行情,白柱是反弹行情;}
|
|
|
|
|