通达信2指标——顶底背离(主图)
通达信顶底分型线段缠论主图指标公式
通达信顶底分型线段缠论主图指标公式局部低点预选A:=BACKSET(LLV(L,5)<REF(LLV(L,4),1),4);局部低点预选B:=BACKSET(局部低点预选A=0 AND REF(局部低点预选A,1)=1,2);局部低点预选C:=IF(局部低点预选B=1 AND REF(局部低点预选B,1)=0,-1,0);局部高点预选A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4);局部高点预选B:=BACKSET(局部高点预选A=0 AND REF(局部高点预选A,1)=1,2);局部高点预选C:=IF(局部高点预选B=1 AND REF(局部高点预选B,1)=0,1,0);缺口判断:=IF(L>REF(H,1),1,IF(H<REF(L,1),-1,0));距前高天:=BARSLAST(局部高点预选C=1);距前低天:=BARSLAST(局部低点预选C=-1);小值周期:=LOWRANGE(L);大值周期:=TOPRANGE(H);低保留AA:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);低保留AB:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR LLV(L,距前低天+2)<REF(LLV(L,距前低天+1),1)),-1,0);低保留S:=IF((低保留AA=-1 OR 低保留AB=-1) AND L<REF(H,距前高天+1),-1,0);预判:=IF((距前低天<4 AND HHV(缺口判断,距前低天)!=1) OR REF(低保留S,距前低天)=0,1,0);判断:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND 预判=1 AND 大值周期>REF(小值周期,距前低天+1) AND 大值周期>REF(小值周期,距前低天) AND 大值周期>REF(大值周期,距前高天),1,0);高保留A:=IF(局部高点预选C=1 AND REF(距前低天,1)>REF(距前高天,1) AND HHV(H,距前低天+1)>REF(HHV(H,距前低天+1),1),1,0);高保留B:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND REF(低保留S,距前低天)=-1 AND (距前低天>=4 OR HHV(缺口判断,距前低天)=1),1,0);高保留:=IF((高保留A=1 OR 高保留B=1 OR 判断=1) AND H>REF(L,距前低天+1),1,0);预判A:=IF((距前高天<4 AND HHV(缺口判断,距前高天)!=1) OR REF(高保留,距前高天)=0,1,0);判断A:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND 预判A=1 AND 小值周期>REF(大值周期,距前高天+1) AND 小值周期>REF(大值周期,距前高天) AND 小值周期>REF(小值周期,距前低天),-1,0);低保留A:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);低保留B:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR 判断A=-1),-1,0);低保留:=IF((低保留A=-1 OR 低保留B=-1) AND L<REF(H,距前高天+1),-1,0);距前高天A:=BARSLAST(高保留=1);距前低天A:=BARSLAST(低保留=-1);预判X:=IF((距前低天A<4 AND HHV(缺口判断,距前低天A)!=1) OR REF(低保留,距前低天A)=0,1,0);判断X:=IF(局部高点预选C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND 预判X=1 AND 大值周期>REF(小值周期,距前低天A+1) AND 大值周期>REF(小值周期,距前低天A) AND 大值周期>REF(大值周期,距前高天A),1,0);A,1)>REF(距前高天A,1) AND HHV(H,距前低天A+1)>REF(HHV(H,距前低天A+1),1),1,0);高保留XB:=IF(局部高点预选C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND REF(低保留,距前低天A)=-1 AND (距前低天A>=4 OR HHV(缺口判断,距前低天A)=1),1,0);高保留X:=IF((高保留XA=1 OR 高保留XB=1 OR 判断X=1) AND H>REF(L,距前低天A+1),1,0);预判XA:=IF((距前高天A<4 AND HHV(缺口判断,距前高天A)!=1) OR REF(高保留XA,距前高天A)=0,1,0);判断XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND 预判XA=1 AND 小值周期>REF(大值周期,距前高天A+1) AND 小值周期>REF(大值周期,距前高天A) AND 小值周期>REF(小值周期,距前低天A),-1,0);低保留XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)>REF(距前低天A,1) AND LLV(L,距前高天A+1)<REF(LLV(L,距前高天A+1),1),-1,0);低保留XB:=IF(局部低点预选C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND (距前高天A>=4 OR LLV(缺口判断,距前高天A)=-1 OR 判断XA=-1),-1,0);低保留X:=IF((低保留XA=-1 OR 低保留XB=-1) AND L<REF(H,距前高天A+1),-1,0);距前高天YA:=BARSLAST(高保留X=1);距前低天YA:=BARSLAST(低保留X=-1);预判YX:=IF((距前低天YA<4 AND HHV(缺口判断,距前低天YA)!=1) OR REF(低保留X,距前低天YA)=0,1,0);判断YX:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND 预判YX=1 AND 大值周期>REF(小值周期,距前低天YA+1) AND 大值周期>REF(小值周期,距前低天YA) AND 大值周期>REF(大值周期,距前高天YA),1,0);YA,1)>REF(距前高天YA,1) AND HHV(H,距前低天YA+1)>REF(HHV(H,距前低天YA+1),1),1,0);高保留YXB:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND REF(低保留X,距前低天YA)=-1 AND (距前低天YA>=4 OR HHV(缺口判断,距前低天YA)=1),1,0);高保留YX:=IF((高保留YXA=1 OR 高保留YXB=1 OR 判断YX=1) AND H>REF(L,距前低天YA+1),1,0);预判YXA:=IF((距前高天YA<4 AND HHV(缺口判断,距前高天YA)!=1) OR REF(高保留YXA,距前高天YA)=0,1,0);判断YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND 预判YXA=1 AND 小值周期>REF(大值周期,距前高天YA+1) AND 小值周期>REF(大值周期,距前高天YA) AND 小值周期>REF(小值周期,距前低天YA),-1,0);低保留YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)>REF(距前低天YA,1) AND LLV(L,距前高天YA+1)<REF(LLV(L,距前高天YA+1),1),-1,0);低保留YXB:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND (距前高天YA>=4 OR LLV(缺口判断,距前高天YA)=-1 OR 判断YXA=-1),-1,0);低保留YX:=IF((低保留YXA=-1 OR 低保留YXB=-1) AND L<REF(H,距前高天YA+1),-1,0);AAAD:=IF(高保留YX=1 AND 低保留YX=-1 AND H>REF(H,REF(距前高天YA,1)+2),1,IF(高保留YX=1 AND 低保留YX=-1 AND L<REF(L,REF(距前低天YA,1)+2),-1,0));极点保留:=IF(AAAD=0,高保留YX+低保留YX,AAAD);局部极点:IF(极点保留=-1,L,IF(极点保留=1,H,DRAWNULL)) CIRCLEDOT COLORYELLOW;DRAWLINE(极点保留=-1,局部极点,极点保留=1,局部极点,0)COLORBLUE;DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0)COLORBLUE;DRAWICON(极点保留=-1,L-0.03,1);DRAWICON(极点保留=1,H+0.03,2);。
通达信系统指标顶底背离,可以自动划线(干货收藏)
通达信系统指标顶底背离,可以自动划线(干货收藏)MACD/KDJ/RSI/DMI顶底背离关注微信公众号:股票量化研究所,明天会有更多精彩内容分享MACD顶底背离以MACD指标作为参照图,显示MACD、KDJ、RSI和DMI顶底背离柱形线。
网上下载以后,我边使用边理解指标的特点和用法,并做了一些修改和优化。
下面把MACD顶底背离分享给大家,希望大家喜欢!概念要想学好MACD、KDJ、RSI和DMI顶底背离,必须先弄清楚下面几个相关概念。
背离背离就是股价与指标不一致,股价趋势向上,指标反而走平或向下了,股价趋势向下,指标反而向上或走平。
当股价K线图上的股票走势一峰比一峰高,股价一直在向上涨,而MACD指标图形上的由红柱构成的图形的走势是一峰比一峰低,即当股价的高点比前一次的高点高、而MACD指标中的DIFF的高点比指标的前一次高点低,这叫顶背离现象。
顶背离现象一般是股价在高位即将反转转势的信号,表明股价短期内即将下跌,是卖出股票的信号。
MACD底背离MACD底背离一般出现在股价的低位区。
当股价K线图上的股票走势,股价还在下跌,而MACD指标图形上的由绿柱构成的图形的走势是一底比一底高,即当股价的低点比前一次低点底,而MACD指标中的DIFF的低点却比前一次的低点高,这叫底背离现象。
底背离现象一般是预示股价在低位可能反转向上的信号,表明股价短期内可能反弹向上,是短期买入股票的信号。
KDJ底背离、RSI底背离、DMI底背离,和MACD底背离差不多;KDJ顶背离、RSI顶背离、DMI顶背离,和MACD顶背离差不多,就不用累述了。
说明1.MACD顶背离指标可以查看MACD顶底背离的走势和状态,还可以查看KDJ、RSI和DMI是否背离和背离的位置。
2.MACD顶底背离指标可以自动画线,自动画线的2句公式放在大括号里没有运行。
如果需要运行,把大括号删除即可。
下面第三幅贴图的DIFF低低连线就是MACD顶底背离指标自动画的!MACD顶底背离-通达信MACD顶底背离以MACD指标作为参照图,显示MACD、KDJ、RSI和DMI顶底背离柱形线。
通达信精准的背离主图指标公式
通达信精准的背离主图指标公式高:=CONST(REF(HHV(H,150),3));低:=CONST(REF(LLV(L,150),3));NN:=100;N:=9;LC:=REF(C,1);QC:=REF(C,2);AA:=REF(H,N)=HHV(H,2*N+1);AA1:=REF(L,N)=LLV(L,2*N+1);QY:=BACKSET(AA,N+1);QY1:=BACKSET(AA1,N+1);CC:=FILTER(QY,N) AND H=HHV(H,N+1);CC1:=FILTER(QY1,N) AND L=LLV(L,N+1); DDD:=BARSLAST(CC); DD1:=BARSLAST(CC1); GDTS:=IF(CC,CURRBARSCOUNT,0);DDTS:=IF(CC1,CURRBARSCOUNT,0);UTS:=IF(DDD,REF(GDTS,DDD),GDTS);DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS); GDCS1:=CONST(UTS);DDCS1:=CONST(DDTS1);GDCS13:=CONST(REF(H,GDCS1-1));DDCS13:=CONST(REF(L,DDCS1-1));SS1:=REF(UTS,DDD+1);TS2:=REF(DDTS1,DD1+1);GDCS2:=CONST(SS1);DDCS2:=CONST(TS2);M:=INTPART(3*N/5);AAA:=REF(H,M)=HHV(H,2*M+1);QYY:=BACKSET(AAA,M+1);CCC:=FILTER(QYY,M) AND H=HHV(H,M+1); DDDD:=BARSLAST(CCC),NODRAW; GDTSS:=IF(CCC,CURRBARSCOUNT,0); TSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS); GDCS11:=CONST(TSS);TS11:=REF(TSS,DDDD+1);GDCS22:=CONST(TS11);AA11:=REF(L,M)=LLV(L,2*M+1);QY11:=BACKSET(AA11,M+1);CC11:=FILTER(QY11,M) AND L=LLV(L,M+1); DD11:=BARSLAST(CC11);DDTSS:=IF(CC11,CURRBARSCOUNT,0); DDTS11:=IF(DD11,REF(DDTSS,DD11),DDTSS); DDCS11:=CONST(DDTS11);DDTS22:=REF(DDTS11,DD11+1);DDCS22:=CONST(DDTS22);ZGD:=HHV(H,60)*1.01.00;ZGD2:=CONST(ZGD);高压M:=DRAWLINE(CURRBARSCOUNT=GDCS22,H,CURRBA RSCOUNT=GDCS11,H,1),COLORRED,LINETHICK1;低撑M:=DRAWLINE(CURRBARSCOUNT=DDCS22,L,CURRBA RSCOUNT=DDCS11,L,1) COLORRED,LINETHICK1;高压1:=DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBAR SCOUNT=GDCS1,H,1) ,COLORBLUE,LINETHICK1;低撑1:=DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARS COUNT=DDCS1,L,1),COLORBLUE,LINETHICK1;高点:=CONST(HHV(H,NN));低点:=CONST(LLV(L,NN));{背景变色}R1:=C>LC AND C>QC;R2:=REF(R1,1) AND C=QC;R3:=REF(R2,1) AND C>=LC AND CR4:=REF(R3,1) AND C=QC;R5:=REF(R4,1) AND C>=LC AND CR6:=REF(R5,1) AND C=QC;R7:=REF(R6,1) AND C>=LC AND CR8:=REF(R7,1) AND C=QC;R9:=REF(R8,1) AND C>=LC AND CRA:=REF(R9,1) AND C=QC;RB:=REF(RA,1) AND C>=LC AND CRC:=REF(RB,1) AND C=QC;RD:=CRE:=REF(RD,1) AND C>=LC AND CRF:=REF(RE,1) AND C=QC;R10:=REF(RF,1) AND C>=LC AND CR11:=REF(R10,1) AND C=QC;R12:=REF(R11,1) AND C>=LC AND CR13:=REF(R12,1) AND C=QC;R14:=REF(R13,1) AND C>=LC AND CR15:=REF(R14,1) AND C=QC;R16:=REF(R15,1) AND C>=LC AND CR17:=REF(R16,1) AND C=QC;R18:=REF(R17,1) AND C>=LC AND CR19:=REF(RD OR RE OR RF OR R10 OR R11 OR R12 ORR13 OR R14 OR R15 OR R16 OR R17 OR R18,1) AND R1;R1A:=((REF(R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,1)) AND RD);VAR3:=IF(CVAR4:=(H+LC)/3;VAR5:=EMA((O+H+L+C)/4,2330);VAR6:=(V AR5 + ((V AR5 * 6) / 100));短买:R19,NODRAW,COLOR00AAAA;离场:R1A,NODRAW,COLORFF7700;持股:R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,NODRAW,COLOR8000FF;观望:RD OR RE OR RF OR R10 OR R11 OR R12 OR R13 OR R14 OR R15 OR R16 OR R17 ORR18,NODRAW,COLOR767628;超跌:=(C-MA(C,34))/MA(C,34)*100Q1:=CONST(IF(短买,100,IF(离场,0,IF(持股,100,IF(超跌,150,40))))),NODRAW;Q2:=CONST(IF(短买,100,IF(离场,66,IF(持股,0,IF(超跌,150,118))))),NODRAW;Q3:=CONST(IF(短买,0,IF(离场,132,IF(持股,50,IF(超跌,150,118))))),NODRAW;DRAWBAND(高点,RGB(Q1,Q2,Q3),低点,DRAWNULL);C1:=IF(短买,短买,DRAWNULL),;C2:=IF(离场,离场,DRAWNULL),;{DDE金指N: 1, 999, 13;}JH:=SMA(MAX(C-REF(C,1),0),6,1)/SMA(ABS(C-REF(C,1)), 6,1)*100;SZ:=FILTER(CROSS(JH,35),13);SX:=FILTER(CROSS(JH,30),7);SQ:=FILTER(CROSS(71,JH),74);SD:=FILTER(CROSS(80,JH),74);CCL:=REF(HHV(C,120),1);DD:=REF(LLV(C,120),1);WW:=100*(C-DD)/(CCL-DD);EE:=AMOUNT;FF:=(EMA(EE,5)/REF(EMA(EE,5),5));低买:IF(CAPITAL变盘:FILTER(OO ANDV>REF(V,1),13),COLORFF88FF,NODRAW;霸占:=FILTER((FF>=2 AND WW30 OR (FF>=2 AND WW 顶部:=IF(CAPITAL持股K:C>REF(C,1),COLOR0099FF,NODRAW;持币K:C平盘:=C=REF(C,1),COLOR999999,NODRAW;STICKLINE(持股K,H,L,3,1),COLOR0099FF; STICKLINE(持股K,C,O,1.5,0),COLOR0099FF; STICKLINE(持币K,H,L,3,1),COLORFF9900; STICKLINE(持币K,C,O,1.5,0),COLORFF9900; STICKLINE(平盘,H,L,3,1),COLOR999999;STICKLINE(平盘,C,O,1.5,0),COLOR999999; STICKLINE(霸占,H,L,3,1),COLOR0000CC;STICKLINE(霸占,C,O,1.5,0),COLOR0000CC; STICKLINE(变盘,H,L,3,1), COLORFF88FF; STICKLINE(变盘,C,O,1.5,0),COLORFF88FF; STICKLINE(低买,H,L,3,1),COLOR22FFFF;STICKLINE(低买,C,O,1.5,0),COLOR22FFFF; STICKLINE(顶部,H,L,3,1),COLOR00CC00;STICKLINE(顶部,C,O,1.5,0),COLOR00CC00;趋势线:=3*SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1) -2*SMA(SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1),3,1),COLORBCBC00,NOD RAW;ZZ:=趋势线>REF(趋势线,1);{阻力支撑}QWX1:=HHV(C,30);QWX2:=LLV(C,30);QWX3:=CONST((QWX1+QWX2)/2);QWX4:=ABS((2*C+H+L)/4-MA(C,20))/MA(C,20);QWX5:=CONST((1-7/100)*(DMA(C,QWX4)));QWX6:=CONST((1+7/100)*(DMA(C,QWX4)));阻力:IF(BARSLAST(CURRBARSCOUNT=12),QWX6,DRAWN ULL),COLORFF9D3C,LINETHICK1,CIRCLEDOT;支撑:IF(BARSLAST(CURRBARSCOUNT=12),QWX5,DRAWN ULL),COLORFF00FF,LINETHICK1,CIRCLEDOT;{最佳买入选股}RSI5:=(SMA(MAX((C-LC),0),5,1)/SMA(ABS((C-LC)),5,1))*1 00;TR1:=SUM(MAX(MAX((H-L),ABS(H-REF(C,1))),ABS(L-RE F(C,1))),10);HD:=H-REF(H,1);LD:=REF(L,1)-L;DMP:=SUM(IF((HD>0 AND HD>LD),HD,0),10);DMM:=SUM(IF((LD>0 AND LD>HD),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(H,10)-C))/(HHV(H,10)-LLV(L,10)); NEWVOL:=RSI5-WR10;最佳买入:=A V+NEWVOL;J:="KDJ.J";X:=LLV(J,2)=LLV(J,8);买入时机:=(CROSS(J,3));佳选A:=CROSS(最佳买入,0);{DIF综合抓牛}RSIA:=(SMA(MAX(C-LC,0),6,1)/SMA(ABS(C-LC),6,1)*100)/ 100;WR:=-100*(HHV(H,14)-C)/(HHV(H,14)-LLV(L,14));反向:=((0-WR)-100)/100,;角度差:=1-(反向/RSI);角度2:=MA(角度差,2);角度4:=MA(角度差,4);角度差A:=角度差>MA(角度差,3)*1.3;转向:=REF(角度差,1)REF(角度差,1) AND REF(角度差,1) SS:=COUNT(转向,4)>0 OR COUNT(角度差A,4)>0;DIF买:=CROSS(角度2,角度4) AND SS,COLOR0088FF;{精准买点}CYC13:=0.01*EXPMA(AMOUNT,13)/EXPMA(V,13);CYS:=(C-CYC13)/CYC13*100;逢低买入:=IF("ZXNH.ZXNH"=1 AND CYS抓牛A:=DIF买&&逢低买入;到:=(HHV(H,21)-C)/(HHV(H,21)-LLV(L,21))*100-10;底:=(C-LLV(L,21))/(HHV(H,21)-LLV(L,21))*100;啦:=SMA(底,13,8);哈:=CEILING(SMA(啦,13,8));哈哈:=SMA(到,21,8);差:=哈-哈哈,COLORFFFFFF;RC1:=REF((L+O+C+H)/4,1);RC2:=SMA(ABS(L-RC1),13,1)/SMA(MAX(LOW-RC1,0),10,1);RC3:=EMA(RC2,10);RC4:=LLV(L,33);RC5:=EMA(IF(L建仓:=IF(RC5>REF(RC5,1),RC5,0);洗:=IF(RC5启动A:=FILTER(REF(差,1)REF(差,1) AND (建仓OR 洗),3); {乖离破底}X3:=(2*C+L+H)/4;地:=EMA(X3,55)*0.84,;乖离5:=(C-MA(C,5))/MA(C,5)*100,NODRAW;乖离A:=FILTER(LREF(乖离5,1),3);趋势:=7*SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*30,4,1) -3*SMA(SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*30,4,1 ),3,1)-SMA(SMA(SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*30 ,4,1),3,1),2,1);天线:=78.89;逃顶:=CROSS(天线,趋势);低吸A:=CROSS(趋势,5);{内能线}ZF:=((C-REF(C,1))/REF(C,1))*100;HSL:=(V/CAPITAL)*100;KK:=ZF/HSL,COLOR6000FF;KK5:=MA(KK,5),COLORFFAA00;LL:=LLV(KK,34);内能买A:=CROSS(KK,KK5)&&REF(KK,1){包赚不赔}止跌:=(REF(EVERY(CO);VAR1N:=MA(C,5),;VAR2N:=MA(C,10);VAR3N:=(V AR1N-C)/C>3/100;VAR4N:=(V AR2N-V AR1N)/V AR1N>0.03;VAR5N:=LLV(C,30)=LLV(C,120);底部:=VAR3N AND V AR4N AND V AR5N;包赚A:=BARSLAST(底部){深坑挖金}A:=REF(C,1);RSIK:=SMA(MAX(C-A,0),6,1)/SMA(ABS(C-A),6,1)*100;A4:=RSIAZZF:=(C/REF(C,1)-1)*100;深坑1:=IF(BETWEEN(A4,0,5) AND LCD:= C>=O AND REF(深坑1 ,1)=20 AND REF(RSI,1) 深坑A:=C>O AND REF(深坑1 ,1)=20 AND REF(RSI,1) 深坑★:IF(深坑A,L*1.005,DRAWNULL)COLOR55FF55,CIRCLEDOT,LINE THICK5;佳选★:IF(佳选A,L*0.995,DRAWNULL)COLORFF88FF,CIRCLEDOT,LINE THICK4;启动★:IF(启动A,L*0.99,DRAWNULL)COLORFFFF00,CIRCLEDOT,LINETHICK4;抓牛★:IF(抓牛A,L*0.985,DRAWNULL)COLOR0088FF,CIRCLEDOT,LINET HICK4;乖离底★:IF(乖离A,L*0.98,DRAWNULL)COLORFFFFFF,CIRCLEDOT,LINET HICK4;内能买★:IF(内能买A,L*0.975,DRAWNULL)COLOR0000FF,CIRCLEDOT,LINET HICK4;低吸★:IF(低吸A,L*0.97,DRAWNULL)COLOR00FFFF,CIRCLEDOT,LINET HICK4;包赚★:IF(包赚A,L*0.965,DRAWNULL)COLORFF00FF,CIRCLEDOT,LINE THICK4;B01:=IF(佳选A,1,0);B02:=IF(启动A,1,0);B03:=IF(抓牛A,1,0);B04:=IF(乖离A,1,0);B05:=IF(内能买A,1,0);B06:=IF(低吸A,1,0);B07:=IF(包赚A,1,0);B08:=IF(深坑A,1,0);【共振】:B01+B02+B03+B04+B05+B06+B07+B08,COLOR00FFF F,NODRAW;DRAWICON(【共振】>=4,H*1.008,34);持币线:EMA(C,13),COLOR32E01F,LINETHICK3;持股线:IF(持币线>REF(持币线,1),持币线,DRAWNULL),COLOR460CF3,LINETHICK3;{画线}IF(BETWEEN(高压M,高点,低点),高压M,DRAWNULL),COLOR00CCFF,LINETHICK1;IF(BETWEEN(低撑M,高点,低点),低撑M,DRAWNULL),COLOR00CCFF,LINETHICK1;IF(BETWEEN(高压1,高点,低点),高压1,DRAWNULL),COLORCCCCCC,LINETHICK1;IF(BETWEEN(低撑1,高点,低点),低撑1,DRAWNULL),COLORCCCCCC,LINETHICK1;中:=(MA(C,3)+MA(C,6)+MA(C,12)+MA(C,24))/4,COLORFF FFFF;VAR326:=IF(C AND MA(VOL,5)/240 AND C>LC*1.0 AND C,88,0);VAR327:=IF(C/LC>1.050 AND VOL/CAPITAL*1000, 91, 0); DRAWTEXT(V AR327>90,L*0.993,'↖杀庄'),COLOR00FFFF; {背离}RSI:=(SMA(MAX((C-LC),0),3,1)/SMA(ABS((C-LC)),3,1))*100;FFF:=EMA(C,3);MA15:=EMA(C,21);顶背:=CROSS(88,RSI);DRAWTEXT(CROSS(FFF,MA15),L,'←底背'),COLORFF88FF;CCI:="CCI";CCI3:=MA(CCI,3);CCI7:=MA(CCI,7);头:=CROSS(CCI3,CCI) AND (CCI>130);STICKLINE(头,H*1.005,H*1.01,4,0),COLOR00CC00; DRAWTEXT(头,H*1.01,'头'),COLORFFFFFF;STICKLINE(逃顶,H*1.01,H*1.015,4,0),COLORFFFFFF;卖出警报:=(头AND 顶背),COLOR0000FF;STICKLINE(卖出警报,H*1.016,H*1.025,4,0),COLOR0000FF; DRAWTEXT(卖出警报,H*1.028,'空仓'),COLORFFFFFF; DRAWICON(顶背,H*1.016,8);DRAWTEXT(顶背,H*1.02,'←顶背'),COLOR98FF75;DRAWTEXT_FIX(1,0.92,0.01,0,STRCAT(STRCAT('【共振】',CON2STR(【共振】,1)),' ')),COLOR00FFFF;。
通达信精准的背离指标主图附图
R12:=REF(R11,1) AND C>=LC AND C<=QC;
R13:=REF(R12,1) AND C<=LC AND C>=QC;
R14:=REF(R13,1) AND C>=LC AND C<=QC;
R8:=REF(R7,1) AND C<=LC AND C>=QC;
R9:=REF(R8,1) AND C>=LC AND C<=QC;
RA:=REF(R9,1) AND C<=LC AND C>=QC;
RB:=REF(RA,1) AND C>=LC AND C<=QC;
对于个股和背离的理解需要个股中单独考虑,
万山精准背离指标的优点:
万山精准背离指标可以精准的把握背离的位置,只要出现背离就一定是背离产生
缺点: 万山精准背离指标不是所以的背离都能出现,不出现背离可能是市场不符合总结规律
解决方法: 背离产生对于盘子比较小的个股可以根据背离操作即可,对于盘子比较大的个股需
RC:=REF(RB,1) AND C<=LC AND C>=QC;
RD:=C<LC AND C<QC;
RE:=REF(RD,1) AND C>=LC AND C<=QC;
RF:=REF(RE,1) AND C<=LC AND C>=QC;
MACD顶底背离通达信指标公式源码
MACD顶底背离通达信指标公式源码```pascal{MACD指标的顶底背离}{参数:N(计算的周期)}MA1:=MA(CLOSE,5);MA2:=MA(CLOSE,35);DIF:EMA1-EMA2;DEA:EMA(DIF,5);MACD:(DIF-DEA);TopSignal:(REF(HIGH<N,1) AND HIGH[1]>HIGH[2] ANDHIGH[1]>HIGH) AND REF(DEA,1)<0 AND DEA>0;BottomSignal:(REF(LOW<N,1) AND LOW[1]<LOW[2] AND LOW[1]<LOW) AND REF(DEA,1)>0 AND DEA<0;{ 在图表上画出TopSignal和BottomSignal的信号 }IF TopSignal THEN DRAWICON(TopSignal,'↑');IF BottomSignal THEN DRAWICON(BottomSignal,'↓');```源码的主要部分如下所示:-首先定义了两个移动平均线MA1和MA2,分别计算了收盘价的5日和35日均线。
-然后计算了MACD指标的快线(DIF)和慢线(DEA),采用了指数平滑移动平均线(EMA)的计算方法。
-最后根据顶底背离的条件判断,通过比较前一日和当前日的最高价和最低价,以及前一日和当前日的DEA值,来确定顶底背离的信号。
在图表上,通过DRAWICON函数可以绘制出顶底背离的箭头标志,上箭头表示顶背离,下箭头表示底背离。
请注意,这只是一个简化版的MACD顶底背离指标公式,具体的实现还需要根据具体的需求和市场情况进行调整和优化。
对于股票投资和分析,建议综合考虑多个指标和因素,进行综合分析和判断。
通达信顶底分型主图指标公式
通达信顶底分型主图指标公式重心线:(H+L+O+C*3)/6;NX:=(3*CLOSE+LOW+OPEN+HIGH)/6;牛线:(20*NX+19*REF(NX,1)+18*REF(NX,2)+17*REF(NX,3)+16*REF( NX,4)+15*REF(NX,5)+14*REF(NX,6)+13*REF(NX,7)+12*REF(NX,8) +11*REF(NX,9)+10*REF(NX,10)+9*REF(NX,11)+8*REF(NX,12)+7*REF(NX,13 )+6*REF(NX,14)+5*REF(NX,15)+4*REF(NX,16)+3*REF(NX,17)+2*REF(NX,18)+REF(NX,20))/210;牛熊线:MA(牛线,6),COLORGREEN,LINETHICK2;顶:=BBI+3*STD(BBI,13),COLOR004AFF;底:=BBI-3*STD(BBI,13),COLOR67FF00;KU1:=IF(HIGH=HHV(HIGH,3),1,0);KD1:=IF(LOW=LLV(LOW,3),1,0);UL:=IF(REF(KU1,2)=1 AND REF(KU1,1)=0ANDKU1=0,REF(HIGH,2),REF(HIGH,2+BARSLAST(REF(KU1,2)=1 AND REF(KU1,1)=0 AND KU1=0)));DL:=IF(REF(KD1,2)=1 AND REF(KD1,1)=0ANDKD1=0,REF(LOW,2),REF(LOW,2+BARSLAST(REF(KD1,2)=1AND REF(KD1,1)=0 AND KD1=0)));HV:=H>UL AND H>REF(H,1);LV:=L<DL AND L<REF(L,1);GP:=BARSLAST(HV);DP:=BARSLAST(LV);IP:=IF(GP=0,DP,GP)>3;HHV1:=HV AND IP AND H>=HHV(H,BARSLAST(LV));LV1:=LV AND IP AND L<=LLV(L,BARSLAST(HV));V00:=HIGH<REF(HIGH,1) AND LOW<REF(LOW,1);V01:=HIGH<REF(HIGH,1) AND LOW>REF(LOW,1);V02:=HIGH>REF(HIGH,1) AND LOW<REF(LOW,1);V03:=HIGH>REF(HIGH,1) AND LOW>REF(LOW,1);V04:=REF(HIGH,2)<HIGH AND REF(LOW,2)<LOWAND REF(HIGH,2)>REF(HIGH,1) AND REF(LOW,2)<REF(LOW,1);V1:=COUNT(V00,6)>=3 AND COUNT(V01 OR V02,5)=0 AND LLVBARS(LOW,6)=1 AND HHVBARS(HIGH,6)>=5 AND V03;V2:=COUNT(V00,7)>=3 AND COUNT(V01 OR V02,6)=1 AND LLVBARS(LOW,7)=2 AND HHVBARS(HIGH,7)>=6 AND V04;V3:=COUNT(V00,7)>=3 AND COUNT(V01 OR V02,6)=1 AND LLVBARS(LOW,7)=1 AND HHVBARS(HIGH,7)>=6 AND V03;V4:=COUNT(V00,8)>=3 AND COUNT(V01 OR V02,7)<=2 AND LLVBARS(LOW,8)=2 AND HHVBARS(HIGH,8)>=7 AND V04;V5:=COUNT(V00,8)>=3 AND COUNT(V01 OR V02,7)<=2 AND LLVBARS(LOW,8)=1 AND HHVBARS(HIGH,8)>=7 AND V03;V6:=COUNT(V00,9)>=3 AND COUNT(V01 OR V02,8)<=3 AND LLVBARS(LOW,9)=2 AND HHVBARS(HIGH,9)>=8 AND V04;V7:=COUNT(V00,9)>=3 AND COUNT(V01 OR V02,8)<=3 AND LLVBARS(LOW,9)=1 AND HHVBARS(HIGH,9)>=8 AND V03;V8:=COUNT(V00,10)>=3 AND COUNT(V01 OR V02,9)<=4AND LLVBARS(LOW,10)=2 AND HHVBARS(HIGH,10)>=9 AND V04;V9:=COUNT(V00,10)>=3 AND COUNT(V01 OR V02,9)<=4 AND LLVBARS(LOW,10)=1 AND HHVBARS(HIGH,10)>=9 AND V03;V10:=COUNT(V00,11)>=3 AND COUNT(V01 OR V02,10)<=5 AND LLVBARS(LOW,11)=2 AND HHVBARS(HIGH,11)>=10 AND V04;XG:=V1 OR V2 OR V3 OR V4 OR V5 OR V6 OR V7 OR V8 OR V9 OR V10;HV00:=HIGH>REF(HIGH,1) AND LOW>REF(LOW,1);HV01:=HIGH<REF(HIGH,1) AND LOW>REF(LOW,1);HV02:=HIGH>REF(HIGH,1) AND LOW<REF(LOW,1);HV03:=HIGH<REF(HIGH,1) AND LOW<REF(LOW,1);HV04:=REF(HIGH,2)>HIGH AND REF(LOW,2)>LOW AND REF(HIGH,2)>REF(HIGH,1) AND REF(LOW,2)<REF(LOW,1);HV1:=COUNT(HV00,6)>=3 AND COUNT(HV01 OR HV02,5)=0 AND HHVBARS(HIGH,6)=1 AND LLVBARS(LOW,6)>=5 AND HV03;HV2:=COUNT(HV00,7)>=3 AND COUNT(HV01 OR HV02,6)=1 AND HHVBARS(HIGH,7)=2 AND LLVBARS(LOW,7)>=6 AND HV04;HV3:=COUNT(HV00,7)>=3 AND COUNT(HV01 OR HV02,6)=1 AND HHVBARS(HIGH,7)=1 AND LLVBARS(LOW,7)>=6 AND HV03;HV4:=COUNT(HV00,8)>=3 AND COUNT(HV01 OR HV02,7)<=2 AND HHVBARS(HIGH,8)=2 AND LLVBARS(LOW,8)>=7 AND HV04;HV5:=COUNT(HV00,8)>=3 AND COUNT(HV01 OR HV02,7)<=2 AND HHVBARS(HIGH,8)=1 ANDLLVBARS(LOW,8)>=7 AND HV03;HV6:=COUNT(HV00,9)>=3 AND COUNT(HV01 OR HV02,8)<=3 AND HHVBARS(HIGH,9)=2 AND LLVBARS(LOW,9)>=8 AND HV04;HV7:=COUNT(HV00,9)>=3 AND COUNT(HV01 OR HV02,8)<=3 AND HHVBARS(HIGH,9)=1 AND LLVBARS(LOW,9)>=8 AND HV03;HV8:=COUNT(HV00,10)>=3 AND COUNT(HV01 OR HV02,9)<=4 AND HHVBARS(HIGH,10)=2 AND LLVBARS(LOW,10)>=9 AND HV04;HV9:=COUNT(HV00,10)>=3 AND COUNT(HV01 OR HV02,9)<=4 AND HHVBARS(HIGH,10)=1 AND LLVBARS(LOW,10)>=9 AND HV03;HV10:=COUNT(HV00,11)>=3 AND COUNT(HV01 OR HV02,10)<=5 AND HHVBARS(HIGH,11)=2 AND LLVBARS(LOW,11)>=10 AND HV04;HXG:=HV1 OR HV2 OR HV3 OR HV4 OR HV5 OR HV6 OR HV7 OR HV8 OR HV9 OR HV10;底分型:FILTER(XG=1,5) AND 重心线<10.5 AND 牛线<12 AND 牛熊线<10.2,COLORYELLOW,NODRAW;顶分型:FILTER(HXG=1,3),NODRAW;DRAWBAND(BBI,RGB(97,95,00),顶,RGB(97,95,00));DRAWBAND(BBI,RGB(25,75,150),底,RGB(25,75,250));DRAWTEXT_FIX(1,0.02,0,0,'☆微信公众号:({更多指标关注微信公众号:爱指标源码}) ☆'),COLORRED;{用DRAWLINE函数(属于未来函数)绘制直线段,不喜欢的可以删除下面两句公式}DRAWLINE(LV1,LOW,HHV1,HIGH,0),COLORYELLOW,LINETHI CK2;DRAWLINE(HHV1,HIGH,LV1,LOW,0),COLORMAGENTA,LINETHICK2;STICKLINE(CLOSE>REF(CLOSE,1),HIGH,LOW,0,1),COLORRED;STICKLINE(CLOSE>REF(CLOSE,1),OPEN,CLOSE,3,0),COLOR00 0055;STICKLINE(CLOSE>REF(CLOSE,1),OPEN,CLOSE,2.7,0),COLOR 000077;STICKLINE(CLOSE>REF(CLOSE,1),OPEN,CLOSE,2.1,0),COLOR 000099;STICKLINE(CLOSE>REF(CLOSE,1),OPEN,CLOSE,1.5,0),COLOR 0000BB;STICKLINE(CLOSE>REF(CLOSE,1),OPEN,CLOSE,0.9,0),COLOR 0000DD;STICKLINE(CLOSE>REF(CLOSE,1),OPEN,CLOSE,0.3,0),COLOR 0000FF;STICKLINE(CLOSE=REF(CLOSE,1),HIGH,LOW,0,1),COLORWHI TE;STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,3,0),COLOR55 5555;STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,2.7,0),COLOR 777777;STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,2.1,0),COLOR 999999;STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,1.5,0),COLOR BBBBBB;STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,0.9,0),COLOR DDDDDD;STICKLINE(CLOSE=REF(CLOSE,1),OPEN,CLOSE,0.3,0),COLORF FFFFF;STICKLINE(CLOSE<REF(CLOSE,1),HIGH,LOW,0,1),COLORCYA N;STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,3,0),COLOR99 0000;STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,2.7,0),COLOR CC0000;STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,2.1,0),COLORF F4400;STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,1.5,0),COLORF F8800;STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,0.9,0),COLORF FCC00;STICKLINE(CLOSE<REF(CLOSE,1),OPEN,CLOSE,0.3,0),COLOR CYAN;DRAWTEXT(FILTER(XG=1,5) AND 重心线<10.5 AND 牛线<12 AND 牛熊线<10.2,L*0.97,'底分型'),COLORYELLOW;DRAWTEXT(FILTER(HXG=1,3),H*1.02,'顶分型');。
MACD顶底背离通达信指标公式源码
MACD顶底背离通达信指标公式源码
MACD顶底背离通达信指标公式源码
软件介绍
本公式在日线,小时线,半小时线等周期中根据MACD红柱的缩小都能及时给我们的操作做出风险提示,尤其是在短周期中提示更有效。
此公式不是万能的,还需要结合其他操盘指标才更有效。
DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
H1:=REF(MACD,1)<0 AND MACD>0,NODRAW;
H1T:=BARSLAST(H1)+1,NODRAW;
H2:=IF(MACD>0,H1T,0),NODRAW;
H3:=HHV(MACD,H2),NODRAW;
L1:=REF(MACD,1)>0 AND MACD<0,NODRAW;
L1T:=BARSLAST(L1)+1,NODRAW;
HJ:=(H1T+L1T),NODRAW;
H4:=REF(H3,HJ),NODRAW;
顶背离:H3<H4 AND C>REF(C,HJ) AND MACD>0 AND MACD<REF(MACD,1),COLORGREEN,NODRAW; STICKLINE(顶背离,0,MACD,2,0),COLORGREEN;
下载地址。
通达信指标公式源码顶底趋势主图画线指标
顶底趋势主图画线指标N:=3;A1:=REF(H,N)=HHV(H,2*N+1);B1:=FILTER(A1,N);C1:=BACKSET(B1,N+1);D1:=FILTER(C1,N);{高点}A2:=REF(L,N)=LLV(L,2*N+1);B2:=FILTER(A2,N);C2:=BACKSET(B2,N+1);D2:=FILTER(C2,N);{低点}E1:=(REF(LLV(L,2*N),1)+REF(HHV(H,2*N),1))/2;E2:=(H+L)/2;{高低点出现在同一K线上时可作取舍}H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(C)=1; L1:=(D2 AND NOT(D1 AND E1<E2));H2:=D1 AND NOT(D2 AND E1>=E2);X1:=REF(BARSLAST(H1),1)+1;F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,L,10000),X1));G1:=F1>REF(F1,1);I1:=BACKSET(G1,2);LD:=I1>REF(I1,1),LINETHICK0;{过滤后低点}L2:=LD OR ISLASTBAR OR BARSCOUNT(C)=1;X2:=REF(BARSLAST(L2),1)+1;F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,H,0),X2));G2:=F2>REF(F2,1);I2:=BACKSET(G2,2);HD:=I2>REF(I2,1),LINETHICK0;{过滤后高点}R1:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);S1:=R1>REF(R1,1);{前一高}T1:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);U1:=T1>REF(T1,1);{前一低}R2:=BACKSET(S1,REF(BARSLAST(HD),1)+2);S2:=R2>REF(R2,1);{前二高}T2:=BACKSET(U1,REF(BARSLAST(LD),1)+2);U2:=T2>REF(T2,1);{前二低}T3:=BACKSET(U2,REF(BARSLAST(LD),1)+2);U3:=T3>REF(T3,1);{前三低}T4:=BACKSET(U3,REF(BARSLAST(LD),1)+2);U4:=T4>REF(T4,1);{前四低}R3:=BACKSET(S2,REF(BARSLAST(HD),1)+2);S3:=R3>REF(R3,1);{前三高}R4:=BACKSET(S3,REF(BARSLAST(HD),1)+2);S4:=R4>REF(R4,1);{前四高}★压力1:DRAWLINE(S2,H,S1,H,1),COLORMAGENTA,LINETHICK1; ★支撑1:DRAWLINE(U2,L,U1,L,1),COLOR8FBC8F,LINETHICK1;★压力2:DRAWLINE(S3,H,S2,H,1),COLORFF8000;★支撑2:DRAWLINE(U3,L,U2,L,1),COLOR99CC32;★压力3:DRAWLINE(S4,H,S3,H,1),COLOR0000FF;★支撑3:DRAWLINE(U4,L,U3,L,1),COLOR00FF7F; DRAWICON(S2,H*1.01,10);DRAWICON(S3,H*1.01,10);DRAWNUMBER(S2,H*1.02,H),COLORCFB53B; DRAWNUMBER(S1,H*1.02,H),COLORCFB53B; DRAWNUMBER(S3,H*1.02,H),COLORCFB53B;DRAWICON(U1,L*0.99,11);DRAWICON(U2,L*0.99,11);DRAWICON(U3,L*0.99,11);DRAWICON(U4,L*0.99,11);DRAWNUMBER(U1,L*0.98,L),COLORCYAN;DRAWNUMBER(U2,L*0.98,L),COLORCYAN;DRAWNUMBER(U3,L*0.98,L),COLORCYAN;DRAWNUMBER(U4,L*0.98,L),COLORCYAN;。
通达信近期顶底主图指标公式
STICKLINE(出,C,O,2,0),COLORGREEN;
低:=REF(LLV(L,N),判断高低);
近期底:REFDATE(低,DATE),COLORRED,LINETHICK3;
最底:=REFDATE(近期底,DATE),NODRAW;
N:=150;判断高低:=3;
高:=REF(HHV(H,N),判断高低);
近期顶:REFDATE(高,DATE),COLORGREEN,LINETHICK3;
最顶:=REFDATE(近期顶,DATE),NODRAW;
出:=最顶=H AND ((C-L)<(O-C) OR (O-L)<(C-O)),NODRAW;
进:=最底=L AND ((C+L)<(O+C) OR (O+L)<(C+O)),NODRAW;
STICKLINE(进,C,O,3,0),COLORRED;
STICKLINE(进,C,O,2,0),COLORRED;
顶底公式一般都是出现在副图的多主图也有但不直观这公式由顶线和底线组成顶线为绿底线为红当k线触及顶线k线就变绿当k线触及底线k线就变红很好分辨
通达信近期顶底主图指标公式
通达信近期顶底主图指标公式
顶底公式一般都是出现在副图的多,主图也有但不直观,这公式由顶线和底线组成,顶线为绿,底线为红,当K线触及顶线,K线就变绿,当K线触及底线,K线就变红,很好分辨。
百分百绝对准确抄底逃顶主图通达信
百分百绝对准确抄底逃顶主图通达信百分百绝对准确抄底逃顶主图通达信百分百绝对准确抄底逃顶主图通达信分类:指标公式源码MMS:=MA(SMA((L+H+2*C)/4-REF((L+H+2*C)/4,1),5,1)/SM A(ABS((L+H+2*C)/4-REF((L+H+2*C)/4,1)),5,1)*100,1)+50;G1:=IF(-MMS>95,0,20);UOO:=(-(((CLOSE-LLV(CLOSE,7 ))/(HHV(CLOSE,7)-LLV(CLOSE,7))*100=100)>0 AND G1)+1);KS:=(((CLOSE - EMA(CLOSE,13)) / EMA(CLOSE,13)) * (0 - 100));KS1:=IF(BARSCOUNT(C)=1,C/10000,(1-C/SMA(C,13,1))*10 0);趋势线:=EMA(((KS/ 10) + EMA(CLOSE,10)),3);AA:=-100*(趋势线-CLOSE)/趋势线;AC:=(EMA(AA,5));SSL:=EMA(CLOSE,3);MMV:=EMA(((SLOPE(CLOSE,22) *20) +CLOSE),55);MM:=MA(MMV,1);STICKLINE(((SSL>MM)),SSL,MM,0.01,0),COLORRED;SA:=(MM*0.985);SS:=(MA(CLOSE,5));DD:=(MA(CLOSE,13 )); GG:=(MA(CLOSE,21));捞钱手:IF(((SSL>MM)),MM,SA),LINETHICK2,COLORFF00F F;能量线:=DMA(((CLOSE+ OPEN) / 2),(VOL / (SMA(VOL,4,1)*4)));上开:=O;上收:=C;上高:=H;上低:=L;JJ:=(上开+上高+上低)/3;A:=EMA(JJ,4);智能黄金线:A,COLORYELLOW,LINETHICK1;B:=REF(A,1);STICKLINE(((SSL<MM)),捞钱手,智能黄金线,0.01,0),COLORFFFF00;V A1:=EMA(上收,8);V A2:=EMA(上收,20);DRAWTEXT(CROSS(ZIG(3,8),REF(ZIG(3,8),1)),LOW*0.978, '★绝佳'),LINETHICK2,COLORRED;DRAWTEXT(CROSS(REF(ZIG(3,10),1),ZIG(3,10)),HIGH*1.0 2,'★卖');DRAWTEXT(CROSS(V A1,V A2)AND(C>=O)AND智能黄金线>REF(智能黄金线,1),V A1*0.97,'★买'),COLOR00FF00;选手A:=MA(上收,3);箱顶A:=MA(REF(HHV(上收,6),1),3); 箱底A:=MA(REF(LLV(上收,3),1),3);T1:=MA(上收,20)>=REF(MA(上收,20),1);T2:=CROSS(选手A,箱底A)AND 箱顶A/箱底A>100/100 AND T1;T3:=CROSS(箱顶A,选手A) AND箱顶A/箱底A>100/100;选手:=MA(上收,2);箱顶:MA(REF(HHV(上收,30),1),2),COLOR0000FF,LINETHICK2;箱底:MA(REF(LLV(上收,30),1),2),COLOR00FF00,LINETHICK2;T4:=CROSS(选手,箱底)AND 箱顶/箱底>110/100;T5:=CROSS(箱顶,选手) AND箱顶/箱底>110/100;V AR1:=(上收-LLV(上低,27))/(HHV(上高,27)-LLV(上低,27))*100;V AR2:=SMA(V AR1,3,1);V AR3:=SMA(VAR2,3,1);V AR4:=SM A(V AR3,3,1);DRAWTEXT(CROSS(V AR3,V AR4)AND(C>=O)ANDV AR3<40 ANDUOO>0,LOW*0.96,'★'),COLORF00FF0;STICKLINE(C>=O,C,O,5,0),COLORRED;STICKLINE(C>=O,H,L,0,0),COLORYELLOW;STICKLINE(C<=O,C,O,5,0),COLORGREEN;STICKLINE( C<=O,H ,L,0,0),COLORFFFF00;买线:=EMA(C,2);卖线:=EMA(SLOPE(C,21)*20+C,42); DRAWTEXT(CROSS(买线,卖线)AND箱顶>=REF(箱顶,1),LOW*0.95,'★跟'),COLOR00FFFF; STICKLINE(CROSS(买线,卖线),OPEN,CLOSE,3,0),COLOR00FFFF;。
通达信顶底分型线段主图指标公式
通达信顶底分型线段主图指标公式局部低点预选A:=BACKSET(LLV(L,5)<REF(LLV(L,4),1),4);局部低点预选B:=BACKSET(局部低点预选A=0 AND REF(局部低点预选A,1)=1,2);局部低点预选C:=IF(局部低点预选B=1 AND REF(局部低点预选B,1)=0,-1,0);局部高点预选A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4);局部高点预选B:=BACKSET(局部高点预选A=0 AND REF(局部高点预选A,1)=1,2);局部高点预选C:=IF(局部高点预选B=1 AND REF(局部高点预选B,1)=0,1,0);缺口判断:=IF(L>REF(H,1),1,IF(H<REF(L,1),-1,0));距前高天:=BARSLAST(局部高点预选C=1);距前低天:=BARSLAST(局部低点预选C=-1);小值周期:=LOWRANGE(L);大值周期:=TOPRANGE(H);低保留AA:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);低保留AB:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR LLV(L,距前低天+2)<REF(LLV(L,距前低天+1),1)),-1,0);低保留S:=IF((低保留AA=-1 OR 低保留AB=-1) AND L<REF(H,距前高天+1),-1,0);预判:=IF((距前低天<4 AND HHV(缺口判断,距前低天)!=1) OR REF(低保留S,距前低天)=0,1,0);{ 股旁网_通达信股票指标公式}判断:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND 预判=1 AND 大值周期>REF(小值周期,距前低天+1)AND 大值周期>REF(小值周期,距前低天) AND 大值周期>REF(大值周期,距前高天),1,0);高保留A:=IF(局部高点预选C=1 AND REF(距前低天,1)>REF(距前高天,1) AND HHV(H,距前低天+1)>REF(HHV(H,距前低天+1),1),1,0);高保留B:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND REF(低保留S,距前低天)=-1 AND (距前低天>=4 OR HHV(缺口判断,距前低天)=1),1,0);高保留:=IF((高保留A=1 OR 高保留B=1 OR 判断=1) AND H>REF(L,距前低天+1),1,0);预判A:=IF((距前高天<4 AND HHV(缺口判断,距前高天)!=1) OR REF(高保留,距前高天)=0,1,0);判断A:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND 预判A=1 AND 小值周期>REF(大值周期,距前高天+1) AND 小值周期>REF(大值周期,距前高天) AND 小值周期>REF(小值周期,距前低天),-1,0);低保留A:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);低保留B:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR 判断A=-1),-1,0);低保留:=IF((低保留A=-1 OR 低保留B=-1) AND L<REF(H,距前高天+1),-1,0);距前高天A:=BARSLAST(高保留=1);距前低天A:=BARSLAST(低保留=-1);预判X:=IF((距前低天A<4 AND HHV(缺口判断,距前低天A)!=1) OR REF(低保留,距前低天A)=0,1,0);判断X:=IF(局部高点预选C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND 预判X=1 AND 大值周期>REF(小值周期,距前低天A+1) AND 大值周期>REF(小值周期,距前低天A) AND 大值周期>REF(大值周期,距前高天A),1,0);高保留XA:=IF(局部高点预选C=1 AND REF(距前低天A,1)>REF(距前高天A,1) AND HHV(H,距前低天A+1)>REF(HHV(H,距前低天A+1),1),1,0);高保留XB:=IF(局部高点预选C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND REF(低保留,距前低天A)=-1 AND (距前低天A>=4 OR HHV(缺口判断,距前低天A)=1),1,0);高保留X:=IF((高保留XA=1 OR 高保留XB=1 OR 判断X=1) AND H>REF(L,距前低天A+1),1,0);预判XA:=IF((距前高天A<4 AND HHV(缺口判断,距前高天A)!=1) OR REF(高保留XA,距前高天A)=0,1,0);判断XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND 预判XA=1 AND 小值周期>REF(大值周期,距前高天A+1) AND 小值周期>REF(大值周期,距前高天A) AND 小值周期>REF(小值周期,距前低天A),-1,0);低保留XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)>REF(距前低天A,1) AND LLV(L,距前高天A+1)<REF(LLV(L,距前高天A+1),1),-1,0);低保留XB:=IF(局部低点预选C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND (距前高天A>=4 OR LLV(缺口判断,距前高天A)=-1 OR 判断XA=-1),-1,0);低保留X:=IF((低保留XA=-1 OR 低保留XB=-1) AND L<REF(H,距前高天A+1),-1,0);距前高天YA:=BARSLAST(高保留X=1);距前低天YA:=BARSLAST(低保留X=-1);预判YX:=IF((距前低天YA<4 AND HHV(缺口判断,距前低天YA)!=1) OR REF(低保留X,距前低天YA)=0,1,0);判断YX:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND 预判YX=1 AND 大值周期>REF(小值周期,距前低天YA+1) AND 大值周期>REF(小值周期,距前低天YA)AND 大值周期>REF(大值周期,距前高天YA),1,0);高保留YXA:=IF(局部高点预选C=1 AND REF(距前低天YA,1)>REF(距前高天YA,1) AND HHV(H,距前低天YA+1)>REF(HHV(H,距前低天YA+1),1),1,0);高保留YXB:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND REF(低保留X,距前低天YA)=-1 AND (距前低天YA>=4 OR HHV(缺口判断,距前低天YA)=1),1,0);高保留YX:=IF((高保留YXA=1 OR 高保留YXB=1 OR 判断YX=1) AND H>REF(L,距前低天YA+1),1,0);预判YXA:=IF((距前高天YA<4 AND HHV(缺口判断,距前高天YA)!=1) OR REF(高保留YXA,距前高天YA)=0,1,0);判断YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND 预判YXA=1 AND 小值周期>REF(大值周期,距前高天YA+1) AND 小值周期>REF(大值周期,距前高天YA) AND 小值周期>REF(小值周期,距前低天YA),-1,0);低保留YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)>REF(距前低天YA,1) AND LLV(L,距前高天YA+1)<REF(LLV(L,距前高天YA+1),1),-1,0);低保留YXB:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND (距前高天YA>=4 OR LLV(缺口判断,距前高天YA)=-1 OR 判断YXA=-1),-1,0);低保留YX:=IF((低保留YXA=-1 OR 低保留YXB=-1) AND L<REF(H,距前高天YA+1),-1,0);AAAD:=IF(高保留YX=1 AND 低保留YX=-1 AND H>REF(H,REF(距前高天YA,1)+2),1,IF(高保留YX=1 AND 低保留YX=-1 AND L<REF(L,REF(距前低天YA,1)+2),-1,0));极点保留:=IF(AAAD=0,高保留YX+低保留YX,AAAD);局部极点:IF(极点保留=-1,L,IF(极点保留=1,H,DRAWNULL)) CIRCLEDOT COLORYELLOW;DRAWLINE(极点保留=-1,局部极点,极点保留=1,局部极点,0)COLORBLUE;DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0)COLORBLUE;DRAWICON(极点保留=-1,L-0.03,1);。
MACD顶底背离通达信指标公式源码
MACD顶底背离通达信指标公式源码
MACD顶底背离通达信指标公式源码
软件介绍
本公式在日线,小时线,半小时线等周期中根据MACD红柱的缩小都能及时给我们的操作做出风险提示,尤其是在短周期中提示更有效。
此公式不是万能的,还需要结合其他操盘指标才更有效。
DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
H1:=REF(MACD,1)<0 AND MACD>0,NODRAW;
H1T:=BARSLAST(H1)+1,NODRAW;
H2:=IF(MACD>0,H1T,0),NODRAW;
H3:=HHV(MACD,H2),NODRAW;
L1:=REF(MACD,1)>0 AND MACD<0,NODRAW;
L1T:=BARSLAST(L1)+1,NODRAW;
HJ:=(H1T+L1T),NODRAW;
H4:=REF(H3,HJ),NODRAW;
顶背离:H3<H4 AND C>REF(C,HJ) AND MACD>0 AND MACD<REF(MACD,1),COLORGREEN,NODRAW; STICKLINE(顶背离,0,MACD,2,0),COLORGREEN;
下载地址。
通达信MACD顶底背离副图指标公式源码
通达信MACD顶底背离副图指标公式源码
{MACD顶底背离}
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),COLORSTICK;
B3:=REF(C,A3+1)>C AND REF('RSI.RSI1'(6,12,24),A3+1)<'RSI.RSI1'(6,12,24) ANDCROSS('RSI.RSI1'(6,12,24),'RSI.RSI2'(6,12,24));
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;
STICKLINE(D1>0,0பைடு நூலகம்1,0,2,0),COLOR00FF00;
STICKLINE(D2>0,0.1,0,2,0),COLORFFCC66;
STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;
KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;
RSI顶背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;
STICKLINE(B1>0,-0.1,0,2,0),COLORRED;
STICKLINE(B2>0,-0.1,0,2,0),COLORFF00FF;
MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;
通达信指标公式源码 顶底背离MACD副图指标
VAR1:=EMA(SLOPE(C,21)+C,55);VAR2:=EMA(SLOPE(O,21)+O,55);VAR3:=EMA(SLOPE(H,21)+H,55);VAR4:=EMA(SLOPE(L,21)+L,55);VAR5:=EMA(C,3);VAR6:=EMA(O,3);VAR7:=EMA(H,3);VAR8:=EMA(L,3);VAR9:=VAR1-VAR5,LINETHICK2;VAR10:=VAR2-VAR6,LINETHICK2;VAR11:=VAR3-VAR7,LINETHICK2;VAR12:=VAR4-VAR8,LINETHICK2;ZJC:=REVERSE(VAR9);ZJO:=REVERSE(VAR10);ZJH:=REVERSE(VAR11);ZJL:=REVERSE(VAR12);DIF:EMA(ZJC*5,12)-EMA(ZJC*5,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORRED; STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORMAGENTA;STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORYELLOW;STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORLIGREEN; STICKLINE(ZJC> ZJO,ZJH,ZJL,0.0,0),COLORFF66FF;STICKLINE(ZJC> ZJO,ZJC,ZJO,2.1,0),COLORAA00AA;STICKLINE(ZJC> ZJO,ZJC,ZJO,1.9,0),COLORCC11CC;STICKLINE(ZJC> ZJO,ZJC,ZJO,1.6,0),COLORFF22FF;STICKLINE(ZJC> ZJO,ZJC,ZJO,1.2,0),COLORFF44FF;STICKLINE(ZJC> ZJO,ZJC,ZJO,0.7,0),COLORFF66FF;STICKLINE(ZJC> ZJO,ZJC,ZJO,0.2,0),COLORFF99FF;STICKLINE(ZJC<=ZJO,ZJL,ZJC,0.0,0),COLORGREEN;STICKLINE(ZJC<=ZJO,ZJO,ZJC,2.1,0),COLOR005500;STICKLINE(ZJC<=ZJO,ZJO,ZJC,1.9,0),COLOR007700;STICKLINE(ZJC<=ZJO,ZJO,ZJC,1.6,0),COLOR009900;STICKLINE(ZJC<=ZJO,ZJO,ZJC,1.2,0),COLOR00BB00;STICKLINE(ZJC<=ZJO,ZJO,ZJC,0.7,0),COLOR00DD00;STICKLINE(ZJC<=ZJO,ZJO,ZJC,0.2,0),COLOR44FF00;ZTB:=(C-REF(C,1))/REF(C,1)*100>9.9;DRAWTEXT(ZTB,IF(ZJC<0,ZJC*0.9,ZJC*1.1),'涨停板')COLORYELLOW; STICKLINE(ZTB,ZJC,ZJO,2.1,0),COLOR006666;STICKLINE(ZTB,ZJC,ZJO,1.9,0),COLOR008888;STICKLINE(ZTB,ZJC,ZJO,1.6,0),COLOR00AAAA;STICKLINE(ZTB,ZJC,ZJO,1.2,0),COLOR00CCCC;STICKLINE(ZTB,ZJC,ZJO,0.7,0),COLOR00EEEE;STICKLINE(ZTB,ZJC,ZJO,0.2,0),COLOR33FFFF;DTB:=(C-REF(C,1))/REF(C,1)*100<-9.9;DRAWTEXT(DTB,IF(ZJC>0,ZJC*0.9,ZJC*1.1),'跌停板')COLORFF8800; STICKLINE(DTB,ZJO,ZJC,2.1,0),COLORFF0000;{蓝色}STICKLINE(DTB,ZJO,ZJC,1.9,0),COLORFF2200;STICKLINE(DTB,ZJO,ZJC,1.6,0),COLORFF4400;STICKLINE(DTB,ZJO,ZJC,1.2,0),COLORFF6600;STICKLINE(DTB,ZJO,ZJC,0.7,0),COLORFF8800;STICKLINE(DTB,ZJO,ZJC,0.2,0),COLORFFAA00;。
通达信顶底背离指标 副图 源码
MA1:MA(C,5);MA2:MA(C,10);MA3:MA(C,30);A1:=BARSLAST(REF(CROSS("MACD.DIF"(12,26,9),"MACD.DEA"(12,26,9)),1));B1:=REF(C,A1+1)>C AND REF("MACD.DIF"(12,26,9),A1+1)<"MACD.DIF"(12,26,9) AND CROSS("MACD.DIF"(12,26,9),"MACD.DEA"(12,26,9));底背离MACD:DRAWTEXT(FILTER(B1>0,5),LOW,'1'),COLORYELLOW;DRAWTEXT(FILTER(B1>0,5),LOW*0.98,'MACD底背离'),COLOR00FF00;A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) ANDCROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));底背离KDJ:DRAWTEXT(FILTER(B2>0,5),LOW,'▲'),COLORYELLOW;DRAWTEXT(FILTER(B2>0,5),LOW*0.98,'KDJ底背离'),COLORRED;A3:=BARSLAST(REF(CROSS("RSI.RSI1"(8,55,55),"RSI.RSI2"(8,55,55)),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(8,55,55),A3+1)<"RSI.RSI1"(8,55,55) AND CROSS("RSI.RSI1"(8,55,55),"RSI.RSI2"(8,55,55));底背离RSI:DRAWTEXT(FILTER(B3>0,5),LOW,'▲'),COLORYELLOW;DRAWTEXT(FILTER(B3>0,5),LOW*0.98,'RSI底背离'),COLORF0F000;A4:=BARSLAST(REF(CROSS("DMI.PDI"(14,6),"DMI.MDI"(14,6)),1));B4:=REF(C,A4+1)>C AND REF("DMI.PDI"(14,6),A4+1)<"DMI.PDI"(14,6) AND CROSS("DMI.PDI"(14,6),"DMI.MDI"(14,6));底背离DMI:DRAWTEXT(FILTER(B4>0,5),LOW,'▲'),COLORYELLOW;DRAWTEXT(FILTER(B4>0,5),LOW*0.98,'DMI底背离'),COLORF00FF0;C1:=BARSLAST(REF(CROSS("MACD.DEA"(12,26,9),"MACD.DIF"(12,26,9)),1));D1:=REF(C,C1+1)<C AND REF("MACD.DIF"(12,26,9),C1+1)>"MACD.DIF"(12,26,9) AND CROSS("MACD.DEA"(12,26,9),"MACD.DIF"(12,26,9));顶背离MACD:DRAWTEXT(FILTER(D1>0,5),HIGH*1.02,'▲'),COLOR00FF00; DRAWTEXT(FILTER(D1>0,5),HIGH*1.04,'MACD顶背离'),COLORRED;C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) ANDCROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));顶背离KDJ:DRAWTEXT(FILTER(D2>0,5),HIGH*1.02,'▲'),COLOR00FF00; DRAWTEXT(FILTER(D2>0,5),HIGH*1.04,'KDJ顶背离'),COLORF00FF0;C3:=BARSLAST(REF(CROSS("RSI.RSI2"(8,55,55),"RSI.RSI1"(8,55,55)),1));D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(8,55,55),C3+1)>"RSI.RSI1"(8,55,55) AND CROSS("RSI.RSI2"(8,55,55),"RSI.RSI1"(8,55,55));顶背离RSI:DRAWTEXT(FILTER(D3>0,5),HIGH*1.02,'▲'),COLOR00FF00;DRAWTEXT(FILTER(D3>0,5),HIGH*1.04,'RSI顶背离'),COLORYELLOW;C4:=BARSLAST(REF(CROSS("DMI.MDI"(14,6),"DMI.PDI"(14,6)),1));D4:=REF(C,C4+1)<C AND REF("DMI.PDI"(14,6),C4+1)>"DMI.PDI"(14,6) AND CROSS("DMI.MDI"(14,6),"DMI.PDI"(14,6));顶背离DMI:DRAWTEXT(FILTER(D4>0,5),HIGH*1.02,'▲'),COLOR00FF00; DRAWTEXT(FILTER(D4>0,5),HIGH*1.04,'DMI顶背离'),COLORF0F000;。
顶底背离指标副图通达信指标公式源码
KDJ,RSI,MACD,DMI等指标集成,在一张副图上显示,看盘非常方便明了,可以看出股票下一步的趋势。
底:-50;顶:50;TRR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14); HD := HIGH-REF(HIGH,1);LD := REF(LOW,1)-LOW;PDM:= SUM(IF(HD>0 AND HD>LD,HD,0),14);MDM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);PDI:= PDM*100/TRR;MDI:= MDM*100/TRR;A1:=BARSLAST(REF(CROSS("MACD.DIF"(12,26,9),"MACD.DEA"(12,26,9)),1));B1:=REF(C,A1+1)>C AND REF("MACD.DIF"(12,26,9),A1+1)<"MACD.DIF"(12,26,9) AND CROSS("MACD.DIF"(12,26,9),"MACD.DEA"(12,26,9));A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));{理}A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));C1:=BARSLAST(REF(CROSS("MACD.DEA"(12,26,9),"MACD.DIF"(12,26,9)),1));D1:=REF(C,C1+1)<C AND REF("MACD.DIF"(12,26,9),C1+1)>"MACD.DIF"(12,26,9) AND CROSS("MACD.DEA"(12,26,9),"MACD.DIF"(12,26,9));C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));C4:=BARSLAST(REF(CROSS(MDI,PDI),1));D4:=REF(C,C+1)<C AND REF(MDI,C4+1)>MDI AND CROSS(MDI,PDI);A4:=BARSLAST(REF(CROSS(PDI,MDI),1));B4:=REF(C,A4+1)>C AND REF(PDI,A4+1)<PDI AND CROSS(PDI,MDI);DMI底背:IF(B4>0,-50,0),COLOR0099FF,POINTDOT;DRAWTEXT(B4>0,-5,'DMI底背'),COLOR0099FF;DMI顶背:IF(D4>0,50,0),COLORBLUE,POINTDOT;DRAWTEXT(D4>0,15,'DMI顶背'),COLORBLUE;MACD底背:IF(B1>0,-50,0),COLORRED,POINTDOT;DRAWTEXT(B1>0,-15,'MACD底背'),COLORRED;KDJ底背:IF(B2>0,-50,0),COLORFF00FF,POINTDOT;DRAWTEXT(B2>0,-25,'KDJ底背'),COLORFF00FF;RSI底背:IF(B3>0,-50,0),COLORYELLOW,POINTDOT;DRAWTEXT(B3>0,-35,'RSI底背'),COLORYELLOW;MACD顶背:IF(D1>0,50,0),COLOR00FF00,POINTDOT;DRAWTEXT(D1>0,25,'MACD顶背'),COLOR00FF00;KDJ顶背:IF(D2>0,50,0),COLORFFCC66,POINTDOT;DRAWTEXT(D2>0,35,'KDJ顶背'),COLORFFCC66;RSI顶背:IF(D3>0,50,0),COLORFFFFFF,POINTDOT;DRAWTEXT(D3>0,45,'RSI顶背'),COLORFFFFFF;STICKLINE(B1>0,-50,0,0,0),COLORRED;STICKLINE(B2>0,-50,0,0,0),COLORFF00FF;STICKLINE(B3>0,-50,0,0,0),COLORYELLOW;STICKLINE(D1>0,50,0,0,0),COLOR00FF00;STICKLINE(D2>0,50,0,0,0),COLORFFCC66;STICKLINE(D3>0,50,0,0,0),COLORWHITE;STICKLINE(B4>0,-50,0,0,0),COLOR0099FF;STICKLINE(D4>0,50,0,0,0),COLORBLUE;。
通达信2指标——顶底背离(主图)
{顶底背离主图}MA5:MA(C,5),COLORYELLOW,LINETHICK2;MA10:MA(C,10),COLORFF00FF,LINETHICK2;MA20:MA(C,20),COLORFFCC66,LINETHICK2;MA120:MA(C,120),COLORFF0066,LINETHICK2;MA250:MA(C,250),COLORFFCCFF,LINETHICK1;MA450:MA(C,450),COLOR00CCFF,CIRCLEDOT,LINETHICK1;TRI:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14); HD := HIGH-REF(HIGH,1);LD := REF(LOW,1)-LOW;PDM:= SUM(IF(HD> 0 AND HD> LD,HD,0),14);MDM:= SUM(IF(LD> 0 AND LD> HD,LD,0),14);PDI:= PDM*100/TRI;MDI:= MDM*100/TRI;A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A2+1)> C AND REF("KDJ.K"(9,3,3),A2+1)< "KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));B3:=REF(C,A3+1)> C AND REF("RSI.RSI1"(6,12,24),A3+1)< "RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));D2:=REF(C,C2+1)"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));D3:=REF(C,C3+1)"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));C4:=BARSLAST(REF(CROSS(MDI,PDI),1));D4:=REF(C,C4+1)MDI AND CROSS(MDI,PDI);A4:=BARSLAST(REF(CROSS(PDI,MDI),1));B4:=REF(C,A4+1)> C AND REF(PDI,A4+1)< PDI AND CROSS(PDI,MDI);STICKLINE(B4,L,L-0.04,6,0),COLORFFCCFF;DRAWTEXT(B4,L-0.19,'DMI底背'),COLOR00FF66;DRAWTEXT(D4,H+0.08,'DMI顶背'),COLORWHITE;DRAWTEXT(B2,L-0.09,'KDJ底背'),COLORYELLOW;STICKLINE(B3,L,L-0.04,6,0),COLORRED;DRAWTEXT(B3,L-0.16,'RSI底背'),COLORRED;DRAWTEXT(D2,H+0.08,'KDJ顶背'),COLORC0A8FF;STICKLINE(D3,H,H+0.04,6,0),COLORFFCCCC;DRAWTEXT(D3,H+0.08,'RSI顶背'),COLOR00FF66;。
通达信XT--(OBV能量顶底附图)
通达信XT--(OBV能量顶底附图)OBV能量顶底---(严格执行箱体理论=赚钱不被套,源码奉献)原理注释:超买超卖做买卖点,OBV上冲背离做辅助,严格执行箱体理论,上冲箱顶能量背离,资金超买,坚决离场。
(适合盘整股,个别强势庄股慎用。
)(牛吃饱走了附图)注释:看到红十字卖出,红十字,横线为超买;红十字竖线为能量背离。
V AR1:=REF(CLOSE,2);AA2:SMA(MAX(CLOSE-V AR1,0),7,1)/SMA(ABS(CLOSE-V AR1), 7,1)*100,COLOR00FF00;超卖1: IF(AA2<12,30,0),COLORF00FF0;STICKLINE(超卖1,0,30,5,0),COLORF00FF0;V AR2:=REF(CLOSE,1);V AR3:=SMA(MAX(CLOSE-V AR2,0),7,1)/SMA(ABS(CLOSE-V AR2),7,1)*100;超卖2: IF(V AR3<12,30,0),COLORBROWN; STICKLINE(超卖2,0,30,5,0),COLORBROWN;逢高派发区: STICKLINE(AA2>80,AA2+1,AA2-1,8,0), COLORRED;牛吃饱走了: IF(AA2< REF(AA2,1) ANDAA2>79,AA2,0);STICKLINE(牛吃饱走了,0,100,0.5,0),COLORWHITE;OBV:=SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE& lt;REF(CLOSE,1),-VOL,0)),0)/100000;A1:=OBV-REF(OBV,1);A:=MA(OBV,5);B:=REF(A,1);B5:=A1/B*10;C1:=(B5-REF(B5,1))/REF(B5,1);RSV2:=(CLOSE-LLV(LOW,36))/(HHV(HIGH,36)-LLV(LOW, 36))*100;K:=SMA(RSV2,5,1);D:=SMA(K,3,1);PP:=BARSLAST(H=HHV(H,20));P2:=IF(H=HHV(H,20) OR PP<3,1,0);P1:=BARSLAST(CROSS(C1,0.5));V AR13:=(LOW+HIGH+CLOSE)/3;CB:= MA(V AR13,5);A5:= HHV(CB,20);A2:= HHV(CB,60);B1:= LLV(CB,20);B2:= LLV(LOW,60)*1.02;A3:= HHV(HIGH,60)*0.98;短顶:REF(C1,1)>0.5 AND C1<REF(C1,1) ANDH>REF(H,1) AND K>30 ANDK>D,COLORYELLOW;TY:=IF(C1<-8 OR H/LLV(L,3)>1.5,1,0);STICKLINE(短顶,100,85,2,0),COLORYELLOW;单阳背离:=C1<0 AND C1=LLV(C1,13) AND C>O AND TY=1;TU1:=IF((A5>REF(A5,1) ANDREF(A5,1)>REF(A5,2) )OR (REF(A5,1)<REF(A5,2) AND REF(A5,2)<REF(A5,3)),1,0);TU:=IF((C1<0 AND REF(C1,1)>0 AND REF (C1,2)<0 AND COUNT(C>O,3)=3 AND L>REF(L,1) ANDREF(L,1)>REF(L,2) ) OR (C1<0 AND C1<REF(C1,1) AND REF(C,1)>REF(O,1) AND REF(C,2)>REF(O,2)AND REF(C,3)>REF(O,3) AND REF(L,1)>REF(L,2) AND REF(L,2)>REF(L,3)),1,0),COLORLIGREEN;三阳背离: TU=1 AND K>D AND TU1=1;STICKLINE(三阳背离,65,85,2,0),COLORLIGREEN;逃顶:K>80 AND K>D AND CROSS(-0.5,C1) ANDP1<5 AND P2=1,COLORGRAY;STICKLINE(逃顶,65,50,2,0),COLORGRAY;顶:=K>80 AND CROSS(D,K) AND CROSS(-0.5,C1) AND P1<5 AND P2=1;V AR11:=REF(CLOSE,1);V AR12:=SMA(MAX(CLOSE-V AR11,0),6,1)/SMA(ABS(CLO SE-V AR11),6,1)*100;卖出:IF( CROSS(80,V AR12),1.5,0),COLORRED; STICKLINE(卖出,50,100,1,0),COLORRED;(监测大盘顶)附图参考注释:监测34天最高最低值的连线,低点金山买入。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
{顶底背离主图}
MA5:MA(C,5),COLORYELLOW,LINETHICK2;
MA10:MA(C,10),COLORFF00FF,LINETHICK2;
MA20:MA(C,20),COLORFFCC66,LINETHICK2;
MA120:MA(C,120),COLORFF0066,LINETHICK2;
MA250:MA(C,250),COLORFFCCFF,LINETHICK1;
MA450:MA(C,450),COLOR00CCFF,CIRCLEDOT,LINETHICK1;
TRI:=
SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14); HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
PDM:= SUM(IF(HD> 0 AND HD> LD,HD,0),14);
MDM:= SUM(IF(LD> 0 AND LD> HD,LD,0),14);
PDI:= PDM*100/TRI;
MDI:= MDM*100/TRI;
A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(C,A2+1)> C AND REF("KDJ.K"(9,3,3),A2+1)< "KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(C,A3+1)> C AND REF("RSI.RSI1"(6,12,24),A3+1)< "RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
D2:=REF(C,C2+1)"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));
C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=REF(C,C3+1)"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
C4:=BARSLAST(REF(CROSS(MDI,PDI),1));
D4:=REF(C,C4+1)MDI AND CROSS(MDI,PDI);
A4:=BARSLAST(REF(CROSS(PDI,MDI),1));
B4:=REF(C,A4+1)> C AND REF(PDI,A4+1)< PDI AND CROSS(PDI,MDI);
STICKLINE(B4,L,L-0.04,6,0),COLORFFCCFF;
DRAWTEXT(B4,L-0.19,'DMI底背'),COLOR00FF66;
DRAWTEXT(D4,H+0.08,'DMI顶背'),COLORWHITE;
DRAWTEXT(B2,L-0.09,'KDJ底背'),COLORYELLOW;
STICKLINE(B3,L,L-0.04,6,0),COLORRED;
DRAWTEXT(B3,L-0.16,'RSI底背'),COLORRED;
DRAWTEXT(D2,H+0.08,'KDJ顶背'),COLORC0A8FF;
STICKLINE(D3,H,H+0.04,6,0),COLORFFCCCC;
DRAWTEXT(D3,H+0.08,'RSI顶背'),COLOR00FF66;。