1、趋向XDMI指标,有用法精解 自用多年趋向指标 {趋向XDMI} {60,DOTLINE,COLORMAGENTA; 30,DOTLINE,COLORMAGENTA; 15,DOTLINE,COLORMAGENTA;} TTR:=EMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),14); HD :=HIGH-REF(HIGH,1); LD :=REF(LOW,1)-LOW; DMP:=EMA(IF(HD>0 AND HD>LD,HD,0),14); DMM:=EMA(IF(LD>0 AND LD>HD,LD,0),14); PDI:DMP*100/TTR,COLORRED,NODRAW; MDI:DMM*100/TTR,COLORBLUE,NODRAW; STICKLINE(PDI>MDI,MDI,PDI,2,1),COLOR000088; STICKLINE(PDI<=MDI,MDI,PDI,2,1),COLORBLUE; STICKLINE(PDI>MDI AND MDI<15 AND PDI<15,PDI,MDI,2,0),COLORRED; STICKLINE(PDI<MDI AND MDI<15 AND PDI<15,PDI,MDI,2,0),COLORBLUE; STICKLINE(PDI>MDI AND PDI>30 AND MDI>30,MDI,PDI,2,0),COLORRED; STICKLINE(PDI<MDI AND PDI>30 AND MDI>30,MDI,PDI,2,0),COLORBLUE; STICKLINE(PDI>MDI AND PDI>30 AND MDI<30,30,PDI,2,0),COLORRED; STICKLINE(PDI>MDI AND PDI>15 AND MDI<15,15,MDI,2,0),COLORRED; STICKLINE(PDI<MDI AND MDI>30 AND PDI<30,30,MDI,2,0),COLORBLUE; STICKLINE(PDI<MDI AND MDI>15 AND PDI<15,15,PDI,2,0),COLORBLUE; STICKLINE(CROSS(MDI,PDI),PDI,MDI,2,0),COLORCYAN; STICKLINE(CROSS(MDI,30) AND PDI<MDI AND PDI<30,MDI,30,2,0),COLORCYAN; STICKLINE(CROSS(MDI,30) AND PDI<MDI AND PDI>30,PDI,MDI,2,0),COLORCYAN; STICKLINE(PDI<MDI AND CROSS(15,PDI) AND MDI>15,15,PDI,2,0),COLORCYAN; STICKLINE(PDI<MDI AND CROSS(15,PDI) AND MDI<15,PDI,MDI,2,0),COLORCYAN; STICKLINE(CROSS(PDI,MDI),PDI,MDI,2,0),COLOR0055FF; STICKLINE(CROSS(PDI,30) AND PDI>MDI AND MDI<30,PDI,30,2,0),COLOR0055FF; STICKLINE(CROSS(PDI,30) AND PDI>MDI AND MDI>30,PDI,MDI,2,0),COLOR0055FF; STICKLINE(PDI>MDI AND CROSS(15,MDI) AND PDI>15,15,MDI,2,0),COLOR0055FF; STICKLINE(PDI>MDI AND CROSS(15,MDI) AND PDI<15,PDI,MDI,2,0),COLOR0055FF; ADX: EMA(ABS(MDI-PDI)/(MDI+PDI)*100,6),COLORWHITE; ADXR:EMA(ADX,6),COLORYELLOW; 用法精解: 1)强的上升趋势(牛市): PDI > MDI 和 ADX≥ 30 ――走势有创新高的价格时,PDI上升,MDI下降。即若PDI金叉MDI显示买进信号。 (2)强的下降趋势(熊市):PDI < MDI 和 ADX≥ 30 ――当MDI“金叉”PDI时,显示市场有新的空头卖出,因此为卖出信号。( 顶尖财经 股票学院: http://58188.com ) 当走势维持某种趋势时,PDI和MDI的交叉信号相当准确。(牛皮盘档时交叉则无效。) 当行情朝单方向发展时,无论涨跌势,ADX都会不断递增,当ADX大于上日,可以判断当前行情维持原势。特别是当PDA和ADX,或MDI和ADX同向上升时,表示当前涨或跌的趋势十分强劲。即ADX值若从高点转跌时,就将转势。 (3)略牛的盘整期:PDI > MDI 和 16 < ADX < 30 (4)略熊的盘整期:PDI < MDI 和16 < ADX < 30。 (5)静寂期: ADX ≤16和(PDI > MDI 或 PDI < MDI) 。 (6)在牛市ADX越大越强,但是大于60就要注意了,牛市将可能要回调。 上面的PDI你可理解成牛的力量;MDI理解成熊的力量;而ADX理解成牛熊力量对比的度量没有方向性。 2、财神爷抄底副图公式 财神爷,图标好看,大吉大利。( 顶尖财经 股票学院: http://58188.com ) {财神爷抄底} HIGHN:=12;P:=9;N1:=7; LC:=REF(CLOSE,1); RSI1:SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100,COLORWHITE; AA:=REF(RSI1,HIGHN)=HHV(RSI1,2*HIGHN+1); QY:=BACKSET(AA,HIGHN+1); CC:=FILTER(QY,HIGHN) AND RSI1=HHV(RSI1,HIGHN+1); DDD:=BARSLAST(CC); GDTS:=IF(CC,CURRBARSCOUNT,0); DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS); GDCS1:=CONST(DINGBUTS); DINGBUTS1:=REF(DINGBUTS,DDD+1); GDCS2:=CONST(DINGBUTS1); AA1:=REF(RSI1,HIGHN)=LLV(RSI1,2*HIGHN+1); QY1:=BACKSET(AA1,HIGHN+1); CC1:=FILTER(QY1,HIGHN) AND RSI1=LLV(RSI1,HIGHN+1); DD1:=BARSLAST(CC1); DDTS:=IF(CC1,CURRBARSCOUNT,0); DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS); DDCS1:=CONST(DDTS1); DDTS2:=REF(DDTS1,DD1+1); DDCS2:=CONST(DDTS2); A1:=REF(RSI1,P)=HHV(RSI1,2*P+1); B1:=FILTER(A1,P); C1:=BACKSET(B1,P+1); D1:=FILTER(C1,P); A2:=REF(RSI1,P)=LLV(RSI1,2*P+1); B2:=FILTER(A2,P); C2:=BACKSET(B2,P+1); D2:=FILTER(C2,P); R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1); S11:=R11>REF(R11,1); T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1); U11:=T11>REF(T11,1); MID:=MA(RSI1,20); UPPER:=MID + 2*STD(RSI1,20); LOWER:=MID - 2*STD(RSI1,20); 高:=REF(HHV(RSI1,360),1); 低:=REF(LLV(RSI1,240),1); BIAS1:=(C-MA(C,6))/MA(C,6)*100; BIAS2:=(C-MA(C,12))/MA(C,12)*100; BIAS3:=(C-MA(C,24))/MA(C,24)*100; BIAS:=(BIAS1+2*BIAS2+3*BIAS3)/6; 乖离:=MA(BIAS,6); 前高:REF(RSI1,BARSLAST(D1)),COLORFF00FF,NODRAW; 前低:REF(RSI1,BARSLAST(D2)),COLOR00FF00,NODRAW; 相对能量:(RSI1-前低)/(前高-前低)*100,COLORYELLOW,NODRAW; 上轨:UPPER,COLOR993300; 下轨:LOWER,COLOR993300; DRAWICON(CC,RSI1*1.03,2); DRAWICON(CC1,RSI1*0.97,1); 高压:DRAWLINE(CURRBARSCOUNT=GDCS2,RSI1,CURRBARSCOUNT=GDCS1,RSI1,1) ,COLORBLUE,POINTDOT,LINETHICK4; 低支:DRAWLINE(CURRBARSCOUNT=DDCS2,RSI1,CURRBARSCOUNT=DDCS1,RSI1,1) ,COLORRED,POINTDOT,LINETHICK4; 阻力:DRAWLINE(D1,RSI1,S11,RSI1,1),COLORYELLOW; 支撑:DRAWLINE(D2,RSI1,U11,RSI1,1),COLOR00FF00; DRAWTEXT(CROSS(RSI1,LOWER),LOWER,'抄'),COLOR00FF00; DRAWTEXT(CROSS(LOWER,RSI1),LOWER,'▼'),COLOR00FF00; DRAWTEXT(CROSS(RSI1,高),MID,'年高'),COLORYELLOW; DRAWTEXT(CROSS(低,RSI1),MID,'年低'),COLORYELLOW; DRAWTEXT(CROSS(UPPER,RSI1),UPPER,'逃'),COLORYELLOW; DRAWTEXT(CROSS(RSI1,UPPER),UPPER,'▲'),COLORYELLOW; VM:MA(RSI1,N1),COLORFF00FF,NODRAW; STICKLINE(CROSS(BIAS,乖离) AND 乖离<-9,6,0,2,0),COLORRED; DRAWTEXT(ISLASTBAR AND RSI1>REF(RSI1,1),VM,' ▲'),COLORDD00FF; DRAWTEXT(ISLASTBAR AND RSI1<REF(RSI1,1),VM,' ▼'),COLORCCEE00; DRAWTEXT(CURRBARSCOUNT=60,10,' ☆ 实战☆'),COLORGREEN; 状元郎:=RSI1<=18; STICKLINE(状元郎,58,55,14,0),COLORYELLOW; STICKLINE(状元郎,57,56,12,0),COLORCYAN; STICKLINE(状元郎,45,48,4,0),COLORWHITE; STICKLINE(状元郎,53,50,9,0),COLOR0088DD; STICKLINE(状元郎,55,48,6,0),COLORLIRED; STICKLINE(状元郎,53,53,5,0),COLOR000000; STICKLINE(状元郎,52,52,3,0),COLOR000000; STICKLINE(状元郎,53,50,2,0),COLOR0077EE; STICKLINE(状元郎,53,50,1,0),COLOR0077EE; STICKLINE(状元郎,60,55,7,0),COLORRED; STICKLINE(状元郎,60,63,4,0),COLORRED; 状元献宝:IF(状元郎,58,DRAWNULL),LINETHICK4,POINTDOT,COLORGREEN; STICKLINE(状元郎,20,17,16,0),COLORWHITE; STICKLINE(状元郎,22,20,12,0),COLORYELLOW; STICKLINE(状元郎,22,17,5,0),COLORBLACK; STICKLINE(状元郎,33,22,13,0),COLORRED; STICKLINE(状元郎,46,42,18,0),COLORMAGENTA; STICKLINE(状元郎,46,31,16,0),COLORRED; STICKLINE(状元郎,41,31,12,0),COLORBROWN; STICKLINE(状元郎,41,31,11,0),COLORRED; STICKLINE(状元郎,32,31,12,0),COLORYELLOW; STICKLINE(状元郎,35,33,8,0),COLOR00AAFF; STICKLINE(状元郎,49,49,1,0),COLOR0000EE; DRAWICON(状元郎,38,9); DRAWICON(状元郎,26,29); 3、多空单波段全,波段类公式 {多空单波段全} SJ:=1; N:=15; M1:=5; M2:=3; RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K9:=SMA(RSV,M1,1); D9:=SMA(K9,M2,1); J:=3*K9-2*D9; RK:=MA(K9,15)*SJ,LINETHICK1; RD:=MA(D9,15)*SJ,LINETHICK1; RJ:=MA(J,15)*SJ,LINETHICK1; DRAWTEXT(CROSS(RK,RD)&&RD<20,RK*0.80,'多'),COLORRED; DRAWTEXT(CROSS(RD,RK)&&RD>80,78,'空'),COLORGREEN,DRAWABOVE; N8:=80; M18:=3; M28:=3; RSV8:=(CLOSE-LLV(LOW,N8))/(HHV(HIGH,N8)-LLV(LOW,N8))*100; K98:=SMA(RSV8,M18,1); D98:=SMA(K98,M28,1); J8:=3*K98-2*D98; RK8:=MA(K98,80),LINETHICK1; RD8:=MA(D98,80),LINETHICK1; RJ8:=MA(J8,80),LINETHICK1; DRAWTEXT(CROSS(RK8,RD8)&&RD8<20,RK8*0.80,'准多'),COLORFF00FF; DRAWTEXT(CROSS(RD8,RK8)&&RD8>80,78,'准空'),COLORFFFF00,DRAWABOVE; VAR1:=((CLOSE - LLV(LOW,15))/(HHV(HIGH,15) - LLV(LOW,15)))*(100); VAR2:=REVERSE(VAR1); VAR3:=SMA(VAR1,5,1); K:=SMA(VAR3,3,1); D:=SMA(K,3,1); STICKLINE((K*SJ >= D),K,D,2,0),COLORRED; STICKLINE((K <= D*SJ),K,D,2,0),COLOR008800; 超卖:20*SJ,COLOR00FF00,LINETHICK1; 超买:80*SJ,COLORRED,LINETHICK1; 严重超卖:0*SJ,COLOR00FF00,LINETHICK1; 严重超买:100*SJ,COLORRED,LINETHICK1; {中轴线:50*SJ,COLORWHITE,NODRAW;} KF:=(EMA(CLOSE,21)-EMA(CLOSE,3))/2*0.95; DF:=(EMA(CLOSE,3)-EMA(CLOSE,21))/2*0.95; DRAWTEXT(DF*SJ>=KF,9*SJ,'大'),COLORRED; DRAWTEXT(KF*SJ>DF*SJ,91,'大'),COLORCYAN; MA888:=EMA(C,2); 战士看多空线:=(MA(CLOSE,27)+MA(CLOSE,34)+MA(CLOSE,41)+MA(CLOSE,50))/4,COLOR00FFFF,LINETHICK3; DRAWTEXT(MA888*SJ>=战士看多空线,15,'中'),COLORRED; DRAWTEXT(MA888<战士看多空线*SJ,85,'中'),COLORCYAN; VAR6:=(2*CLOSE+HIGH+LOW)/4; VAR8:=LLV(LOW,20); VARAA:=HHV(HIGH,26); B:=EMA((VAR6-VAR8)/(VARAA-VAR8)*100,8); B1:=EMA(B,5); K22:=B>80 AND CROSS(B1,B); K1:=BARSLAST(K22); K2:=REF(K1,1); K底:=B<20 AND CROSS(B,B1); K底1:=BARSLAST(K底); K底2:=REF(K底1,1); DRAWTEXT(REF(B,1)*SJ>80 AND CROSS(B1,B) AND REF(B,1)<REF(B,K2+2) AND REF(C,1)>REF(C,K2+2),B+2,'顶背离'),COLORCYAN; DRAWTEXT(B<25*SJ AND CROSS(B,B1) AND B>REF(B,K底2) AND C<REF(C,K底2),B+2,'底背离'),COLORFF00FF; |