通达信精准的背离主图指标公式

合集下载

通达信量价背离决策指标公式

通达信量价背离决策指标公式
VAR4:=SMA((VAR2-CLOSE)/(VAR2-VAR1中)*100,5,1);
DRAWBAND(VAR3,RGB(115,30,150),50,RGB(0,100,100));
主力:VAR3,COLORLIRED,LINETHICK1;
散户:VAR4,COLORGREEN;
VAR5:=SMA(MAX(CLOSE-REF(CLOSE,1),0),5,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),5,1)*100;
DEA:=EMA(DIFF,9),COLORFFFF00;
MACD:=(DIFF-DEA)*2,COLORSTICK;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
VAR13:=(REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
VAR14:=(REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));
VAR15:=(REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2));
DRAWTEXT(REF(#股市黑客#,1)<=13&&CROSS(#股市黑客#,※升跌临界※)&& REF(MA(C,55),1)>REF(MA(C,55),2)&&(VAR19 OR REF(VAR19,1)),28,←¥③背离临界),COLORMAGENTA;

常用到的背离指标通达信指标公式源码

常用到的背离指标通达信指标公式源码

结合你自己的指标抄底逃顶自由把握妖股不算中线:18.5,COLORLIRED;AA1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));MACD底背离:=REF(C,AA1+1)>C AND REF("MACD.DIF",AA1+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA")>0;AA2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));KDJ底背离:=REF(C,AA2+1)>C AND REF("KDJ.K",AA2+1)<"KDJ.K" ANDCROSS("KDJ.K","KDJ.D");AA3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));RSI底背离:=REF(C,AA3+1)>C AND REF("RSI.RSI1",AA3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2")>0;AA4:=BARSLAST(REF(CROSS("BIAS.BIAS1","BIAS.BIAS2"),1));BIAS底背离:=REF(C,AA4+1)>C AND REF("BIAS.BIAS1",AA4+1)<"BIAS.BIAS1" AND CROSS("BIAS.BIAS1","BIAS.BIAS2")>0;CC1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));MACD顶背离:=REF(C,CC1+1)<C AND REF("MACD.DIF",CC1+1)>"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF")>0;CC2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));KDJ顶背离:=REF(C,CC2+1)<C AND REF("KDJ.K",CC2+1)>"KDJ.K" ANDCROSS("KDJ.D","KDJ.K")>0;CC3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));RSI顶背离:=REF(C,CC3+1)<C AND REF("RSI.RSI1",CC3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1")>0;CC4:=BARSLAST(REF(CROSS("BIAS.BIAS2","BIAS.BIAS1"),1));BIAS顶背离:=REF(C,CC4+1)<C AND REF("BIAS.BIAS1",CC4+1)>"BIAS.BIAS1" AND CROSS("BIAS.BIAS2","BIAS.BIAS1")>0;{CCI}N:=60;DD:=C=LLV(C,N);{60日最低点}DDSJ:=BARSLAST(REF(DD,1));{上一低点时间}DDGJ:=REF(CLOSE,DDSJ+1)>CLOSE;{股价趋势}GD:=C=HHV(C,N);{60日最高点}GDSJ:=BARSLAST(REF(GD,1));{上一高点时间}GDGJ:=REF(CLOSE,GDSJ+1)<CLOSE;{股价趋势}TYP:=(HIGH + LOW + CLOSE)/3;CCI:=(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N));CDZB:=REF(CCI,DDSJ+1)<CCI;{CCI指标趋势}CCI底背离:=DDGJ AND CDZB;CGZB:=REF(CCI,GDSJ+1)>CCI;CCI顶背离:=GDGJ AND CGZB;K值:="KDJ.K";KDZB:=REF(K值,DDSJ+1)<K值;{KDJ.K指标趋势}K底背离:=DDGJ AND KDZB{ AND K超卖};KGZB:=REF(K值,GDSJ+1)>K值;K顶背离:=GDGJ AND KGZB;MACD:="MACD.MACD";MDZB:=REF(MACD,DDSJ+1)<MACD;{MACD指标趋势}M底背离:=DDGJ AND MDZB;MGZB:=REF(MACD,GDSJ+1)>MACD;M顶背离:=GDGJ AND MGZB;RSI:="RSI.RSI1";RDZB:=REF(RSI,DDSJ+1)<RSI;{RSI指标趋势}R底背离:=DDGJ AND RDZB;RGZB:=REF(RSI,GDSJ+1)>RSI;R顶背离:=GDGJ AND RGZB;BIAS:="BIAS.BIAS1";BDZB:=REF(BIAS,DDSJ+1)<BIAS;{BIAS指标趋势}B底背离:=DDGJ AND BDZB;BGZB:=REF(BIAS,GDSJ+1)>BIAS;B顶背离:=GDGJ AND BGZB;DRAWTEXT(ISLASTBAR,19,' CCI底背离'),LINETHICK2,COLORGREEN;DRAWTEXT(CCI底背离,IF(ISLASTBAR,19,19),'I'),LINETHICK2,COLORGREEN; DRAWTEXT(ISLASTBAR,16,' RSI底背离'),LINETHICK2,COLORWHITE; DRAWTEXT(R底背离,IF(ISLASTBAR,16,16),'I'),LINETHICK2,COLORWHITE; DRAWTEXT(RSI底背离,IF(ISLASTBAR,16,16),'-'),LINETHICK2,COLORWHITE; DRAWTEXT(ISLASTBAR,13,' MACD底背离'),LINETHICK2,COLORMAGENTA; DRAWTEXT(M底背离,IF(ISLASTBAR,13,13),'I'),LINETHICK2,COLORMAGENTA; DRAWTEXT(MACD底背离,IF(ISLASTBAR,13,13),'-'),LINETHICK2,COLORMAGENTA; DRAWTEXT(ISLASTBAR,10,' KDJ底背离'),LINETHICK2,COLORRED; DRAWTEXT(K底背离,IF(ISLASTBAR,10,10),'I'),LINETHICK2,COLORRED; DRAWTEXT(KDJ底背离,IF(ISLASTBAR,10,10),'-'),LINETHICK2,COLORRED; DRAWTEXT(ISLASTBAR,7,' BIAS底背离'),LINETHICK2,COLORYELLOW; DRAWTEXT(B底背离,IF(ISLASTBAR,7,7),'I'),LINETHICK2,COLORYELLOW; DRAWTEXT(BIAS底背离,IF(ISLASTBAR,7,7),'-'),LINETHICK2,COLORYELLOW; DRAWTEXT(ISLASTBAR,4,' BIAS底背离'),LINETHICK2,COLORYELLOW; DRAWTEXT(ISLASTBAR,34,' BIAS顶背离'),LINETHICK2,COLORYELLOW; DRAWTEXT(B顶背离,IF(ISLASTBAR,34,34),'I'),LINETHICK2,COLORYELLOW; DRAWTEXT(BIAS顶背离,IF(ISLASTBAR,34,34),'-'),LINETHICK2,COLORYELLOW; DRAWTEXT(ISLASTBAR,31,' KDJ顶背离'),LINETHICK2,COLORRED; DRAWTEXT(K顶背离,IF(ISLASTBAR,31,31),'I'),LINETHICK2,COLORRED; DRAWTEXT(KDJ顶背离,IF(ISLASTBAR,31,31),'-'),LINETHICK2,COLORRED; DRAWTEXT(ISLASTBAR,28,' MACD顶背离'),LINETHICK2,COLORMAGENTA; DRAWTEXT(M顶背离,(ISLASTBAR,28,28),'I'),LINETHICK2,COLORMAGENTA; DRAWTEXT(MACD顶背离,(ISLASTBAR,28,28),'-'),LINETHICK2,COLORMAGENTA; DRAWTEXT(ISLASTBAR,25,' RSI顶背离'),LINETHICK2,COLORWHITE; DRAWTEXT(R顶背离,(ISLASTBAR,25,25),'I'),LINETHICK2,COLORWHITE; DRAWTEXT(RSI顶背离,(ISLASTBAR,25,25),'-'),LINETHICK2,COLORWHITE; DRAWTEXT(ISLASTBAR,22,' CCI顶背离'),LINETHICK2,COLORGREEN; DRAWTEXT(CCI顶背离,(ISLASTBAR,22,22),'I'),LINETHICK2,COLORGREEN;{超买超卖}K超买:="KDJ.K">=80 OR "KDJ.D">=80 OR "KDJ.J">=100;K超卖:="KDJ.K"<=20 OR "KDJ.D"<=30 OR "KDJ.J"<0;{RSI:="RSI.RSI1"; }R超买:=RSI>=80;R超卖:=RSI<=20;C超买:="I">=100;C超卖:="I"<=-100;{BIAS:="BIAS.BIAS1";}B超买:="BIAS.BIAS1">3.5 OR "BIAS.BIAS2">5;B超卖:="BIAS.BIAS1"<-3 OR "BIAS.BIAS2"<-4;{超卖超买显示}{DRAWTEXT(B超买,IF(ISLASTBAR,34,34),'○'),LINETHICK2,COLORYELLOW; DRAWTEXT(K超买,IF(ISLASTBAR,31,31),'○'),LINETHICK2,COLORRED; DRAWTEXT(R超买,(ISLASTBAR,25,25),'○'),LINETHICK2,COLORWHITE; DRAWTEXT(C超买,(ISLASTBAR,22,22),'○'),LINETHICK2,COLORGREEN;} {DRAWTEXT(C超卖,IF(ISLASTBAR,19,19),'○'),LINETHICK2,COLORGREEN; DRAWTEXT(R超卖,IF(ISLASTBAR,16,16),'○'),LINETHICK2,COLORWHITE; DRAWTEXT(K超卖,IF(ISLASTBAR,10,10),'○'),LINETHICK2,COLORRED; DRAWTEXT(B超卖,IF(ISLASTBAR,7,7),'○'),LINETHICK2,COLORYELLOW;} {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,18,20,1,0),COLORRED;超卖O背离I:1,NODRAW,COLORWHITE;顶背比底背更准:1,NODRAW,COLORGREEN;红方点BIAS买点:1,NODRAW,COLORRED;。

最准确的底背离公式

最准确的底背离公式

底背离公式在不同的股票分析软件中可能有所不同。

以通达信和同花顺为例,以下是底背离公式的参考:在通达信中,底背离公式为:* DIFF = EMA(CLOSE, 12) - EMA(CLOSE, 26);* DEA = EMA(DIFF, 9);* MACD = 2 * (DIFF - DEA);* QZQ = BARSLAST(REF(MACD, 1) < 0 AND MACD > 0);* QM = LLVBARS(MACD, QZQ + 20);* MQDZ = IF(QM > QZQ, REF(MACD, QM), 0);* XG1 = MACD < 0 AND MACD > MQDZ AND CLOSE = LLV(CLOSE, QZQ + 20) AND MQDZ < 0;* XG = REF(XG1, 1) = 1 AND MACD > REF(MACD, 1)。

在同花顺中,底背离公式为:* STICKLINE(DEF >= 0 AND DEF < REF(DEF, 1), 0, DEF, 0.0, 0), COLORRED; * STICKLINE(DEF < 0 AND DEF >= REF(DEF, 1), 0, DEF, 0.0, 0), COLORCYAN; * STICKLINE(DEF < 0 AND DEF < REF(DEF, 1), 0, DEF, 0.0, 0), COLORCYAN; * IF(DIF < 1000, 0, DRAWNULL), COLORBROWN;* K1 := BACKSET(DIF > REF(DIF, 1), 2);* 强DIF: IF(K1, DIF, DRAWNULL), COLORRED;* K2 := BACKSET(DIF < REF(DIF, 1), 2);* 弱DIF: IF(K2, DIF, DRAWNULL), COLORFF8B80。

根据趋势指标背离指标通达信指标公式源码

根据趋势指标背离指标通达信指标公式源码

根据趋势指标背离指标通达信指标公式源

引言
趋势指标背离指标是投资者在股票市场中用来判断股票价格走势是否背离趋势的一种技术分析工具。

本文将介绍通达信软件中使用的趋势指标背离指标的公式源码。

公式源码解析
以下是通达信软件中趋势指标背离指标的公式源码:
公式1:
SAR=[前一周期SAR]+[前一周期AF*(前一周期EP-前一周期SAR)]
其中,SAR代表后续发展停轨,AF代表加速因子,EP代表极点价格。

公式2:
VR=(AVS-BVS)/(AVS+BVS)
其中,VR代表成交量比率,AVS代表上升成交量,BVS代表
下降成交量。

公式3:
DMI:=(HHV(HIGH,N)-LLV(LOW,N))/N
其中,DMI代表指标值,HHV代表最高价的最高值,LLV代
表最低价的最低值,N代表周期。

公式4:
MACD:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG)
其中,MACD代表指标值,EMA代表指数平均值,CLOSE代
表收盘价,SHORT代表短期周期,LONG代表长期周期。

