在DMI指标里加一个金叉的箭头
更多金钻指标股票技术讨论QQ群:966329692 技术讨论QQ群:220302856 技术讨论QQ群:39652085 如群满可换一个

编写要求:

解答:

 网友求助:

TR:=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/TR,COLORRED;
MDI:DMM*100/TR,COLORYELLOW;
ADX:SMA(ABS(MDI-PDI)/(MDI+PDI)*100,N,1),COLORGREEN;
ADXR:=(ADX+REF(ADX,6))/2,COLOR66FF66;
DRAWTEXT(CROSS(PDI,MDI)AND PDI>ADX,PDI,'火箭');
DRAWTEXT(CROSS(MDI,PDI)AND MDI>ADX,MDI,'炸弹');

条件:PDI上穿MDI的地方加一个红箭头,MDI死叉PDI加一个绿色的箭头,谢谢了
 

 
解答如下:
TR:=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/TR,COLORRED;
MDI:DMM*100/TR,COLORYELLOW;
ADX:SMA(ABS(MDI-PDI)/(MDI+PDI)*100,N,1),COLORGREEN;
ADXR:=(ADX+REF(ADX,6))/2,COLOR66FF66;
DRAWTEXT(CROSS(PDI,MDI)AND PDI>ADX,PDI,'火箭');
DRAWTEXT(CROSS(MDI,PDI)AND MDI>ADX,MDI,'炸弹');
DRAWICON(CROSS(PDI,MDI),PDI,1);
DRAWICON(CROSS(MDI,PDI),PDI,2);
 

 


选股票看什么指标最好 >股票指标网