《通达信MACDKDJ多项共振指标公式.docx》由会员分享,可在线阅读,更多相关《通达信MACDKDJ多项共振指标公式.docx(9页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、通达信MACDKDJ多项共振指标公式_正点财经MACDZ:=8*(DIFZ-DEAZ);RSV:=(CLOSE-LLV(LOW,21)/(HHV(HIGH,21)-LLV(LOW,21)*247.2-123.6;SQX:=(C-MA(CLOSE,13)*10;DIF:=EMA(MA(SQX,7),1);DEA:=EMA(DIF,7);MACD:=(DIF-DEA)*2;STICKLINE(MACD0ANDMACDREF(MACD,1),MACD,0,0.1,0),COLORRED;STICKLINE(MACD0ANDMACDREF(MACD,1),MACD,0,0.1,0),COLORWHIT
2、E;STICKLINE(MACD0ANDMACDREF(MACD,1),MACD,0,0.1,0),COLORBLUE;STICKLINE(MACD0ANDMACDREF(MACD,1),MACD,0,0.1,0),COLORBROWN;K:SMA(SMA(RSV,3,1),3,1),COLORWHITE;D:MA(EMA(K,3),3),COLORYELLOW;J:3*K-2*D,COLORMAGENTA;A11:=BARSLAST(REF(CROSS(DIF,DEA),1);B1:=REF(C,A11+1)CANDREF(DIF,A11+1)DIFANDCROSS(DIF,DEA);A12
3、:=BARSLAST(REF(CROSS(KDJ.K,KDJ.D),1);B2:=REF(C,A12+1)CANDREF(KDJ.K,A12+1)KDJ.KANDCROSS(KDJ.K,KDJ.DA13:=BARSLAST(REF(CROSS(RSI.RSI1,RSI.RSI2),1);B3:=REF(C,A13+1)CANDREF(RSI.RSI1,A13+1)RSI.RSI1ANDCROSS(RSI.RSI1,RSI.RSI2C1:=BARSLAST(REF(CROSS(DEA,DIF),1);D1:=REF(C,C1+1)CANDREF(DIF,C1+1)DIFANDCROSS(DEA,
4、DIF);C2:=BARSLAST(REF(CROSS(KDJ.D,KDJ.K),1);D2:=REF(C,C2+1)CANDREF(KDJ.K,C2+1)KDJ.KANDCROSS(KDJ.D,KDJ.KC3:=BARSLAST(REF(CROSS(RSI.RSI2,RSI.RSI1),1);D3:=REF(C,C3+1)CANDREF(RSI.RSI1,C3+1)RSI.RSI1ANDCROSS(RSI.RSI2,RSI.RSI1MACD底背:IF(B10,50,0),LINETHICK2,COLORRED;DRAWTEXT(B10,50,M底背),COLORRED;KDJ底背:IF(B2
5、0,65,0),LINETHICK2,COLORFF00FF;DRAWTEXT(B20,65,K底背),COLORFF00FF;RSI底背:IF(B30,80,0),LINETHICK2,COLORYELLOW;DRAWTEXT(B30,80,R底背),COLORYELLOW;MACD顶背:IF(D10,-50,0),LINETHICK2,COLOR00FF00;DRAWTEXT(D10,-50,M顶背),COLOR00FF00;KDJ顶背:IF(D20,-65,0),LINETHICK2,COLORFFCC66;DRAWTEXT(D20,-65,K顶背),COLORFFCC66;RSI顶背:
6、IF(D30,-80,0),LINETHICK2,COLORWHITE;DRAWTEXT(D30,-80,R顶背),COLORWHITE;DRAWICON(CROSS(K,D)ANDK0),REF(K,1),11);DRAWICON(CROSS(D,K)ANDK0),D*1.05,12);DRAWICON(J(REF(J,1)ANDK(REF(K,1)ANDD(REF(D,1)ANDJ0),REF(J,1),2);DRAWICON(JREF(J,1)ANDKREF(K,1)ANDDREF(D,1)ANDJ0,REF(J,1),1);DRAWICON(MACDREF(MACD,1)ANDREF(
7、MACD,1)REF(MACD,2)ANDMACD0,MACD,2);DRAWICON(MACDREF(MACD,1)ANDREF(MACD,1)REF(MACD,2)ANDMACD=0,MACD,1);多方趋势:(7)*(SMA(CLOSE-LLV(LOW,27)/(HHV(HIGH,27)-LLV(LOW,27)*(30),4,1)-(3)*(SMA(SMA(CLOSE-LLV(LOW,27)/(HHV(HIGH,27)-LLV(LOW,27)*(30),4,1),3,1)-SMA(SMA(SMA(CLOSE-LLV(LOW,27)/(HHV(HIGH,27)-LLV(LOW,27)*(3
8、0),4,1),3,1),2,1),COLOR0000FF;空方趋势:(EMA(MA(多方趋势,5),7),COLORF0F000;STICKLINE(多方趋势78)AND(多方趋势=空方趋势),78,多方趋势,5,1),COLOR00FF00;STICKLINE(空方趋势=多方趋势),空方趋势,多方趋势,3,0),COLOR0000FF;STICKLINE(空方趋势多方趋势),多方趋势,空方趋势,3,0),COLORF0F000;STICKLINE(空方趋势14)AND(空方趋势多方趋势),多方趋势,20,3,0),COLOR00FFFF;TJ:=FILTER(空方趋势14)AND(空方趋势
9、多方趋势),6);DRAWTEXT(TJ,40,低吸),COLORFFFFFF;斋主:(空方趋势12)AND(空方趋势=多方趋势),COLOR00FFFF;选金股:CROSS(多方趋势,空方趋势)AND(空方趋势22),COLOR0000FF;E:=CROSS(83,RSI);STICKLINE(E,75,85,4,0),COLOR00FF00;DRAWTEXT(E,72,逃顶LC:=REF(CLOSE,1);RSI5:=(SMA(MAX(CLOSE-LC),0),5,1)/SMA(ABS(CLOSE-LC),5,1)*100);TR1:=SUM(MAX(MAX(HIGH-LOW),ABS(H
10、IGH-REF(CLOSE,1),ABS(LOW-REF(CLOSE,1),10);HD:=(HIGH-REF(HIGH,1);LD:=(REF(LOW,1)-LOW);DMP:=SUM(IF(HD0)AND(HDLD),HD,0),10);DMM:=SUM(IF(LD0)AND(LDHD),LD,0),10);PDI:=(DMP*100)/TR1);MDI:=(DMM*100)/TR1);ADX:=MA(ABS(MDI-PDI)/(MDI+PDI)*100),5);AV:=(RSI5+ADX);DXR:=(ADX+REF(ADX,5)/2)+RSI5);WR10:=(100*(HHV(HIG
11、H,10)-CLOSE)/(HHV(HIGH,10)-LLV(LOW,10);NEWVOL:=(RSI5-WR10);最佳买入:=(AV+NEWVOL);最佳买入选股:IF(CROSS(最佳买入,0),61,0),STICK,COLORRED,LINETHICK4;DRAWTEXT(CROSS(最佳买入,0),62,最佳买入),COLOR00FFFF;AA:=(MA(C,1)+MA(C,3)+MA(C,5)+MA(C,7)+MA(C,9)/5;BB:=(MA(C,2)+MA(C,4)+MA(C,6)+MA(C,8)+MA(C,10)/5;CC:=EMA(AA,2);DD:=EMA(BB,5);
12、TJ0:=CROSS(CC,DD);上:=EMA(C,3);中:=EMA(C,5);下:=EMA(中,5);TJ1:=CROSS(上,中);TJ2:=上REF(上,1);X1:=(C+L+H)/3;BB5:=ATAN(EMA(X1,5)-REF(EMA(X1,5),1)*3.1416*10;EMA3:=EMA(C,3);TJ3:=BB51ANDEMA(X1,5)REF(EMA(X1,3),1);STICKLINE(TJ1ANDTJ2ANDTJ0ANDTJ3,0,20,4,0)COLOR009999;STICKLINE(TJ1ANDTJ2ANDTJ0ANDTJ3,0,35,3,0)COLOR00
13、BBBB;STICKLINE(TJ1ANDTJ2ANDTJ0ANDTJ3,0,45,1.5,0)COLOR00DDDD;STICKLINE(TJ1ANDTJ2ANDTJ0ANDTJ3,0,50,0.6,0)COLOR00FFFF;DRAWTEXT(TJ1ANDTJ2ANDTJ0ANDTJ3,48,斋主全仓),COLORRED;斋主全仓:IF(CROSS(斋主全仓,0),0.9,0),STICK,COLORRED;DRAWTEXT(CROSS(多方趋势,空方趋势)AND(空方趋势22),30,金股),COLOR00FFFF;中间线:50,COLORFFFFFF,POINTDOT;VAR11:=(CLOSE+HIGH+LOW)/3;VAR2A1:=EMA(VAR11,10);VAR3A:=REF(VAR2A1,1);绿珠逃:IF(VAR2A1,0.1,DRAWNULL),COLORGREEN,LINETHICK9;红珠买:IF(VAR2A1VAR3A,0.1,DRAWNULL),COLORRED,LINETHICK9;黄珠卖:IF(VAR2A1VAR3A,0.1,DRAWNULL),COLOR00FFFF,LINETHICK9;通达信MACDKDJ多项共振指标公式实例图解:通达信MACDKDJ多项共振指标公式
限制150内