结论
趋势指标背离指标是通达信软件中常用的技术分析工具之一。

通过分析股票价格和成交量的走势,投资者可以使用这些公式来判
断市场的趋势是否背离实际情况,从而作出相应的投资决策。

然而,投资者在使用这些指标时应注意市场环境的变化和其他重要信息的
综合分析,以取得更准确的结果。

以上是根据趋势指标背离指标通达信指标公式源码的文档。

希望对您有所帮助。

MACD顶底背离柱背离指标通达信公式(附图)

MACD顶底背离柱背离指标通达信公式(附图)

MACD顶底背离柱背离指标通达信公式(附图)DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK;IF(DIF>DEA,DIF,DRAWNULL) COLORRED ;IF(DIF<DEA,DIF,DRAWNULL)COLORGREEN;A1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));B1:=REF(C,A1+1)>C AND REF("MACD.DIF",A1+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA");DRAWTEXT(B1>0,-1,'MACD底背'),COLORFF00FF;C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));D1:=REF(C,C1+1)<C AND REF("MACD.DIF",C1+1)>"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF");DRAWTEXT(D1>0,0.4,'MACD顶离'),COLORGREEN;JC := DEA-DIF;绿柱面积:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);红柱面积:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);本次最低价:=LLV(L,BARSLAST(JC<0));本次最高价:=HHV(H,BARSLAST(JC>0));X1:=IF (MACD<0,BARSLAST(CROSS(DIF,DEA)),0);前次绿柱面积:=REF(绿柱面积,X1+1);前次最低价:=REF(本次最低价,X1+1);Y1:=IF((绿柱面积<0 AND ABS(绿柱面积)<ABS(前次绿柱面积) AND 本次最低价<前次最低价 ),1,0);RS1:= MACD<0 AND REF(MACD,1)<0 AND C<前次最低价AND ABS(绿柱面积)<ABS(前次绿柱面积) AND ABS(MACD)<ABS(REF(MACD,1));底背驰:= IF (CROSS(DIF,DEA),REF(Y1,1),0);DRAWTEXT(底背驰,-0.8,'积底背'),COLOR00FFFF;X2:=IF (MACD>0,BARSLAST(CROSS(DEA,DIF)),0);前次红柱面积:=REF(红柱面积,X2+1);前次最高价:=REF(本次最高价,X2+1);Y2:=IF((红柱面积>0 AND 红柱面积<前次红柱面积 AND 本次最高价>前次最高价 ),1,0);RS2:= MACD>0 AND REF(MACD,1)>0 AND C>前次最高价AND ABS(红柱面积)<ABS(前次红柱面积) AND ABS(MACD)<ABS(REF(MACD,1));顶背驰:= IF (CROSS(DEA,DIF),REF(Y2,1),0);DRAWTEXT(顶背驰,0.8,'顶底背'),COLORGREEN;MACD高:=HHV(MACD,5);E:=REF(C,C1+1)>C AND DEA>0 AND REF(MACD 高,C1+1)<MACD高 AND CROSS("MACD.DEA","MACD.DIF") ;DRAWTEXT(E>0,0.4,'柱顶背'),COLORRED;F:=REF(C,A1+1)>C AND DEA<0 AND REF(MACD 高,A1+1)<MACD高 AND CROSS("MACD.DIF","MACD.DEA");DRAWTEXT(F>0,-0.3,'柱底背'),COLORYELLOW;STICKLINE(COUNT(DIF>DEA,BARSLAST(CROSS(DIF,DEA))+1 )=7,0,MACD,1,0),COLORCD7F32;STICKLINE(COUNT(DIF>DEA,BARSLAST(CROSS(DIF,DEA))+1 )=15,0,MACD,1,0),COLORCD7F32;STICKLINE(COUNT(DIF>DEA,BARSLAST(CROSS(DIF,DEA))+1 )=28,0,MACD,1,0),COLORCD7F32;STICKLINE(COUNT(DIF>DEA,BARSLAST(CROSS(DIF,DEA))+1 )=36,0,MACD,1,0),COLORCD7F32;STICKLINE(COUNT(DIF>DEA,BARSLAST(CROSS(DIF,DEA))+1 )=48,0,MACD,1,0),COLORCD7F32;STICKLINE(COUNT(DIF<DEA,BARSLAST(CROSS(DIF,DEA))+1)=7,0,MACD,1,0), COLORE47833;STICKLINE(COUNT(DIF<DEA,BARSLAST(CROSS(DIF,DEA))+1 )=15,0,MACD,1,0), COLORE47833;STICKLINE(COUNT(DIF<DEA,BARSLAST(CROSS(DIF,DEA))+1 )=28,0,MACD,1,0) COLORE47833;STICKLINE(COUNT(DIF<DEA,BARSLAST(CROSS(DIF,DEA))+1 )=36,0,MACD,1,0), COLORE47833;STICKLINE(COUNT(DIF<DEA,BARSLAST(CROSS(DIF,DEA))+1 )=48,0,MACD,1,0), COLORE47833;。

通达信量价背离决策指标公式

通达信量价背离决策指标公式

通达信量价背离决策指标公式通达信量价背离决策指标公式中:50,COLORYELLOW;VAR1中:=LLV(LOW,13);VAR2:=HHV(HIGH,13);VAR3:=SMA((CLOSE-VAR1中)/(VAR2-VAR1中)*100,5,1);VAR4:=SMA((VAR2-CLOSE)/(VAR2-VAR1中)*100,5,1);DRAWBAND(VAR3,RGB(115,30,150),50,RGB(0,100,100) );主力:VAR3,COLORLIRED,LINETHICK1;散户:VAR4,COLORGREEN;VAR5:=SMA(MAX(CLOSE-REF(CLOSE,1),0),5,1)/SMA(A BS(CLOSE-REF(CLOSE,1)),5,1)*100;操作:EMA(VAR5,3),LINETHICK1,COLORYELLOW;{操作变色:IF(操作>REF(操作,1),操作,DRAWNULL),LINETHICK2,COLORMAGENTA;}STICKLINE(C,90,90,1,0),COLOR3C3CFF;STICKLINE(C,50,50,1,0),COLORYELLOW;STICKLINE(C,10,10,1,0),COLORCYAN;DRAWICON(CROSS(操作,中),中,34);{买入红箭头};DRAWTEXT(CROSS(操作,中),中-0.1,''),COLORYELLOW;N1:=9;N2:=5;N:=21;XIAO1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);XIAO2:=SMA(ABS(LOW-XIAO1),13,1)/SMA(MAX(LOW-XI AO1,0),10,1);XIAO3:=EMA(XIAO2,10);XIAO4:=LLV(LOW,33);XIAO5:=EMA(IF(LOWREF(XIAO5,1),0,XIAO5,2.1,0 ),COL OR000099;STICKLINE(XIAO5>REF(XIAO5,1),0,XIAO5,1.5,0 ),COLO R0000BB;STICKLINE(XIAO5>REF(XIAO5,1),0,XIAO5,0.9,0 ),COLO R0000DD;STICKLINE(XIAO5>REF(XIAO5,1),0,XIAO5,0.3,0 ),COLO R0000FF;STICKLINE(XIAO5<REF(XIAO5,1),0,XIAO5,3,0),COLOR0 05500;STICKLINE(XIAO5<REF(XIAO5,1),0,XIAO5,2.6,0),COLO R007700;STICKLINE(XIAO5<REF(XIAO5,1),0,XIAO5,2.1,0),COLO R009900;STICKLINE(XIAO5REF(XIAO5,1),XIAO5,0),COLORRED, NODRAW;【私募洗盘】:IF(XIAO5<REF(XIAO5,1),XIAO5,0),COLORGREEN, NODRAW;B1:=(HHV(H,9)-C)/(HHV(H,9)-LLV(LOW,9))*100- 70;B2:=SMA(B1,9,1)+100;B3:=(C-LLV(L,9))/(HHV(H,9)- LLV(L,9))*100;B4:=SMA(B3,3,1);B5:=SMA(B4,3,1)+100;B6:=B5-B2;观望期:=IF(B6>60,B6-60,0);T1:=STICKLINE(REF(观望期,1)观望期,观望期,REF(观望期,1),9,0),COLORCYAN;{趋势背景}TAI1:=MA(C,1)/MA(REF(C,13),8)*100;TAI2:=MA(FORCAST(TAI1,21),3);TAI3:=REF(TAI1,1);TAI4:=REF(TAI1,2);邰1:=LLV(LOW,8);邰2:=HHV(HIGH,13);#股市黑客#:= EMA((CLOSE-邰1)/(邰2-邰1)*100,5),COLORRED,LINETHICK3;{输出后是趋势背景}※升跌临界※:= EMA(0.667*REF(#股市黑客#,1)+0.333*#股市黑客#,2),COLORGREEN,LINETHICK3;{输出后是趋势背景}VAR1:=(CLOSE>REF(CLOSE,1) ANDCLOSE>REF(CLOSE,2));VARD:=(CLOSE=REF(CLOSE,1) ANDCLOSE=REF(CLOSE,1) AND CLOSE=REF(CLOSE,1) AND CLOSE=REF(CLOSE,1) ANDCLOSE=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2));VAR19:=REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1) AND VAR1;DIFF:=EMA(DCLOSE,12)-EMA(DCLOSE,26);DEA:=EMA(DIFF,9),COLORFFFF00;MACD:=(DIFF-DEA)*2,COLORSTICK;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));底背离:=REF(CLOSE,A1+1)>CLOSE ANDDIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);顶背离:=REF(CLOSE,A2+1)DIFF ANDCROSS(DEA,DIFF);¥①:IF(REF((MA(C,5)-C)/C>0.04 AND(MA(C,10)-MA(C,5))/MA(C,5)>0.04 AND 观望期=0 AND C>REF(C,1),1),44,0),LINETHICK3,COLORLIRED;{进}¥②:IF(REF("KDJ.J",1)0 AND TAI1>=TAI2 ANDTAI3>TAI4,34,0),LINETHICK3,COLORBROWN;{进}¥③:IF(REF(#股市黑客#,1)REF(MA(C,55),2)&&(VAR19 ORREF(VAR19,1)),33,0),COLORMAGENTA,LINETHICK3;¥④:IF(底背离,45,0),LINETHICK3,COLORYELLOW;DRAWTEXT(底背离,37,'←¥④MACD底背离'),COLORWHITE;DRAWICON(底背离,45,1),COLORYELLOW;DRAWICON(REF(#股市黑客#,1)REF(MA(C,55),2)&&(VAR19 ORREF(VAR19,1)),35,1);DRAWICON(REF((MA(C,5)-C)/C>0.04 AND(MA(C,10)-MA(C,5))/MA(C,5)>0.04 AND 观望期=0 AND C>REF(C,1),1),46,1);DRAWICON(REF("KDJ.J",1)0 AND TAI1>=TAI2 AND TAI3>TAI4,36,1),COLORYELLOW;{DRAWTEXT_FIX(C>O,0.01,0.9,0,''), COLORRED;DRAWTEXT_FIX(C>O,1,1,0,'程序化交易模型'),COLORRED;};DRAWTEXT(REF(#股市黑客#,1)REF(MA(C,55),2)&&(VAR19 ORREF(VAR19,1)),28,'←¥③背离临界'),COLORMAGENTA;DRAWTEXT(REF("KDJ.J",1)0 AND TAI1>=TAI2 AND TAI3>TAI4,32,'←¥②KDJ背离'),COLORBROWN;DRAWTEXT(REF((MA(C,5)-C)/C>0.04 AND(MA(C,10)-MA(C,5))/MA(C,5)>0.04 AND 观望期=0 AND C>REF(C,1),1),37,'←¥①背离中'),COLORLIRED;主力成本:EMA(MA(CLOSE,3),13),NODRAW,COLORAAAAFF; 短期支撑:LLV(HIGH,30),NODRAW,COLORAAAAFF;换手率:VOL/CAPITAL*100,NODRAW,COLORFF8888; 五日均换手率:SUM(100*V/CAPITAL,5)/5,NODRAW,COLORAAAAFF;十日均换手率:SUM(100*V/CAPITAL,10)/10,NODRAW,COLORAAAA FF;量:=IF(C>200,VOL/1000000,VOL/1),LINETHICK0,COLOR EEEEFF;地量:=换手率=5 AND 换手率=25,COLORE66878;{地量AND ISLASTBAR AND PERIOD=5,60,'成交地量'}DRAWTEXT_FIX(地量AND ISLASTBAR AND PERIOD=5, 0.28,0.10,0,'成交地量'),COLORGREEN;DRAWTEXT_FIX(低靡AND ISLASTBAR ANDPERIOD=5,0.28,0.10,0,'成交低靡'),COLORCYAN;DRAWTEXT_FIX(温和AND ISLASTBAR ANDPERIOD=5,0.28,0.10,0,'成交温和'),COLORFFFFFF;DRAWTEXT_FIX(活跃AND ISLASTBAR AND PERIOD=5,0.28,0.10,0,'成交活跃'),COLOR208FFF;DRAWTEXT_FIX(带量AND ISLASTBAR AND PERIOD=5,0.28,0.10,0,'成交带量'),COLORYELLOW;DRAWTEXT_FIX(放量AND ISLASTBAR AND PERIOD=5,0.28,0.10,0,'成交放量'),COLORFF00FF;DRAWTEXT_FIX(巨量AND ISLASTBAR AND PERIOD=5,0.28,0.10,0,'成交巨量'),COLORRED;DRAWTEXT_FIX(怪异AND ISLASTBAR AND PERIOD=5,0.28,0.10,0,'成交怪异'),COLORE66878;VVOL:=IF(CURRBARSCOUNT=1 ANDPERIOD=5,VOL*240/FROMOPEN,DRAWNULL),NODRA W;V换手率:=VVOL/CAPITAL*100,NODRAW,COLORYELLOW;{V量:=IF(C>200,VOL/1000000,VOL/1),LINETHICK0,COLOR EEEEFF;}V地量:=V换手率=5 AND V换手率=25,COLORE66878;DRAWTEXT_FIX(V地量AND ISLASTBAR AND FROMOPEN5, 0.7,0.10,0,'预测地量'),COLORFF6600;DRAWTEXT_FIX(V低靡AND ISLASTBAR AND FROMOPEN5,0.7,0.10,0,'预测低靡'),COLOR008364;DRAWTEXT_FIX(V温和AND ISLASTBAR AND FROMOPEN5,0.7,0.10,0,'预测温和'),COLORFFFFFF;DRAWTEXT_FIX(V活跃AND ISLASTBAR AND FROMOPEN5,0.7,0.10,0,'预测活跃'),COLOR208FFF;DRAWTEXT_FIX(V带量AND ISLASTBAR AND FROMOPEN5,0.7,0.10,0,'预测带量'),COLORYELLOW;DRAWTEXT_FIX(V放量AND ISLASTBAR ANDFROMOPEN5,0.7,0.10,0,'预测放量'),COLORFF00FF;DRAWTEXT_FIX(V巨量AND ISLASTBAR AND FROMOPEN5,0.7,0.10,0,'预测巨量'),COLORRED;DRAWTEXT_FIX(V怪异AND ISLASTBAR AND FROMOPEN5,0.7,0.10,0,'预测怪量'),COLORMAGENTA;个股6日:=(C-MA(C,6))/MA(C,6);个股12日:=(C-MA(C,12))/MA(C,12);个股24日:=(C-MA(C,24))/MA(C,24);大盘6日:=(INDEXC-MA(INDEXC,6))/MA(INDEXC,6);大盘12日:=(INDEXC-MA(INDEXC,12))/MA(INDEXC,12); 大盘24日:=(INDEXC-MA(INDEXC,24))/MA(INDEXC,24); 大盘:=(大盘6日+ 大盘12日+ 大盘24日)/3;个股:=(个股6日+ 个股12日+ 个股24日)/3;DRAWTEXT_FIX(个股>大盘ANDISLASTBAR,0.14,0.10,0,'强于大盘'),COLORYELLOW;DRAWTEXT_FIX(个股0 AND ISLASTBAR,0.21,0.10,0,'走势较强'),COLORYELLOW;DRAWTEXT_FIX(个股<0 AND ISLASTBAR,0.21,0.10,0,'走势较弱'),COLORGREEN;DRAWTEXT_FIX(1,0.00,0.10,0,'友谊看盘:'),COLORYELLOW;DRAWTEXT_FIX(1,0.00,0.00,0,'所属代码名称:'),COLORYELLOW;DRAWTEXT_FIX(1,0.09,0.00,0,CODE),COLORCYAN;DRAWTEXT_FIX(1,0.15,0,0,'所属行业:'),COLORYELLOW;DRAWTEXT_FIX(1,0.215,0,0,HYBLOCK),COLORCYAN;DRAWTEXT_FIX(1,0.26,0,0,'所属地区:'),COLORYELLOW;DRAWTEXT_FIX(1,0.33,0,0,DYBLOCK),COLORCYAN;DRAWTEXT_FIX(1,0.40,0,0,'所属概念:'),COLORYELLOW;DRAWTEXT_FIX(1,0.48,0,0,GNBLOCK),COLORCYAN; {显示年月日星期几}D1:=YEAR AND MONTH AND DAY;AAA1:=STRCAT(CON2STR(YEAR,0),'年');AAA2:=STRCAT(CON2STR(MONTH,0),'月');AAA3:=STRCAT(CON2STR(DAY,0),'日');AAA4:=STRCAT('【',IF(WEEKDAY=1,'一',IF(WEEKDAY=2,'二',IF(WEEKDAY=3,'三',IF(WEEKDAY=4,'四',IF(WEEKDAY=5,'五',IF(WEEKDAY=6,'六','日')))))));AAA:=STRCAT(STRCAT(STRCAT(AAA1,AAA2),STRCAT (AAA3,AAA4)),'】');DRAWTEXT_FIX(D1,0.65,0.0,0,AAA),COLORCYAN;今总成交(亿):=AMOUNT/100000000,COLORFF00FF,NODRAW;成交:=AMOUNT/((HIGH-LOW)*2-ABS(CLOSE-OPEN));今总流入(亿):=IF(CLOSE>OPEN,成交*(HIGH-LOW),IF(CLOSEOPEN,0-成交*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,0-成交*(HIGH-LOW),0-AMOUNT/2))/100000000,COLOR00FF00 ,NODRAW;今净流入(亿):=今总流入(亿)+今总流出(亿),COLORYELLOW,NODRAW;今总成交:=STRCAT(STRCAT(' 今总成交: ',CON2STR(今总成交(亿),2)),'亿');今总流入:=STRCAT(STRCAT(' 今总流入: ',CON2STR(今总流入(亿),2)),'亿');今总流出:=STRCAT(STRCAT(' 今总流出: ',CON2STR(今总流出(亿),2)),'亿');今净流入:=STRCAT(STRCAT(' 今净流入: ',CON2STR(今净流入(亿),2)),'亿');今资金流:=STRCAT('今资金流:',STRCAT(STRCAT(STRCAT(STRCAT(今总成交,今总流入),今总流出), 今净流入),0));DRAWTEXT_FIX(ISLASTBAR,0.00,0.05,0,今资金流),COLORYELLOW;。

通达信操盘铁律主图指标公式

通达信操盘铁律主图指标公式

通达信操盘铁律主图指标公式MID:=(3*CLOSE+LOW+OPEN+HIGH)/6;牛线:(20*MID+19*REF(MID,1)+18*REF(MID,2)+17*REF(MID,3)+16* REF(MID,4)+15*REF(MID,5)+14*REF(MID,6)+13*REF(MID,7)+12*REF(MID,8)+11*REF(MID,9) +10*REF(MID,10)+9*REF(MID,11)+8*REF(MID,12)+7*REF(MID,13)+6*REF(MID,14)+5*REF(MID,15 )+4*REF(MID,16)+3*REF(MID,17)+2*REF(MID,18)+REF(MID,20))/210,COLORRED;马线:MA(牛线,6),COLORYELLOW;乖离率:(C-牛线)/C*100,NODRAW,COLORGREEN;涨停:=IF((C-REF(C,1))/REF(C,1)>0.097,1,0);STICKLINE(涨停,OPEN,CLOSE,3,0),COLORMAGENTA;跌停:=IF((REF(C,1)-C)/C>0.097,1,0);STICKLINE(跌停,OPEN,CLOSE,3,0),COLORGREEN;KP:=SMA(AMOUNT,10,1)/10000;VAR11:=REF(KP,1);VAR21:= REF(KP,2);VAR31:=REF(KP,3);涨停复制:=C>=(牛线,牛线) AND 牛线>(马线,马线) AND乖离率>=(0,0) AND 乖离率<=(4,4)AND COUNT(KP>VAR11,1) AND VAR11>VAR21 AND VAR21>VAR31 ANDCOUNT(((CLOSE-REF(CLOSE,1))/REF(CLOSE,1))>0.099,13)>=1;DRAWTEXT(涨停复制,L*0.95,'涨'),COLOR00FFFF;DRAWTEXT(涨停复制,L*0.91,'停'),COLOR00FFFF;DRAWTEXT(涨停复制,L*0.87,'复'),COLOR00FFFF;DRAWTEXT(涨停复制,L*0.83,'制'),COLOR00FFFF;VAR0:=SMA(MAX(CLOSE-REF(C,1),0),12,1)/SMA(ABS(CLOSE-REF(C,1)),15,1)*100;DRAWTEXT(CROSS(82,VAR0),H*1.04,'快卖'),COLORWHITE;S:=C-REF(C,1);DX:=100*EMA(EMA(S,6),6)/EMA(EMA(ABS(S),6),6);买:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2)),1,0);DRAWTEXT(FILTER(买=1,5),L*0.96,'拉升'),COLORFFDE00;DA:=(EMA(C,1)+EMA(C,2)+EMA(C,3)+EMA(C,4))/4;DB:=(EMA(C,10)+EMA(C,20)+EMA(C,40)+EMA(C,80))/4;DRAWICON(CROSS(DA-DB,0),L*0.98,7);JH:=SMA(MAX(C-REF(C,1),0),5,1)/SMA(ABS(C-REF(C,1)),5,1)*100;DRAWICON(CROSS(84,JH),H*1.04,8);字:=STRCAT(STRCAT(STRCAT(STRCAT('名称: ',STKNAME),' 代码: '),CODE),' ' );板块:=STRCAT('概念板块: ',GNBLOCK);DRAWTEXT_FIX(ISLASTBAR,0.2,0,0,STRCAT(字,板块)),COLORYELLOW;YC:=REF(CLOSE,1);止损价位:=(YC*1.0035*97+0.2)/99.65;DRAWTEXT_FIX(C!=0,0.02,0.05,0,'★=================='),COLORRED;DRAWTEXT_FIX(C!=0,0.02,0.1,0,'操 '),COLORRED;DRAWTEXT_FIX(C!=0,0.02,0.15,0,'盘 '),COLORRED;DRAWTEXT_FIX(C!=0,0.02,0.2,0,'铁 '),COLORRED;DRAWTEXT_FIX(C!=0,0.02,0.25,0,'律 '),COLORRED;DRAWTEXT_FIX(C!=0,0.02,0.3,0,'★=================='),COLORRED;DRAWTEXT_FIX(C!=0,0.04,0.1,0,'买入条件E13 CCI'),COLORYELLOW;DRAWTEXT_FIX(C!=0,0.04,0.15,0,'买入条件2:30以后'),COLORYELLOW;DRAWTEXT_FIX(C!=0,0.04,0.2,0,STRCAT('止损价位',STRCAT(CON2STR(止损价位,2),' 元'))),COLORYELLOW;DRAWTEXT_FIX(C!=0,0.04,0.25,0,'线上:工作线下:休息'),COLORYELLOW;E:=(HIGH+LOW+OPEN+2*CLOSE)/5;明日阻力:=2*E-LOW;明日支撑:=2*E-HIGH;明日突破:=E+(HIGH-LOW);明日反转:=E-(HIGH-LOW);今日阻力:=REF(明日阻力 , 1);今日支撑:=REF(明日支撑 , 1);DRAWTEXT_FIX(C!=0,0.2,0.05,0,STRCAT('今日阻力:',STRCAT(CON2STR(今日阻力,2),' 元'))),COLORFFFF00;DRAWTEXT_FIX(C!=0,0.2,0.1,0,STRCAT('今日支撑:',STRCAT(CON2STR(今日支撑,2),' 元'))),COLORRED;DRAWTEXT_FIX(C!=0,0.2,0.15,0,STRCAT('明日突破:',STRCAT(CON2STR(明日突破,2),' 元'))),COLORFF00FF;DRAWTEXT_FIX(C!=0,0.2,0.2,0,STRCAT('明日阻力:',STRCAT(CON2STR(明日阻力,2),' 元'))),COLORFFFF00;DRAWTEXT_FIX(C!=0,0.2,0.25,0,STRCAT('明日支撑:',STRCAT(CON2STR(明日支撑,2),' 元'))),COLORRED;DRAWTEXT_FIX(C!=0,0.2,0.3,0,STRCAT('明日反转:',STRCAT(CON2STR(明日反转,2),' 元'))),COLORYELLOW;A:=HHV(HIGH,13)=HIGH AND HIGH>REF(HIGH,1);A1:=FILTER(A,12);B:=LLV(LOW,13)=LOW AND LOW<REF(LOW,1);B1:=FILTER(B,12);TS1:=BARSLAST(A1);箱顶:REF(HIGH,TS1),COLORFF00FF,NODRAW;STICKLINE(1,箱顶,箱顶,1.5,0),COLORFF00FF;TS2:=BARSLAST(B1);箱底:REF(LOW,TS2),COLORFFBB80,NODRAW;STICKLINE(1,箱底,箱底,1.5,0),COLORFFBB80;箱高:100*(箱顶-箱底)/箱底,NODRAW;均价:=(3*C+H+L+O)/6;VAR1:=(8*均价+7*REF(均价,1)+6*REF(均价,2)+5*REF(均价,3)+ 4*REF(均价,4)+3*REF(均价,5)+2*REF(均价,6)+REF(均价,8))/36;VAR2:=(LLV(VAR1,2)+LLV(VAR1,4)+LLV(VAR1,6))/3;SZ1:=REF(VAR1,1)=REF(VAR2,1) AND VAR1>VAR2 AND CLOSE>VAR1;SZ2:=VAR1>VAR2 AND VAR1>REF(VAR1,1) AND VAR2>REF(VAR2,1)AND H/VAR1<1.1 AND L>VAR2 AND CLOSE>VAR1;SZ3:=VAR1>VAR2 AND VAR1>REF(VAR1,1) AND VAR2>=REF(VAR2,1) AND H/VAR1>1.1;SZ4:=VAR1>VAR2 AND VAR1>REF(VAR1,1) AND VAR2>REF(VAR2,1)AND CLOSE>VAR2 AND CLOSE<VAR1;SZ5:=(VAR1>VAR2 AND VAR2>REF(VAR2,1) AND VAR1<>REF(VAR1,1)AND CLOSE<VAR2) OR (VAR1>VAR2 AND VAR1<REF(VAR1,1)AND VAR2<REF(VAR2,1) AND CLOSE<VAR2);SZ6:=REF(VAR1,1)>REF(VAR2,1) AND VAR1=VAR2 AND CLOSE<VAR2;XD1:=VAR1=VAR2 AND CLOSE<VAR2 OR (VAR1<REF(VAR1,1) AND VAR2<REF(VAR2,1)AND REF(VAR1,1)=REF(VAR2,1) AND CLOSE<VAR2);XD2:=VAR1=VAR2 AND CLOSE>VAR1;SAT:=(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20));量能饱和度:=IF(SAT>1,1,SAT)*100;DRAWTEXT_FIX(BARSTATUS=2 AND SZ1,0.8,0.05,0,'调整结束短线介入'),COLORRED;DRAWTEXT_FIX(BARSTATUS=2 AND SZ2,0.8,0.05,0,'上升通道走势良好'),COLORRED;DRAWTEXT_FIX(BARSTATUS=2 AND SZ3,0.8,0.05,0,'股价偏离注意调整'),COLORRED;DRAWTEXT_FIX(BARSTATUS=2 AND SZ4,0.8,0.05,0,'上升通道调整洗盘'),COLORGREEN;。

