通达信DMI2指标公式
2020/6/11 18:35:31
L60:60,COLORGREEN,POINTDOT;
L20:20,COLORGRAY;
L30:30,COLORGRAY,DOTLINE;
N:=14;
MM:=4;{可以自行修改,通达信里面的是6}
{成交量}
TOTAL:=IF(PERIOD=1,5,IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,240,1)))));
MTIME:=MOD(FROMOPEN,TOTAL);
CTIME:=IF(MTIME<0.5,TOTAL,MTIME);
预测:=IF(CURRBARSCOUNT=1,VOL*TOTAL/CTIME,DRAWNULL);
成交量1:=预测>=REF(V,1) OR V>=REF(V,1);
MTR:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N);
HD :=HIGH-REF(HIGH,1);
LD :=REF(LOW,1)-LOW;
DMP:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),N);
DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),N);
PDI: DMP*100/MTR,LINETHICK2,COLORWHITE;
MDI: DMM*100/MTR,LINETHICK1,COLORYELLOW;
IF(PDI>=MDI, PDI,DRAWNULL),LINETHICK2,COLORRED;
ADX: EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,MM),COLORMAGENTA,DOTLINE;
ADXR:EXPMEMA(ADX,MM),COLORGREEN,DOTLINE;
强势出关:=COUNT("KDJ.J"<0,4)>=3 AND 100*(WINNER(C)-WINNER(O))>15 AND 成交量1;
STICKLINE(强势出关,20,40,1,0),COLORGREEN;
{BAIS买入}
BIAS5:=(C-MA(C,6))/MA(C,6)*100;
BIAS6:=(C-MA(C,12))/MA(C,12)*100;
BIAS7:=(C-MA(C,24))/MA(C,24)*100;
BIAS8:=(BIAS5+2*BIAS6+3*BIAS7)/6;
乖离:=MA(BIAS8,6);
STICKLINE(CROSS(BIAS8,乖离) AND 乖离<-9,20,35,1,0),COLORRED;
{底部私募买点}
趋势:=3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1);
见底:=10;
短期底部:=CROSS(趋势,见底);
VAR1:=(2*CLOSE+HIGH+LOW)/4;
VAR2:=LLV(LOW,34);
VAR3:=HHV(HIGH,34);
近:=EMA((VAR1-VAR2)/(VAR3-VAR2)*100,13);
远:=EMA(0.667*REF(近,1)+0.333*近,2) , ;
选股:=IF(CROSS(近,远) AND 近<20 ,30,0) AND 成交量1;
STICKLINE(短期底部 AND 选股,20,30,1,0),COLORYELLOW;
{超级RSI++}
TJ1:=(C-LLV(LOW,18))/(HHV(HIGH,18)-LLV(LOW,18))*100;
TJF:=SMA(TJ1,13,8);
卖出:=CROSS(TJF,89);
STICKLINE(卖出,60,55,1,0),COLORGREEN;
{CCI背离,上穿-100}
DD:=C=LLV(C,60);{60日最低点}
DDSJ:=BARSLAST(REF(DD,1));{上一低点时间}
DDGJ:=REF(CLOSE,DDSJ+1)>CLOSE;{股价趋势}
GD:=C=HHV(C,60);{60日最高点}
GDSJ:=BARSLAST(REF(GD,1));{上一高点时间}
GDGJ:=REF(CLOSE,GDSJ+1)<CLOSE;{股价趋势}
TYP:=(HIGH + LOW + CLOSE)/3;
CCI:=(TYP-MA(TYP,60))/(0.015*AVEDEV(TYP,60));
CDZB:=REF(CCI,DDSJ+1)<CCI;{CCI指标趋势}
CCI底背离:=DDGJ AND CDZB;
TYP1:=(HIGH+LOW+CLOSE)/3;{系统CCI}
CCI1:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));{系统CCI}
CCI买点:=COUNT(CCI底背离,7)>=1 AND CROSS(CCI1,-100) AND 成交量1;
STICKLINE(CCI买点,20,25,1,0),COLORMAGENTA;
红色BIAS:0,COLORRED,NODRAW;
绿色强势出关:0,COLORGREEN,NODRAW;
黄色底部私募:0,COLORYELLOW,NODRAW;
洋红CCI买点:0,COLORMAGENTA,NODRAW;
投股票 网 www .tou18.cn
股市公式下载推荐