通达信量价背离决策指标公式

通达信量价背离决策指标公式

通达信量价背离决策指标公式通达信量价背离决策指标是一种用于判断股价与成交量之间是否存在背离现象的技术指标。

背离现象指的是股价与成交量之间出现不一致的情况,即在股价上升的过程中,成交量却在下降,或者在股价下跌的过程中,成交量却在上升。

这种背离现象常常被认为是股价趋势反转的重要信号。

背离(A)=EMA(CLOSE,N)-EMA(EMA(CLOSE,N),N)成交量(V)=VOLUME背离高点(BH)=LLV(HIGH,N)背离低点(BL)=HHV(LOW,N)底部背离(BBD)=IF(V<REF(MA(V,N),1),REF(EMA(CLOSE,N),1),0)顶部背离(TBD)=IF(V>REF(MA(V,N),1),REF(EMA(CLOSE,N),1),0)顶部背离强度(TBDQS)=SUM(TBD,N)底部背离强度(BBDQS)=SUM(BBD,N)背离失效(BLFS)=IF(BBDQS<BH*0.618,1,IF(TBDQS<BL*0.618,-1,0))上述公式中,CLOSE代表股价收盘价,VOLUME代表成交量,HIGH代表最高价,LOW代表最低价,EMA代表指数移动平均线,LLV代表最低值REF代表引用前一交易日的值,MA代表简单移动平均线,N代表计算的周期长度。

通达信量价背离决策指标的逻辑是利用成交量与股价之间的背离现象来判断股价的可能趋势反转。

当股价上涨时,成交量应该相应上升,如果股价上涨但成交量下降,则意味着市场上买盘力量减弱,可能出现趋势反转的可能性。

相反,当股价下跌时,成交量应该相应下降,如果股价下跌但成交量上升,则意味着市场上卖盘力量减弱,可能也会出现趋势反转的可能性。

基于上述逻辑,通达信量价背离决策指标提供了底部背离(即股价下跌,成交量上升)和顶部背离(即股价上涨,成交量下降)的判断,并根据背离现象的强度判断背离的有效性。

具体而言,当底部背离强度大于背离低点的0.618倍时,可以认为出现了底部背离;当顶部背离强度大于背离高点的0.618倍时,可以认为出现了顶部背离。

通达信四彩K线KDJ+三底背离主图指标公式

通达信四彩K线KDJ+三底背离主图指标公式

A:=MA(CLOSE,17)+ABS(MA(CLOSE,17)-REF(MA(CLOSE,17),1));B:=MA(CLOSE,17)+MA(CLOSE,17)-REF(MA(CLOSE,17),1);分水岭:=IF(MA(CLOSE,17)<B,B,MA(CLOSE,17)),COLORFF00FF,LINETHICK1; PMA:=分水岭;DD1:=分水岭<REF(分水岭,1);操作线:=分水岭-(EMA(C,3)-分水岭),COLOR00FFFF,LINETHICK1;S:=(PMA>操作线);PM:=MA(C,5),COLORFFFFCC,LINETHICK1;{IF(PM>REF(PM,1),PM,DRAWNULL),COLORRED,LINETHICK1;IF(PM=REF(PM,1),PM,DRAWNULL),COLORRED;IF(PM<REF(PM,1),PM,DRAWNULL),COLORFF9900,LINETHICK1;}DRAWTEXT(CROSS(分水岭,操作线),分水岭-0.1,三底背离);A1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));B1:=REF(C,A1+1)>C AND REF("MACD.DIF",A1+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA");DRAWTEXT(B1>0,L-0.02,M底背离),COLOR00FFFF;A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K",A2+1)<"KDJ.K" ANDCROSS("KDJ.K","KDJ.D");DRAWTEXT(B2,L-0.10,K底背离),COLORFF00FF;A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");DRAWTEXT(B3>0,L-0.18,R底背离),COLOR0000FF;C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));D1:=REF(C,C1+1)<C AND REF("MACD.DIF",C1+1)>"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF");DRAWTEXT(D1>0,H+0.16,M顶背离),COLOR00FF00;C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));D2:=REF(C,C2+1)<C AND REF("KDJ.K",C2+1)>"KDJ.K" ANDCROSS("KDJ.D","KDJ.K");DRAWTEXT(D2>0,H+0.08,K顶背离),COLORFFFFCC;C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1");DRAWTEXT(D3>0,H+0.04,R顶背离),COLORFF9900;零轴:=DYNAINFO(3)*1,COLOR0000FF;STICKLINE(1,90/100+零轴,90/100+零轴,2,0),COLOR00BBBB;STICKLINE(1,10/100+零轴,10/100+零轴,2,0),COLOR0000BB;STICKLINE(1,100/100+零轴,100/100+零轴,2,0),COLORBBBBBB;STICKLINE(1,50/100+零轴,50/100+零轴,2,0),COLORFF0000;STICKLINE(1,0/100+零轴,0/100+零轴,2,0),COLORBBBB00;RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100+50/100; K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;KK:=零轴+K/100;DD:=零轴+D/100;JJ:=零轴+J/100;EE:=50/100+零轴;DRAWBAND(KK,RGB(200,0,150),EE,RGB(0,170,120));DRAWBAND(JJ,RGB(220,0,0),KK,RGB(120,120,170));DRAWKLINE(H,O,L,C);AAA:=JJ>=KK AND KK>=EE;BBB:=JJ>=KK AND KK<EE;DDD:=JJ<KK AND KK>=EE;EEE:=JJ<KK AND KK<EE;STICKLINE(AAA,H,L,0,0),COLOR0000FF;STICKLINE(BBB,H,L,0,0),COLORFF00FF;STICKLINE(DDD,H,L,0,0),COLOR00FFFF;STICKLINE(EEE,H,L,0,0),COLORFFFF00;STICKLINE(AAA,CLOSE,OPEN,3.2,0),COLOR000099;STICKLINE(AAA,CLOSE,OPEN,1.8,0),COLOR0000BB;STICKLINE(AAA,CLOSE,OPEN,1.3,0),COLOR0000DD;STICKLINE(AAA,CLOSE,OPEN,0.5,0),COLOR0000FF;STICKLINE(BBB,CLOSE,OPEN,3.2,0),COLOR990099;STICKLINE(BBB,CLOSE,OPEN,1.8,0),COLORAA00AA;STICKLINE(BBB,CLOSE,OPEN,1.3,0),COLORDD00DD;STICKLINE(BBB,CLOSE,OPEN,0.5,0),COLORFF00FF;STICKLINE(DDD,C,O,3.2,0),COLOR009999;STICKLINE(DDD,C,O,2.4,0),COLOR00BBBB;STICKLINE(DDD,C,O,1.0,0),COLOR00DDDD;STICKLINE(DDD,C,O,0.6,0),COLOR00FFFF;STICKLINE(EEE,C,O,3.2,0),COLOR999900;STICKLINE(EEE,C,O,1.6,0),COLORBBBB00;STICKLINE(EEE,C,O,1.0,0),COLORDDDD00;STICKLINE(EEE,C,O,0.5,0),COLORFFFF00;LC:=REF(CLOSE,1);RSI1:=SMA(MAX(CLOSE-LC,0),3,1)/SMA(ABS(CLOSE-LC),3,1)*100; SELL2:=(CROSS(88,RSI1));DRAWTEXT(SELL2,HIGH*1.02,←卖),COLOR00FF00;VB1:=C-REF(C,1);VB2:=100*EMA(EMA(VB1,6),6)/EMA(EMA(ABS(VB1),6),6);VB3:=IF(LLV(VB2,2)=LLV(VB2,7) AND COUNT(VB2<0,2) AND CROSS(VB2,MA(VB2,2)),1,0);VB4:=FILTER(VB3=1,5);DRAWTEXT(VB4,LOW*0.98,←买),COLOR00FFFF;DRAWTEXT_FIX(1,0,0,0,HYBLOCK);威廉波段:=100-(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34))*100;威廉风险:=IF(威廉波段>95,(100/100+零轴)-(100/100+零轴)*0.009,100/100+零轴),C OLOR00FFFF,LINETHICK0;DRAWBAND(100/100+零轴,RGB(220,220,0),威廉风险,RGB(0,0,0));WLDB:=IF(威廉波段<5,(0/100+零轴)+(0/100+零轴)*0.009,0/100+零轴),COLORFFFF 00,LINETHICK1;DRAWBAND(WLDB,RGB(0,220,220),0/100+零轴,RGB(0,0,0));DRAWTEXT_FIX(1,0.05,0.0,0,【彩色K线标识】★★红色柱---J大于K并在中轴上★★黄色柱--J小于K并在中轴上★★ ),COLORFFFFFF;DRAWTEXT_FIX(1,0.05,0.035,0,【彩色K线标识】★★粉色柱---J大于K并在中轴下★★青色柱--J小于K并在中轴下★★ ),COLOR00FFFF;DRAWTEXT_FIX(1,0.05,0.07,0,【彩色三角型标识】★★青色三角形---威廉底部★★黄色三角形--威廉顶部★★ ),COLORFFFF00;ZGB:VOL*100/HSCOL.HSCOL,NODRAW;DRAWTEXT(ZGB-REF(ZGB,1)>50,H,解禁日)COLORGREEN;MA30生命线:MA(C,30)LINETHICK1,COLORWHITE;MA60牛熊线:MA(C,60)LINETHICK1,COLORRED;黄金线:(EMA(C,18)),POINTDOT,LINETHICK5,COLORYELLOW;MA43神奇线:MA(C,43)POINTDOT,LINETHICK5,COLORGREEN;_10日涨跌%: (C-REF(CLOSE,10))/REF(CLOSE,10)*100,COLORGREEN,NODRAW; 涨家数:INDEXADV,COLOR0080FF,NODRAW;跌家数:INDEXDEC,COLORGREEN,NODRAW;涨停:C+0.05>=(ROUND(REF(C,1)*(100+10*(2-NAMELIKE(ST))/2))/100),COLOR00 80FF,NODRAW;跌停:C-0.05<=(ROUND(REF(C,1)*(100-10*(2-NAMELIKE(ST))/2))/100),COLORGR EEN,NODRAW;Z1:=STRCAT(HYBLOCK, );Z2:=STRCAT(Z1,FGBLOCK);Z3:=STRCAT(Z2,DYBLOCK);Z4:=STRCAT(Z3, );DRAWTEXT_FIX(ISLASTBAR,0.00,0.99,0,STRCAT(Z4,GNBLOCK)),COLORYELLO W;TOTAL:=IF(PERIOD=1,5,IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(P ERIOD=5,240,1)))));MTIME:=MOD(FROMOPEN,TOTAL);CTIME:=IF(MTIME<0.5,TOTAL,MTIME);VV:=IF(CURRBARSCOUNT=1,VOL*TOTAL/CTIME,V);N9:=120;A100:=CONST(HHV(H,N9)-LLV(L,N9))/CONST(HHV(VV,N9));B100:=CONST(LLV(L,N9))-CONST(HHV(VV,N9))*A100/8;天数:=10;STICKLINE(CURRBARSCOUNT=1 && (SETCODE=0 ||SETCODE=1),B100+VV*A100/8,B100,-1,-1),COLOR00C0C0;STICKLINE(C>=O ANDCURRBARSCOUNT<=天数,B100+VV*A100/8,B100,3,1),COLOR3232FF; STICKLINE(C<O ANDCURRBARSCOUNT<=天数,B100+VV*A100/8,B100,3,0),COLORFFFF54; DRAWRECTREL(0,580,100,960,RGB(150,0,0));DRAWRECTREL(100,580,200,960,RGB(0,150,150));DRAWRECTREL(200,725,300,960,RGB(150,0,150));日K:="KD.K"(9,3,3);日D:="KD.D"(9,3,3);月K:="KDJ.K#MONTH"(9,3,3);月D:="KDJ.D#MONTH"(9,3,3);周K:="KDJ.K#WEEK"(9,3,3);周D:="KDJ.D#WEEK"(9,3,3);DRAWTEXT_FIX(ISLASTBAR,0.04,0.60,0,KDJ ),COLOR00FFFF;DRAWTEXT_FIX(ISLASTBAR,0.01,0.65,0,日K=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.05,0.65,0,日K),COLORFFFFFF;DRAWTEXT_FIX(ISLASTBAR,0.01,0.7,0,日D=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.05,0.7,0,日D),COLORFFFFFF;DRAWTEXT_FIX(ISLASTBAR,0.01,0.75,0,周K=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.05,0.75,0,周K),COLORFFFFFF;DRAWTEXT_FIX(ISLASTBAR,0.01,0.8,0,周D=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.05,0.8,0,周D),COLORFFFFFF;DRAWTEXT_FIX(ISLASTBAR,0.01,0.85,0,月K= ),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.05,0.85,0, 月K),COLORFFFFFF; DRAWTEXT_FIX(ISLASTBAR,0.01,0.9,0,月D=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.05,0.9,0,月D),COLORFFFFFF;日DIF:="MACD.DIF"(12,26,9);日DEA:="MACD.DEA"(12,26,9);周DIF:="MACD.DIF#WEEK"(12,26,9);周DEA:="MACD.DEA#WEEK"(12,26,9);月DIF:="MACD.DIF#MONTH"(12,26,9);月DEA:="MACD.DEA#MONTH"(12,26,9);DRAWTEXT_FIX(ISLASTBAR,0.13,0.60,0,MACD ),COLOR00FFFF;DRAWTEXT_FIX(ISLASTBAR,0.11,0.65,0,日DIF=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.155,0.65,0,日DIF),COLORFFFFFF; DRAWTEXT_FIX(ISLASTBAR,0.11,0.7,0,日DEA=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.155,0.7,0,日DEA),COLORFFFFFF; DRAWTEXT_FIX(ISLASTBAR,0.11,0.75,0,周DIF=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.155,0.75,0,周DIF),COLORFFFFFF; DRAWTEXT_FIX(ISLASTBAR,0.11,0.8,0,周DEA=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.155,0.8,0,周DEA),COLORFFFFFF;DRAWTEXT_FIX(ISLASTBAR,0.11,0.85,0,月DIF= ),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.155,0.85,0, 月DIF),COLORFFFFFF;DRAWTEXT_FIX(ISLASTBAR,0.11,0.9,0,月DEA=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.155,0.9,0,月DEA),COLORFFFFFF;TYP:=(HIGH+LOW+CLOSE)/3;日CCI:=(TYP-MA(TYP,84))/(0.015*AVEDEV(TYP,84));周CCI:=(TYP-MA(TYP,21))/(0.015*AVEDEV(TYP,21));月CCI:=(TYP-MA(TYP,9))/(0.015*AVEDEV(TYP,9));DRAWTEXT_FIX(ISLASTBAR,0.235,0.75,0,CCI),COLOR00FFFF;DRAWTEXT_FIX(ISLASTBAR,0.206,0.80,0,日CCI=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.250,0.80,0,日CCI),COLORFFFFFF;DRAWTEXT_FIX(ISLASTBAR,0.206,0.85,0,周CCI=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.250,0.85,0,周CCI),COLORFFFFFF;DRAWTEXT_FIX(ISLASTBAR,0.206,0.90,0,月CCI=),COLORFFFFFF;DRAWNUMBER_FIX(ISLASTBAR,0.250,0.90,0,月CCI),COLORFFFFFF;A1000:=REF(C,1);涨停A:=IF((C-A1000)*100/A1000>=(10-0.01*100/A1000),1,0);跌停A:=IF((A1000-C)*100/A1000>=(10-0.01*100/A1000),1,0);涨停次数:=COUNT(涨停A,BARSSINCE(涨停A)+1);跌停次数:=COUNT(跌停A,BARSSINCE(跌停A)+1);DRAWNUMBER(涨停A,HIGH*1.04,涨停次数),COLORYELLOW;DRAWNUMBER(跌停A,HIGH*1.04,跌停次数),COLORCYAN;DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.62,0.95,0,涨停次数),COLORYELLOW ;DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.72,0.95,0,跌停次数),COLORCYAN; DRAWTEXT_FIX(CURRBARSCOUNT=1,0.55,0.95,0,上市以来共涨停:),COLORYEL LOW;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.65,0.95,0,上市以来共跌停:),COLORCYA N;涨停K线:=IF((C-A1000)*100/A1000>=(10-0.01*100/A1000),1,0);跌停K线:=IF((A1000-C)*100/A1000>=(10-0.01*100/A1000),1,0);。

【股票指标公式下载】-【通达信】真正背离(底背离、顶背离、macd、kdj、rsi)

【股票指标公式下载】-【通达信】真正背离(底背离、顶背离、macd、kdj、rsi)

【通达信】真正背离(底背离、顶背离、macd、kdj、rsi)-指标公式源码{参数N为5,10,5}DIFIF1:=EMA(CLOSE,12) - EMA(CLOSE,26);DEAEA1:=EMA(DIFIF1,9);MACD1:=2*(DIFIF1-DEAEA1),STICK;MACD2:=EMA(MACD1,3);STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLORRED; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORGREEN; STICKLINE(MACD1<MACD2,0,MACD1,1,0),COLORCBCBC0;STICKLINE(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE;DIFIF1,COLOR33FF33,LINETHICK2;DEAEA1,COLORYELLOW,LINETHICK2;MACD:MACD1,NODRAW,COLORMAGENTA;强:IF(DIFIF1>=DEAEA1,DIFIF1,DRAWNULL),COLORRED,LINETHICK2;弱:=IF(DEAEA1>=DIFIF1,DEAEA1,DRAWNULL),COLORFF9900,LINETHICK2; DRAWICON(CROSS(DIFIF1,DEAEA1),DIFIF1+0.1,1);DRAWICON(CROSS(DEAEA1,DIFIF1),0.4,2);A1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));B1:=REF(C,A1+1)>C AND REF("MACD.DIF",A1+1)<"MACD.DIF" ANDCROSS("MACD.DIF","MACD.DEA");DRAWTEXT(B1>0,-0.8,'MACD底背'),COLORFF00FF;A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K",A2+1)<"KDJ.K" ANDCROSS("KDJ.K","KDJ.D");DRAWTEXT(B2,-0.6,'KDJ底离'),COLORYELLOW;{KDJ底背离};A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" ANDCROSS("RSI.RSI1","RSI.RSI2");DRAWTEXT(B3>0,-0.3,'RSI底离'),COLORCYAN;{RSI底背离};C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));D1:=REF(C,C1+1)<C AND REF("MACD.DIF",C1+1)>"MACD.DIF" ANDCROSS("MACD.DEA","MACD.DIF");DRAWTEXT(D1>0,0.4,'MACD顶离'),COLORBLUE;{MACD顶背离}C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));D2:=REF(C,C2+1)<C AND REF("KDJ.K",C2+1)>"KDJ.K" ANDCROSS("KDJ.D","KDJ.K");DRAWTEXT(D2>0,0.6,'KDJ顶离'),COLORLIGRAY;{KDJ顶背离}C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" ANDCROSS("RSI.RSI2","RSI.RSI1");DRAWTEXT(D3>0,0.8,'RSI顶离'),COLORGREEN;{RSI顶背离};【通达信】真正背离(底背离、顶背离、macd、kdj、rsi)-指标公式效果图(文档来源:若水财经社区)。

通达信实用macd真正的MACD背离公式

通达信实用macd真正的MACD背离公式

通达信实用macd真正的MACD背离公式DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);macd:(DIF-DEA)*2,COLORSTICK;{底部信号}BB值:=EMA(100*(C-LLV(LOW,34))/(HHV(H,34)-LLV(LOW,34)),3);AAA:=EMA(CLOSE,12)-EMA(CLOSE,26);DRAWTEXT(CROSS(BB值,9),0, '‘底部'),COLORYELLOW;DRAWICON(CROSS(BB值,9),0,41);STICKLINE(CROSS(BB值,9),AAA,0,2,0),COLORYELLOW;{DRAWICON(REF(DIF,1)>REF(DIF,2) AND DIF<REF(DIF,1) AND DIF>0 AND DIF>DEA,DIF*1.1,2),COLORGREEN;DRAWICON(CROSS(DEA,DIF) AND DIF>0,DIF,37),COLORGREEN;DRAWICON(REF(DIF,1)<REF(DIF,2) AND DIF>REF(DIF,1) AND DIF<0 AND DIF<DEA,DIF*1.1,1),COLORRED;DRAWICON(CROSS(DIF,DEA) AND DIF<0,DIF,36),COLORRED;} X_2:=BARSLAST(REF(MACD,1)<0 AND MACD>0);X_3:=LLVBARS(MACD,X_2+20);X_4:=IF(X_3>X_2,REF(MACD,X_3),0);X_5:=MACD<0 AND MACD>X_4 AND LOW=LLV(LOW,X_2+20) AND X_4<0;X_6:=REF(X_5,1)=1 AND MACD>REF(MACD,1) AND REF(DIF,X_3)<0 AND MACD<0;低背:DRAWLINE(X_4=X_3,MACD,X_6,MACD,0),COLORRED,LINETHI CK2;DRAWICON(X_6,MACD*1.2,26);X_7:=HHVBARS(MACD,X_2+20);X_8:=IF(X_7>X_2,REF(MACD,X_7),0);X_9:=MACD>0 AND MACD<X_8 AND HIGH=HHV(HIGH,X_2+20) AND X_8>0;X_10:=REF(X_9,1)=1 AND MACD>REF(MACD,1) AND REF(DIF,X_7)>0;顶背:DRAWLINE(X_8=X_7,MACD,X_10,MACD,0),COLORGREEN,LINE THICK2;DRAWICON(X_10,MACD*1.2,15);X_11:=CLOSE/MA(CLOSE,40)*100<78;X_12:=CLOSE/MA(CLOSE,60)*100<74;X_13:=HIGH>LOW*1.051;X_14:=X_13 AND COUNT(X_13,5)>1;X_15:=IF(X_14 AND (X_11 OR X_12),2,0);X_16:=CLOSE/REF(CLOSE,25)<=1.1;X_17:=SMA(MAX(CLOSE-REF(CLOSE,2),0),7,1)/SMA(ABS(CLOSE-REF(CLOSE,2)),7,1)*100<15;X_18:=(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100;X_19:=SMA(X_18,2,1);X_20:=SMA(X_19,2,1);X_21:=IF(X_19>REF(X_19,1) AND REF(X_19,1)<REF(X_19,2) AND X_19<23,1.5,0);抄底:X_16 AND X_15 AND X_17 AND X_21 ,COLORWHITE;{X_22:=100-100*(HHV(HIGH,5*8)-CLOSE)/(HHV(HIGH,5*8)-LLV(LOW,5*8));X_23:=MA(CLOSE,5);X_24:=IF(CLOSE>SAR(10,2,20),1,0);X_25:=IF(CLOSE<SAR(10,2,20),(-1),0);X_26:=ATAN((X_23/REF(X_23,1)-1)*100)*180/3.1416;X_27:=IF(X_26>30,1,0);X_28:=IF(X_26<(-30),(-1),0);X_29:=X_24+X_27+X_25+X_28;}{线变色}{IF(X_29<(-1) OR X_22<25.01,DIF,DRAWNULL),COLORGREEN,LINETHICK1;IF(X_22>74.989998 OR X_29>0,DIF,DRAWNULL),COLORRED,LINETHICK1;}VA1:=HHVBARS(MACD,BARSLAST(MACD<0)+1);VA2:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR AND MACD>0),REF(VA1,1)+2),0.5);前高:DRAWLINE(VA2,MACD,REF(VA2,1),REF(MACD,1),1),COLORYEL LOW,POINTDOT ;VA3:=LLVBARS(MACD,BARSLAST(MACD>0)+1);VA4:=CROSS(BACKSET(CROSS(MACD,0) OR (ISLASTBAR AND MACD<0),REF(VA3,1)+2),0.5);前低:DRAWLINE(VA4,MACD,REF(VA4,1),REF(MACD,1),1),COLORYEL LOW,POINTDOT ;启动点:=MACD<0 AND MACD>REF(MACD ,1) AND REF(MACD ,1)<REF(MACD ,2)AND REF(MACD ,2)<REF(MACD ,3)AND REF(MACD ,3)<REF(MACD ,4);STICKLINE(启动点,0.2,MACD,0.3,0),COLORYELLOW COLORYELLOW;{STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1.8,0),COLOR000055;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1.1,0),COLOR000099;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0.6,0),COLOR0000BB;}启动点A:0,COLORYELLOW;{DRAWICON(启动点,2,11);}{MACD&KDJ 金叉共振}{DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);}RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9));K:=SMA(RSV,9,3),NODRAW;D:=SMA(K,9,3),NODRAW;J:=3*K-2*D,NODRAW;A:=CROSS(DIF,DEA) AND CROSS(K,D) AND CROSS(J,D);DRAWICON(A,DEA*1.2,25);DRAWTEXT(A,DEA*1.2, ' 金叉共振'),COLORYELLOW;0,COLORGRAY,DOTLINE;{RSI买入}WRSI:=SMA(MAX(CLOSE-REF(CLOSE,1),0),6,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),6,1)*100;相对强弱RSI买入:=CROSS(WRSI,20),STICK,LINETHICK2,COLORYELLOW;{RSI买入:STICKLINE(CROSS(WRSI,20),0,70,0,0),LINETHICK2,COLORYELL OW;}STICKLINE(相对强弱RSI买入,0-0.1,MACD-0.1,0.3,0),COLORRED;DRAWTEXT(相对强弱RSI买入,MACD-0.1, '‘入'),COLORYELLOW;{背离}A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");DRAWTEXT(B3>0,-0.3,'RSI底离'),COLORCYAN;{RSI底背离};C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1");DRAWTEXT(D3>0,0.5,'RSI顶离'),COLORGREEN;{RSI顶背离};。

通达信实用背离指标公式

通达信实用背离指标公式

通达信实用背离指标公式来源:Internet,编辑:股旁网,2017-01-11 {MACD背离}DIFF:EMA(CLOSE,12) - EMA(CLOSE,26); DEA:EMA(DIFF,9);MACD:2*(DIFF-DEA),COLORSTICK,DRAWABOVE;MACD金叉:=BARSLAST(REF(CROSS(DIFF,DEA),1)); MACD死叉:=BARSLAST(REF(CROSS(DEA,DIFF),1)); MACD上次金叉:=SUMBARS(REF(CROSS(DIFF,DEA),1),2); MACD上次死叉:=SUMBARS(REF(CROSS(DEA,DIFF),1),2); {MACD底背离}MACD次低点:=LLV(DIFF,MACD金叉);MACD最低点:=LLV(DIFF,MACD上次死叉); MACD底背离:=REF(CLOSE,MACD金叉+1)>CLOSE AND MACD次低点>MACD最低点AND CROSS(DIFF,DEA);DRAWLINE(MACD金叉=0,DEA,MACD底背离,DEA,0),COLORRED,LINETHICK2;{MACD顶背离}MACD次高点:=HHV(DIFF,MACD金叉);MACD最高点:=HHV(DIFF,MACD上次金叉); MACD顶背离:=REF(CLOSE,MACD死叉+1)<CLOSE AND MACD次高点<MACD最高点AND CROSS(DEA,DIFF);DRAWLINE(MACD死叉=0,DEA,MACD顶背离,DEA,0),COLORGREEN,LINETHICK2;红面积:SUM(MACD,BARSLAST(MACD<0))*(MACD>0 ),COLOR0000FF,NODRAW;绿面积:SUM(MACD,BARSLAST(MACD>0))*(MACD<0 ),COLORFFFF00,NODRAW;AA:=ROUND(REF(绿面积,1)*100);BB:=ROUND(REF(红面积,1)*100); DRAWNUMBER(CROSS(0,MACD),0.04,ABS(BB)),COLORMAGENTA;DRAWNUMBER(CROSS(MACD,0),-0.01,ABS(AA) ),COLORGREEN;{CCI}TYP:=(HIGH+LOW+CLOSE)/3;CCI:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,1 4));{BOLL}BOLL:=MA(CLOSE,20);UB:=BOLL+2*STD(CLOSE,20);LB:=BOLL-2*STD(CLOSE,20);{KDJ}RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV (LOW,9))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;PP:=CCI<-160 AND CLOSE<LB AND J<20; QQ:=CCI>160 AND J>100;{KDJ中J值在0-90间为黄色,小于0为绿色,大于90为红色}{显示J值和CCI值}{CCI值小于160且收盘价在BOLL下轨一下,J值小于20为红色箭头,CCI大于160且J值大于100为绿色箭头}DRAWICON(QQ,0,2);DRAWICON(PP,0,1);KDJ金叉:=BARSLAST(REF(CROSS(J,D),1));KDJ死叉:=BARSLAST(REF(CROSS(D,J),1));KDJ上次金叉:=SUMBARS(REF(CROSS(J,D),1),2); KDJ上次死叉:=SUMBARS(REF(CROSS(D,J),1),2); {KDJ底背离}AAA1:=BARSLAST(REF(CROSS(J,D),1));KDJ次低点:=LLV(J,AAA1);KDJ最低点:=LLV(J,KDJ上次死叉);KDJ底背离:=REF(CLOSE,AAA1+1)>CLOSE AND KDJ次低点>KDJ最低点AND CROSS(J,D); DRAWTEXT(KDJ底背离,MACD,'KDJ底'),COLORRED;STICKLINE(KDJ底背离,MACD,0,2,0),COLORRED;{KDJ顶背离}BBB1:=BARSLAST(REF(CROSS(D,J),1));KDJ次高点:=HHV(J,AAA1);KDJ最高点:=HHV(J,KDJ上次金叉);KDJ顶背离:=REF(CLOSE,BBB1+1)<CLOSE AND KDJ次高点<KDJ最高点AND CROSS(D,J); DRAWTEXT(KDJ顶背离,MACD,'KDJ顶'),COLORGREEN;STICKLINE(KDJ顶背离,MACD,0,2,0),COLORGREEN;{九转}A1:=C>=REF(C,4);A2:=C<REF(C,4);A3:=C<REF(C,4) AND REF(A1,1);T:=BARSLAST(A3),NODRAW;M0:=(T=0 AND REFX(T=1 AND NOT(A2),1)) OR (REFX(T=2 AND NOT(A2),2)) OR (REFX(T=3 AND NOT(A2),3)) OR (REFX(T=4 ANDNOT(A2),4)) OR (REFX(T=5 AND NOT(A2),5)) OR (REFX(T=6 AND NOT(A2),6)) OR (REFX(T=7AND NOT(A2),7)) OR (REFX(T=8 ANDNOT(A2),8));M1:=T=1 AND REFX(T=2 AND NOT(A2),1) OR (REFX(T=3 AND NOT(A2),2)) OR (REFX(T=4 AND NOT(A2),3)) OR (REFX(T=5 ANDNOT(A2),4)) OR (REFX(T=6 AND NOT(A2),5)) OR (REFX(T=7 AND NOT(A2),6)) OR (REFX(T=8 AND NOT(A2),7));M2:=T=2 AND REFX(T=3 AND NOT(A2),1) OR (REFX(T=4 AND NOT(A2),2)) OR (REFX(T=5 AND NOT(A2),3)) OR (REFX(T=6 ANDNOT(A2),4)) OR (REFX(T=7 AND NOT(A2),5)) OR (REFX(T=8 AND NOT(A2),6));M3:=T=3 AND REFX(T=4 AND NOT(A2),1)OR (REFX(T=5 AND NOT(A2),2)) OR (REFX(T=6 AND NOT(A2),3)) OR (REFX(T=7 ANDNOT(A2),4)) OR (REFX(T=8 AND NOT(A2),5)); M4:=T=4 AND REFX(T=5 AND NOT(A2),1) OR (REFX(T=6 AND NOT(A2),2)) OR (REFX(T=7 AND NOT(A2),3)) OR (REFX(T=8 ANDNOT(A2),4));M5:=T=5 AND REFX(T=6 AND NOT(A2),1) OR (REFX(T=7 AND NOT(A2),2)) OR (REFX(T=8 AND NOT(A2),3));M6:=T=6 AND REFX(T=7 AND NOT(A2),1) OR (REFX(T=8 AND NOT(A2),2));M7:=T=7 AND REFX(T=8 AND NOT(A2),1);N0:=T=1 AND REF(T=0 AND A3,1) AND A2; N1:=T=2 AND REF(N0,1) AND A2;N2:=T=3 AND REF(N1,1) AND A2;N3:=T=4 AND REF(N2,1) AND A2;N4:=T=5 AND REF(N3,1) AND A2;N5:=T=6 AND REF(N4,1) AND A2;N6:=T=7 AND REF(N5,1) AND A2;N7:=T=8 AND REF(N6,1) AND A2;WZD:=DEA;WZG:=DEA;DRAWTEXT(N6 ANDNOT(M7),WZD,'8'),COLORGREEN; DRAWTEXT(N7,WZG,'9'),COLORMAGENTA;B1:=C<=REF(C,4);B2:=C>REF(C,4);B3:=C>REF(C,4) AND REF(B1,1);T1:=BARSLAST(B3),NODRAW;M8:=(T1=0 AND REFX(T1=1 AND NOT(B2),1)) OR (REFX(T1=2 AND NOT(B2),2)) OR(REFX(T1=3 AND NOT(B2),3)) OR (REFX(T1=4 AND NOT(B2),4)) OR (REFX(T1=5 ANDNOT(B2),5)) OR (REFX(T1=6 AND NOT(B2),6)) OR (REFX(T1=7 AND NOT(B2),7)) OR(REFX(T1=8 AND NOT(B2),8));M9:=T1=1 AND REFX(T1=2 AND NOT(B2),1) OR (REFX(T1=3 AND NOT(B2),2)) OR (REFX(T1=4 AND NOT(B2),3)) OR (REFX(T1=5 ANDNOT(B2),4)) OR (REFX(T1=6 AND NOT(B2),5)) OR (REFX(T1=7 AND NOT(B2),6)) OR(REFX(T1=8 AND NOT(B2),7));M10:=T1=2 AND REFX(T1=3 AND NOT(B2),1) OR (REFX(T1=4 AND NOT(B2),2)) OR(REFX(T1=5 AND NOT(B2),3)) OR (REFX(T1=6AND NOT(B2),4)) OR (REFX(T1=7 ANDNOT(B2),5)) OR (REFX(T1=8 AND NOT(B2),6)); M11:=T1=3 AND REFX(T1=4 ANDNOT(B2),1)OR (REFX(T1=5 AND NOT(B2),2)) OR (REFX(T1=6 AND NOT(B2),3)) OR(REFX(T1=7 AND NOT(B2),4)) OR (REFX(T1=8 AND NOT(B2),5));M12:=T1=4 AND REFX(T1=5 AND NOT(B2),1) OR (REFX(T1=6 AND NOT(B2),2)) OR(REFX(T1=7 AND NOT(B2),3)) OR (REFX(T1=8 AND NOT(B2),4));M13:=T1=5 AND REFX(T1=6 AND NOT(B2),1) OR (REFX(T1=7 AND NOT(B2),2)) OR(REFX(T1=8 AND NOT(B2),3));M14:=T1=6 AND REFX(T1=7 AND NOT(B2),1) OR (REFX(T1=8 AND NOT(B2),2));M15:=T1=7 AND REFX(T1=8 AND NOT(B2),1); N8:=T1=1 AND REF(T1=0 AND B3,1) AND B2; N9:=T1=2 AND REF(N8,1) AND B2;N10:=T1=3 AND REF(N9,1) AND B2;N11:=T1=4 AND REF(N10,1) AND B2;N12:=T1=5 AND REF(N11,1) AND B2;N13:=T1=6 AND REF(N12,1) AND B2;N14:=T1=7 AND REF(N13,1) AND B2;N15:=T1=8 AND REF(N14,1) AND B2; DRAWTEXT(N14 ANDNOT(M15),WZG,'8'),COLOR9900CC; DRAWTEXT(N15 ,WZD,'9'),COLORGREEN;。

通达信实用背离指标公式

通达信实用背离指标公式

通达信实用背离指标公式通达信是国内知名的股票软件,提供了多种技术指标供股民使用。

背离指标是其中一种非常实用的指标,能够帮助投资者发现股票价格与技术指标之间的背离现象,提醒投资者进行操作。

下面将介绍通达信中两个实用的背离指标以及其计算公式。

一、KDJ随机指标背离KDJ指标是一种常用的技术指标,根据收盘价与前一日最高价和最低价的比较来计算。

通达信中的KDJ指标包含三条线:K线,D线和J线。

当价格与KDJ指标出现背离时,表示股票价格可能会发生反转。

KDJ指标背离有两种情况:顶背离和底背离。

1.1顶背离顶背离是指股票价格创出新高,而KDJ指标却没有创出新高。

顶背离暗示着股票价格可能上涨动力不足,可能会出现回调。

KDJ顶背离的计算公式如下:K顶背离=HHV(HIGH,n)>HHV(HIGH,m)&&K<REF(K,m)&&K>REF(K,n)D顶背离=HHV(HIGH,n)>HHV(HIGH,m)&&D<REF(D,m)&&D>REF(D,n)J顶背离=HHV(HIGH,n)>HHV(HIGH,m)&&J<REF(J,m)&&J>REF(J,n)其中,n为计算顶背离时的窗口大小,m为计算之前的窗口大小。

1.2底背离底背离是指股票价格创出新低,而KDJ指标却没有创出新低。

底背离暗示着股票价格可能下跌动力不足,可能会出现反弹。

KDJ底背离的计算公式如下:K底背离=LLV(LOW,n)<LLV(LOW,m)&&K>REF(K,m)&&K<REF(K,n)D底背离=LLV(LOW,n)<LLV(LOW,m)&&D>REF(D,m)&&D<REF(D,n)J底背离=LLV(LOW,n)<LLV(LOW,m)&&J>REF(J,m)&&J<REF(J,n)其中,n为计算底背离时的窗口大小,m为计算之前的窗口大小。

通达信2指标——顶底背离(主图)

通达信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;。

通达信主图背离(附源码)

通达信主图背离(附源码)

通达信主图背离(附源码)通达信主图背离(附源码)AAF:LLV(LOW,34),LINETHICK1,COLORFFFFCC;BBF:MA(AAF,4),LINETHICK1,COLORYELLOW;TYP := (HIGH + LOW + CLOSE)/3;CCI1:=(TYP-MA(TYP,6))/(0.015*AVEDEV(TYP,5));差值1:=ABS(REF(CCI1,1)-CCI1),LINETHICK0;CCI2:=(TYP-MA(TYP,10))/(0.015*AVEDEV(TYP,10));差值2:=ABS(REF(CCI2,1)-CCI2),LINETHICK0;CCI3:=(TYP-MA(TYP,20))/(0.015*AVEDEV(TYP,20));差值3:=ABS(REF(CCI3,1)-CCI3),LINETHICK0;CCI4:=(TYP-MA(TYP,30))/(0.015*AVEDEV(TYP,30));差值4:=ABS(REF(CCI4,1)-CCI4),LINETHICK0;CCI5:=(TYP-MA(TYP,60))/(0.015*AVEDEV(TYP,60));差值5:=ABS(REF(CCI5,1)-CCI5),LINETHICK0;CCI:=CCI1+CCI2+CCI3+CCI4+CCI5;AAA:=(3*C+H+L+O)/6;VAR1:=(8*AAA+7*REF(AAA,1)+6*REF(AAA,2)+5*REF(AAA,3) +4*REF(AAA,4)+3*REF(AAA,5)+2*REF(AAA,6)+REF(AAA,8))/ 36;VAR2:=(HHV(VAR1,5)+HHV(VAR1,10)+HHV(VAR1,20))/3;VAR3:=(LLV(VAR1,5)+LLV(VAR1,10)+LLV(VAR1,20))/3;VAR4:=(HHV(VAR2,5)+HHV(VAR2,10)+HHV(VAR2,20))/3;VAR5:=(LLV(VAR3,5)+LLV(VAR3,10)+LLV(VAR3,20))/3;VAR6:=(LLV(VAR1,2)+LLV(VAR1,4)+LLV(VAR1,6))/3;短线:VAR1,COLORWHITE;中线:VAR6,COLORYELLOW;下跌:IF(VAR1=VAR6,VAR6, DRAWNULL),COLORGREEN;TJ1:= CCI1>差值4;立桩量:=FILTER(TJ1,0),NODRAW;TJ2:=IF(BARSLAST(立桩量)=1 ,1,0);STICKLINE(立桩量 !=1,REF(HIGH,BARSLAST(立桩量)),REF(HIGH,BARSLAST(立桩量)),1,1),COLORCYAN;{STICKLINE(立桩量 !=1,REF(LOW,BARSLAST(立桩量)),REF(LOW,BARSLAST(立桩量)),1,1),COLORCYAN;}成立1:=TJ2=1;条件成立1:=FILTER(成立1,5);DRAWTEXT(条件成立1, REF(HIGH,BARSLAST(立桩量)),'看跌'),COLORLIBLUE;TJ11:= CCI1<-差值4 ;立桩量2:=FILTER(TJ11,0),NODRAW;TJ22:=IF(BARSLAST(立桩量2)=1 AND CLOSE>REF(HIGH,1),1,0);突破2:=TJ22=1;{STICKLINE(CLOSE AND 下跌!= VAR6,REF(HIGH,BARSLAST(立桩量2)),REF(HIGH,BARSLAST(立桩量2)),1,1),COLORYELLOW;}STICKLINE(CLOSE AND 下跌!= VAR6,REF(LOW,BARSLAST(立桩量2)),REF(LOW,BARSLAST(立桩量2)),1,1),COLORYELLOW;TJ:=IF(BARSLAST(立桩量2)=1 AND CLOSE>REF(LOW,1),1,0);成立2:=TJ=1;条件成立2:=FILTER(成立2,5);DRAWTEXT(条件成立2,REF(LOW,BARSLAST(立桩量2)),'看涨'),COLORLIMAGENTA;TJ111:=ABS(CCI1)>CCI AND ABS( 差值1)> ABS(差值5);立桩量3:=FILTER(TJ111,3);TJ3:=IF(BARSLAST(立桩量3)=1 AND CLOSE>REF(LOW,1),1,IF(BARSLAST(立桩量3)=2 ANDCLOSE>REF(LOW,2),1,IF(BARSLAST(立桩量3)=3 AND CLOSE>REF(LOW,3),1,0)));成立:=TJ3=1;条件成立:=FILTER(成立,5);DRAWTEXT(条件成立 AND 下跌!= VAR6,L*0.97,'☆成立');LC:=REF(CLOSE,1);RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);FF:=EMA(CLOSE,3);MA15:=EMA(CLOSE,21);DRAWTEXT(CROSS(FF,MA15),BBF,'底背离'),COLORA6E500;DRAWTEXT(CROSS(88,RSI),(HIGH * 1.02),'顶背离'),COLOR1880FF;X1:=(C+L+H)/3;BB13:=ATAN(EMA(X1,13)-REF(EMA(X1,13),1))*3.1416*10;EMA8:=EMA(C,8);DRAWTEXT(FILTER(BB13>1 AND EMA(X1,13)>REF(EMA(X1,8),1),10),EMA8,'∠45'),COLORWHITE;STICKLINE(1,C,O,2.8,0),COLOR666600;STICKLINE(立桩量,C,O,2.8,0),COLOR0000FF;STICKLINE(1,C,O,0,0),COLORCCCCCC;AA:=IF((CLOSE < 100),CLOSE,(CLOSE / 100));A:=INTPART(((4 * (LOG(AA) / LOG(2))) + 1));B:=((A - 1) / 4);支撑:IF((CLOSE > 100),(POW(2,B) * 100),POW(2,B)),CIRCLEDOT,LINETHICK1,COLORBROWN;压力:IF((CLOSE > 100),(POW(2,(B + (1 / 4))) * 100),POW(2,(B + (1 / 4)))),CIRCLEDOT,LINETHICK1,COLORFF5500;DRAWICON(REF(压力,1)=支撑,L*0.95,1);{DRAWICON(支撑>HHV(H,15),H*1.05,2);}; DRAWTEXT(ISLASTBAR,支撑,'----支撑'),COLOR00AAFF; DRAWTEXT(ISLASTBAR,压力,'----压力'),CORFF5500;。

相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

通达信精准的背离主图指标公式高:=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;。

相关文档
最新文档