通达信MACD底背离选股公式
MACD底背离通达信选股公式
MACD底背叛的通畅信选股公式条件选股公式:macd背叛的公式选股器DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>CANDREF(DIFF,A1+1)<DIFFANDCROSS(DIFF,DEA);FILTER(B1 >0,5)条件选股公式:macd,RSi,kdj 底背叛KDJ_K:=""(9,3,3);KDJ_D:=""(9,3,3);KDJ_J:=""(9,3,3);1:=CROSS(KDJ_J,0)OR(CROSS(KDJ_J,KDJ_K)ANDKDJ_D<26);2:=CROSS(""(6,2,2),20)ORCROSS(""(6,12,24),""(6,12,24));3:=CROSS("","")ORCROSS("",0);0:=买1+买2+买3;:IF(买0>1,买0,0);通畅信弹无虚发{弹无虚发K:100,120,105}VARA:=CLOSE/MA(CLOSE,48)*100<71*K/100;VARB:=CLOSE/MA(CLOSE,50)*100<7 0*K/100;VARC:=HIGH/LOW>K*100;VARD:=VARCANDCOUNT(VARC,4)>2;VAR1:=CLOSE;VAR2:=MA(VAR1,6);VAR3:=MA(VAR1,24);VAR4:=MA(VAR1,32);VAR5:=MA(VAR1,62);VAR6:=MA(VAR1,105);:=VAR5/VAR6*100;发:=VAR4/VAR2*100;中:=VAR3/VAR2*100;财:=VAR2/VAR1*100;入:=CLOSE/COST(8)*100;((发>110/K*100AND入<80*K/100)OR(VARDAND(VARAORVARB)))AND(HIGH>LOW)AND(REF(HIGH,1)>REF(LOW,1))AND(REF( HIGH,2)>REF(LOW,2))AND(REF(HIGH,3)>REF(LOW,3))AND(REF(HIGH,4)>REF(LOW,4))AND(REF(HIGH,5)>REF(LOW,5));1)KDJ和向上运转;张口放大;RSI在20以下钝化一段时间;2)MACD绿线渐渐缩短,且DIF上穿DAE而DEA 也3)日线向SAR聚拢并交错;4)ROC在超卖区上穿MROC而且MROC上行;5)BOLL6)5日线走平并上穿10日线且10日线走平并向上。
macd底背离后金叉选股公式
macd底背离后金叉选股公式
当MACD出现底背离后的金叉时,可以使用以下公式进行选股:
```
DIFF: EMA(CLOSE,8) - EMA(CLOSE, 13) , COLORWHITE;
DEA: EMA(DIFF, 9) , COLORYELLOW;
MACD: 2*(DIFF-DEA) , COLORSTICK;
低位金叉: =CROSS(DIFF, DEA) AND DIFF<-0. 1;
二次金叉: =CROSS(DIFF, DEA) AND DEA<0 AND
COUNT(JCCOUNT=2, 21) =1;
底背离: =REF(CLOSE, A1+1) >CLOSE AND DIFF>REF(DIFF,
A1+1) AND CROSS(DIFF, DEA);
```
其中,DIFF赋值为收盘价的8日指数移动平均减去收盘价的13日指数移动平均,DEA赋值为DIFF的9日指数移动平均。
低位金叉赋值为DIFF上穿DEA且DIFF小于-0.1,二次金叉赋值为DIFF上穿DEA且DEA小于0并且统计JCCOUNT等于2的情况出现21次。
底背离赋值为A1日前一周期的收盘价大于当周期的收盘价并且DIFF大于A1日前一周期的DIFF并且DIFF上穿DEA。
最准确的底背离公式
底背离公式在不同的股票分析软件中可能有所不同。
以通达信和同花顺为例,以下是底背离公式的参考:在通达信中,底背离公式为:* 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。
MACD底背离通达信选股公式
MACD底背离通达信选股公式MACD底背离在实战中有重要的参考价值,值得广大投资者认真研究。
但MACD底背离本身形态变化多端,因此其公式编制较为困难,要根据不同的形态编制不同的选股公式。
一、MACD底背离的主要形态第一种:回拉靠近0轴型存在一个下跌趋势AD,跌至B点反弹到C点时,MACD黄白线回拉到d,靠近而不上穿0轴。
D低于B,但e不低于c,背离形成。
第二种:回升升破0轴型存在一个下跌趋势AD,跌至B点反弹到C点时,MACD黄白线回拉到c,上穿0轴。
D低于B,但d不低于b,背离形成。
第三种:反复纠缠型存在一个下跌趋势AD,跌至B点时,BC之间形成箱体震荡,MACD黄白线反复上穿和跌破0轴。
D低于B,但h不低于b,背离形成。
第四种:背了又背型存在一个下跌趋势AJ,下跌过程中多次反弹,屡创新低。
MACD 黄白线反复回拉至0轴附近但不升破。
股价BDFHJ屡创新低,黄白线低点dfhj逐渐提高,背了又背,最终j点背离形成。
鉴于MACD底背离形态多变,想编制一个公式涵盖所有的底背离形态是很困难的。
实战中,底背离出现后并不能保证马上止跌,底背离后趋势继续下跌的例子屡见不鲜。
上面四种形态中,成功率最高的是第四种“背了又背型”,虽然出现次数不如其他三种频繁,但一旦出现的话,成为长线大牛股的概率较高。
因此,下面就以第四种为例,编制“背了又背型”底背离选股公式。
二、公式编制要求股价处于长期下跌趋势,近日内股价创新低,MACD黄白线波谷低点f、h、j逐渐提高。
当下MACD为红柱,白线在黄线上方。
三、编制思路用股价60日均线斜率判断下跌趋势。
寻找MACD近期3个谷底低点f、h、j,比较3个点DEA(黄线)的高低。
寻找f、h、j三个低点对应的股价F、H、J,比较其股价的高低。
四、公式内容新建一个选股指标,名称为“MACD底背离”。
输入以下代码:A1:=SLOPE(MA(C,60),5);{60日均线的5日斜率}A2:=SLOPE(MACD.DEA,5);{MACD黄线线的5日斜率}B1:=BARSLAST(CROSS(A2,0));{最近1次MACD黄线线拐头向上到现在的周期数}B2:=BARSLAST(CROSS(0,A2));{最近1次MACD黄线线拐头向下到现在的周期数}B3:=B2+REF(B1,B2);{最近第2次MACD黄线线拐头向上到现在的周期数}B4:=B3+REF(B2,B3);{最近第2次MACD黄线线拐头向下到现在的周期数}B5:=B4+REF(B1,B4);{最近第3次MACD黄线线拐头向上到现在的周期数}B6:=B5+REF(B2,B5);{最近第3次MACD黄线线拐头向下到现在的周期数}C1:=REF(MACD.DEA,B1);{最近1次MACD黄线线拐头向上时的DEA值}C3:=REF(MACD.DEA,B3);{最近第2次MACD黄线线拐头向上时的DEA值}C5:=REF(MACD.DEA,B5);{最近第3次MACD黄线线拐头向上时的DEA值}D1:=REF(C,B1);{最近1次MACD黄线线拐头向上时的收盘价} D3:=REF(C,B3);{最近第2次MACD黄线线拐头向上时的收盘价} D5:=REF(C,B5);{最近第3次MACD黄线线拐头向上时的收盘价}D6:=LLV(C,B2);{最近1次MACD黄线线拐头向下到现在的最低收盘价}D7:=LLV(C,B6);{最近3次MACD黄线线拐头向下到现在的最低收盘价}E1:=A1<0;{60日均线向下}E2:=MACD.MACD>0;{当前MACD是红柱}E3:=B1<B2;{最近1次MACD黄线拐头向上迟于拐头向下}E4:=C1>C3 ANDC3>C5;{MACD黄线低点逐波提高}E5:=D1<D3 AND D3<D5;{股价低点逐波降低};E6:=D6=D7;{最近1、3次MACD黄线线拐头向下到现在的最低收盘价相同}E1 AND E2 AND E3 AND E4 ANDE5 AND E6;{选股条件};见下图:五、公式说明:1、SLOPE函数的作用是求均线斜率,斜率小于0时,均线向下;2、BARSLAST函数的作用是最近一次条件成立到当下的周期数;3、用“.”引用MACD指标的各项参数,MACD指红绿柱,DEA 指黄线;4、CROSS函数的作用是金叉;5、REF函数是引用若干周期前的数据;6、LLV函数的作用是求最低值。
macdkdjrsi底背离的通达信选股公式
macdkdjrsi底背离的通达信选股公式MACD底背离的通达信公式1A1:=BARSLAST(REF(CROSS("MACD.DIF"(12,26,9),"MAC D.DEA"(12,26,9)),1));B1:=REF(C,A1+1)>C ANDREF("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底背离:=FILTER(B1>0,5);STICKLINE(MACD底背离,0,0.75,3,0),COLORGREEN;DRAWTEXT(MACD底背离,0.57,'MACD底背离'),COLORGREEN;A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3 )),1));B2:=REF(C,A2+1)>C ANDREF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));KDJ底背离:=FILTER(B2>0,5);STICKLINE(KDJ底背离,0,1,3,0),COLORYELLOW;DRAWTEXT(KDJ底背离,0.80,'KDJ底背离'),COLORYELLOW;A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI 2"(6,12,24)),1));B3:=REF(C,A3+1)>C ANDREF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));RSI底背离:=FILTER(B3>0,5);STICKLINE(RSI底背离,0,0.5,3,0),COLORFFCC66;DRAWTEXT(RSI底背离,0.25,'RSI底背离'),COLORFFCC66;2,COLORRED;C1:=BARSLAST(REF(CROSS("MACD.DEA"(12,26,9),"MAC D.DIF"(12,26,9)),1));D1:=REF(C,C1+1)<C ANDREF("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顶背离:=FILTER(D1>0,5);STICKLINE(MACD顶背离,2,1.25,3,0),COLOR0066FF;DRAWTEXT(MACD顶背离,1.47,'MACD顶背离'),COLOR0066FF;C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3) ),1));D2:=REF(C,C2+1)<C ANDREF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) ANDCROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));KDJ顶背离:=FILTER(D2>0,5);STICKLINE(KDJ顶背离,2,1,3,0),COLORRED;DRAWTEXT(KDJ顶背离,1.2,'KDJ顶背离'),COLORRED;C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI 1"(6,12,24)),1));D3:=REF(C,C3+1)<C ANDREF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));RSI顶背离:=FILTER(D3>0,5);STICKLINE(RSI顶背离,2,1.5,3,0),COLORFF00FF;DRAWTEXT(RSI顶背离,1.75,'RSI顶背离'),COLORFF00FF;底背离:MACD底背离OR KDJ底背离OR RSI底背离;顶背离:MACD顶背离OR KDJ顶背离OR RSI顶背离;底背离选股(MACD,KDJ,RSI){底背离}DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C ANDREF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3 )),1));B2:=REF(C,A2+1)>C ANDREF("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 ANDREF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));底背离:B1>0 OR B2>0 ORB3>0;{集成了MACD、KDJ、RSI三个指标的底背离} MACD底部金叉选股原码:DIFF:=EMA(CLOSE,12)-EMA(CLOSE,27);DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);CROSS(DIFF,DEA) AND DIFF<-0.1;MACD二次金叉原码:DIFF:=EMA(CLOSE,12)-EMA(CLOSE,27);DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA& gt;=0));CROSS(DIFF,DEA) AND DEA<0 ANDCOUNT(JCCOUNT=2,21)=1;MACD底背离原码:DIFF:=EMA(CLOSE,12)-EMA(CLOSE,27);DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA& gt;=0));二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));REF(CLOSE,A1+1)>CLOSE ANDDIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);此公式使用时,一般在MACD底背离时效果较好。
通达信指标公式源码好厉害的MACD背离(通达信副图指标)
好厉害的MACD背离(通达信副图指标)DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORRED,LINETHICK2;DEA:EMA(DIF,9),COLORWHITE,LINETHICK2;持仓段:=0,COLOR00CFFF;空仓段:=0,COLORFFCCFF;STICKLINE(DIF>DEA,-0.5,-0.6,10,1),COLOR00CFFF;STICKLINE(DIF<DEA,-0.5,-0.6,10,1),COLORFFCCFF;MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(((MACD<REF(MACD,1)) AND(MACD>0)),0,MACD,1,0),COLORLIBLUE,LINETHICK2;STICKLINE(((MACD>REF(MACD,1)) AND(MACD<0)),0,MACD,1,0),COLORFF00FF,LINETHICK2;建仓:IF(DIF<0,DIF,0),COLORYELLOW,LINETHICK2;加仓:IF(DIF<0,0,DIF),COLORRED,LINETHICK2;白线破仓:IF(DIF<DEA,DIF,DEA),COLORWHITE,LINETHICK2;趋势强弱:IF(DIF>DEA,DEA,DEA),COLORFF937F,LINETHICK2;AA:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(AA=2,21)=1; DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;A1:=BARSLAST(REF(CROSS(DIF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA); STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4; DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF); 顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;。
【通达信】极品变色MACD(低位金叉、底背离、顶背离)-指标公式
【通达信】极品变色MACD(低位金叉、底背离、顶背离)-指标公式DIFF:EMA(CLOSE,12)-EMA(CLOSE,27);DEA:EMA(DIFF,9);MACD:=2*(DIFF-DEA);STICKLINE(MACD>=0,MACD,0,2,1),COLORF00FF0;STICKLINE(MACD<0,MACD,0,2,1),COLORWHITE;STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR00AAFF; STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR00BBFF; STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR00CCFF; STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR00DDFF; STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR00EEFF; STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR00FFFF; STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR0000AA; STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR0011BB; STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR0022CC; STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR0033DD; STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR0044EE; STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR0055FF; STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORAA00BB; STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORBB11BB; STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORCC22BB; STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORDD33BB; STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLOREE44BB; STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORFF55BB; STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORFFAA00; STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORFFBB11; STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORFFCC22; STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORFFDD33; STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORFFEE44; STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORFFFF55; IF(DIFF<0,DIFF,0),COLORRED,LINETHICK1;IF(DIFF<0,0,DIFF),COLORYELLOW,LINETHICK1;IF(DIFF<DEA,DIFF,DEA),COLOR00FF00,LINETHICK1;IF(DIFF>DEA,DEA,DEA),COLORWHITE,LINETHICK1;低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;STICKLINE(低位金叉,0,-0.18,2,0),COLORYELLOW;DRAWTEXT(低位金叉,-0.1,' 低位金叉'),COLORYELLOW;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1; STICKLINE(二次金叉,0,-0.18,2,0),COLORFF00FF;DRAWICON(二次金叉,DEA*1.04,13) ;DRAWTEXT(二次金叉,-0.1,' 二次金叉'),COLORFF00FF;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);STICKLINE(底背离,0,0.13,2,0),COLOR00FF00;DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2; DRAWTEXT(底背离,0.1,' 底背离'),COLOR00FF00;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;。
通达信DMI,MACD.RSI背离指标公式
通达信DMI,MACD.RSI背离指标公式N:=14;MM:=6;RSV:=(CLOSE-LLV(LOW,10))/(HHV(HIGH,10)-LLV(LOW,10))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA), COLORSTICK;LC:=REF(CLOSE,1);RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;RSI3:=SMA(MAX(CLOSE-LC,0),24,1)/SMA(ABS(CLOSE-LC),24,1)*100;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(CLOSE,A1+1)>CLOSE AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA); MACD底背离:FILTER(B1>0,5);STICKLINE(FILTER(B1>0,5),0,10,1,0),COLOR00FF00;DRAWTEXT(FILTER(B1>0,5),10,'MACD底背'),COLOR00FF00;A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));B3:=REF(CLOSE,A3+1)>CLOSE AND REF(RSI1,A3+1)<RSI1 AND CROSS(RSI1,RSI2); RSI底背离:FILTER(B3>0,5),LINETHICK0;STICKLINE(FILTER(B3>0,5),0,30,1,0),COLORFFFF00;DRAWTEXT(FILTER(B3>0,5),30,'RSI底背'),COLORFFFF00;C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));D1:=REF(CLOSE,C1+1)<CLOSE AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF); MACD顶背离:FILTER(D1>0,5),LINETHICK0;STICKLINE(FILTER(D1>0,5),100,80,1,0),COLOR0066FF;DRAWTEXT(FILTER(D1>0,5),80,'MACD顶背'),COLOR0066FF;C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1));D3:=REF(CLOSE,C3+1)<CLOSE AND REF(RSI1,C3+1)>RSI1 AND CROSS(RSI2,RSI1); RSI顶背离:FILTER(D3>0,5),LINETHICK0;STICKLINE(FILTER(D3>0,5),100,80,1,0),COLOR15F70A;DRAWTEXT(FILTER(D3>0,5),80,'RSI顶背'),COLOR15F70A;{以上不动}TR1:=EMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),21);HD :=HIGH-REF(HIGH,1);LD :=REF(LOW,1)-LOW;DMP:=EMA(IF(HD>0 AND HD>LD,HD,0),21);DMM:=EMA(IF(LD>0 AND LD>HD,LD,0),21);PDI:= DMP*100/TR1;MDI:= DMM*100/TR1;ADX: EMA((PDI-MDI)/(MDI+PDI)*100,6)*2;ADXR:EMA(ADX,6);ADMA:=EMA(ADX,20);OMD:(ADX-2*ADMA+ADXR)/2, COLORSTICK;DRAWBAND(ADX,RGB(155,50,50),ADXR,RGB(0,100,50));STICKLINE(OMD>REF(OMD,1) AND OMD>0,0,OMD,1,0),COLORRED;STICKLINE(OMD>REF(OMD,1) AND OMD<0,0,OMD,1,0),COLORGREEN; STICKLINE(OMD<REF(OMD,1),0,OMD,1,0),COLORCBCBC0;STICKLINE(OMD>=0 OR OMD<=0,0,0,50,1),COLORWHITE;ADX1:ADX,COLORRED;ADXR1:ADXR,COLORYELLOW;{DMI顶底背离}DM1:=BARSLAST(REF(CROSS(ADX1,ADXR1),1));DM2:=REF(CLOSE,DM1+1)>CLOSE AND REF(ADX1,DM1+1)<ADX1 ANDCROSS(ADX1,ADXR1);DMI底背离:FILTER(DM2>0,5),LINETHICK0;DRAWTEXT(FILTER(DM2>0,5),ADX1,'DMI底背'),COLORFFFF00;DM3:=BARSLAST(REF(CROSS(ADXR1,ADX1),1));DM4:=REF(CLOSE,DM3+1)<CLOSE AND REF(ADX1,DM3+1)>ADX1 AND CROSS(ADXR1,ADX1);DMI顶背离:FILTER(DM4>0,5),LINETHICK0;DRAWTEXT(FILTER(DM4>0,5),ADX1,'DMI顶背'),COLORGREEN;。
通达信选股最全公式
通达信选股最全公式.1、通达信选股公式底背离是股票技术分析中的一种重要形态,通达信选股公式中集成了MACD、KDJ、RSI三个指标的底背离。
具体公式如下:DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3 ,3)),1));B2:=REF(C,A2+1)>C ANDREF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) ANDCROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.R SI2"(6,12,24)),1));B3:=REF(C,A3+1)>C ANDREF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));底背离条件是:B1>0 OR B2>0 OR B3>0;2、老鼠仓老鼠仓是指某些股民在掌握了内幕信息后,通过大量买入低价股票来获取利益的行为。
通达信选股公式中,老鼠仓的判断条件如下:AA1:=AMOUNT/VOL;BB1:=L< AA1*0.9;CC1:=(C-REF(C,1))/REF(C,1)*100.1.2;DD1:=L< MA(C,5)*0.921;EE1:=VOL< MA(V,5)*1.5;老鼠仓条件是:BB1 AND CC1 AND DD1 AND EE1;3、抄底高手抄底是指在股票价格低迷时买入,等待价格反弹后卖出获取利润的行为。
通达信选股最全公式
通达信选股最全公式1、通达信选股公式{MACD、KDJ、RSI底背离}DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);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));底背离:B1>0 OR B2>0 OR B3>0;{集成了MACD、KDJ、RSI三个指标的底背离};2、老鼠仓AA1:=AMOUNT/VOL;BB1:=L< AA1*0.9;CC1:=(C-REF(C,1))/REF(C,1)*100> 1.2;DD1:=L< MA(C,5)*0.921;EE1:=VOL< MA(V,5)*1.5;老鼠仓:BB1 AND CC1 AND DD1 AND EE1;3、抄底高手{M 15 35 30N 12 32 27D 18 50 42}VAR1:=(CLOSE-MA(CLOSE,48))/MA(CLOSE,48)*100+M<0;VAR2:=(CLOSE-MA(CLOSE,70))/MA(CLOSE,70)*100+N<0;VAR3:=VAR1 AND VAR2;VAR4:=VAR1 AND VAR2 AND COUNT(VAR3,2)=1 AND DATE>940101 AND (CLOSE>OPEN OR CLOSE<OPEN) AND (OPEN-REF(CLOSE,1))/REF(CLOSE,1)>-0.07 AND (REF(OPEN,1)>REF(CLOSE,1) OR REF(OPEN,1)<REF(CLOSE,1)) AND(REF(OPEN,2)>REF(CLOSE,2) OR REF(OPEN,2)<REF(CLOSE,2)) AND (REF(OPEN,3)>REF(CLOSE,3) OR REF (OPEN,3)<REF(CLOSE,3)) AND (REF(OPEN,4)>REF(CLOSE,4) OR REF(OPEN,4)<REF(CLOSE,4)) AND (REF(OPEN,5)>REF(CLOSE,5) OR REF(OPEN,5)<REF(CLOSE,5));VAR5:=DMA(EMA(CLOSE,8),SUM(VOL,9)/2.8/CAPITAL);VAR6:=(CLOSE-VAR5)/VAR5*100;VAR7:=REF(VAR6,1)+D<0 AND VAR6>REF(VAR6,1) AND REF(VAR6,1)<REF(VAR6,2) AND VAR6-REF(VAR6,1)>1.8 AND (HIGH>LOW) AND (REF(HIGH,1)>REF(LOW,1)) AND (REF(HIGH,2)>REF(LOW,2)) AND (REF(HIGH,3)>REF(LOW,3)) AND (REF(HIGH,4)>REF(LOW,4)) AND (REF(HIGH,5)>REF(LOW,5));VAR4 OR VAR7;3、短线黑马{K 100 140 100}VAR1:=DMA(CLOSE,VOL/MA(VOL,4)/4);VAR2:=DMA(CLOSE,VOL/MA(VOL,33)/33);VAR3:=(CLOSE-VAR1)/VAR1*100<-11/K*100;VAR4:=(VAR1-VAR2)/VAR2*100<-22.3/K*100;VAR5:=VAR3 AND VAR4 AND (OPEN>CLOSE OR OPEN<CLOSE) AND(OPEN-REF(CLOSE,1))/REF(CLOSE,1)>-0.07 AND(REF(CLOSE,1)>REF(OPEN,1) OR REF(CLOSE,1)<REF(OPEN,1)) AND(REF(OPEN,2)>REF(CLOSE,2) OR REF(OPEN,2)<REF(CLOSE,2)) AND (REF(OPEN,3)>REF(CLOSE,3) OR REF(OPEN,3)<REF(CLOSE,3)) AND (REF (OPEN,4)>REF(CLOSE,4) OR REF(OPEN,4)<REF(CLOSE,4)) AND (REF(OPEN,5)>REF(CLOSE,5) OR REF(OPEN,5) <REF(CLOSE,5)) AND (REF(OPEN,6)>REF(CLOSE,6) OR REF(OPEN,6)<REF(CLOSE,6)) AND (REF(OPEN,7)>REF (CLOSE,7) OR REF(OPEN,7)<REF(CLOSE,7));VAR6:=DMA(CLOSE,VOL/MA(VOL,3)/3);VAR7:=DMA(CLOSE,VOL/MA(VOL,33)/33);VAR8:=(CLOSE-VAR6)/VAR6*100<-5;VAR9:=(VAR6-VAR7)/VAR7*100<-18;VARA:=(INDEXC-LLV(INDEXL,250))/(HHV(INDEXH,250)-LLV(INDEXL,250))*100;VARB:=SMA(VARA,30,1);VARC:=SMA(VARB,50,1);VARD:=VAR8 AND VAR9 AND (OPEN>CLOSE OR OPEN<CLOSE) AND(OPEN-REF(CLOSE,1))/REF(CLOSE,1)>-0.05 AND(REF(CLOSE,1)>REF(OPEN,1) OR REF(CLOSE,1)<REF(OPEN,1));VARE:=VARD AND COUNT(VARD,2)=1 ;VAR5 OR VARE;4、逆势操作VAR1:=DMA(CLOSE,VOL/MA(VOL,4)/4);VAR2:=DMA(CLOSE,VOL/MA(VOL,32)/32);VAR3:=(CLOSE-VAR1)/VAR1*100<-8;VAR4:=(VAR1-VAR2)/VAR2*100<-21;VAR5:=VAR3 AND VAR4 AND (OPEN>CLOSE OR OPEN<CLOSE) AND (OPEN-REF(CLOSE,1))/REF(CLOSE,1)>-0.05 AND(REF(CLOSE,1)>REF(OPEN,1) OR REF(CLOSE,1)<REF(OPEN,1)) AND (REF(OPEN,2)>REF(CLOSE,2) OR REF(OPEN,2)<REF(CLOSE,2)) AND (REF(OPEN,3)>REF(CLOSE,3) OR REF(OPEN,3)<REF(CLOSE,3)) AND (REF(OPEN,4)>REF(CLOSE,4) OR REF(OPEN,4)<REF(CLOSE,4)) AND (REF(OPEN,5)>REF(CLOSE,5) OR REF(OPEN,5) <REF(CLOSE,5)) AND (REF(OPEN,6)>REF(CLOSE,6) OR REF(OPEN,6)<REF(CLOSE,6)) AND (REF(OPEN,7)>REF(CLOSE,7) OR REF(OPEN,7)<REF(CLOSE,7));VAR6:=(CLOSE-MA(CLOSE,70))/MA(CLOSE,70)*100<-23;VAR7:=(INDEXC-LLV(INDEXL,275))/(HHV(INDEXH,275)-LLV(INDEXL,275))*100;VAR8:=SMA(VAR7,50,1);VAR9:=SMA(VAR8,40,1);VARA:=VAR6 AND VAR9<23 AND COUNT(VAR6,2)=1 AND (OPEN>CLOSE OR OPEN<CLOSE) AND OPEN/REF(CLOSE,1)>0.96 ;(VAR5 OR VARA) ;5、成交量变异率VR买入WVR := SUM((IF(CLOSE>OPEN,VOL,0)+IF(CLOSE=OPEN,VOL/2,0)),N)/SUM((IF(CLOSE<OPEN,VOL,0)+IF(CLOSE=OPEN ,VOL/2,0)),26)*100;VOL变异率VR买入:CROSS(LL,WVR);{N 5 100 26 5}{LL 0 80 70 5};MA5:=MA(C,5);MA10:=MA(C,10);MA20:=MA(C,20);MA30:=MA(C,30);MA120:=SMA(C,120,1);ZH520:=ABS(MA5-MA20)/MA20*100<=10;ZH530:=ABS(MA5-MA30)/MA30*100<=10;QSXS1:=MA5>REF(MA5,1);QSXS2:=MA20>REF(MA20,1);QSXS3:=MA30>REF(MA30,1);DTPL:=MA20>MA30 AND MA30>MA120;LYT:=DTPL AND QSXS2 AND QSXS3 AND COUNT(QSXS1,4)<=1;GJHS:=C>MA5 AND ((QSXS1 AND NOT(REF(QSXS1,1))) OR C>REF(C,3));LYKK:=GJHS AND (ZH520 OR ZH530) AND LYT;买:LYKK AND NOT(REF(LYKK,1));虚拟成交量>昨日VOL的2倍的股VVOL:=IF(CURRBARSCOUNT=1 AND PERIOD=5,VOL*240/FROMOPEN,DRAWNULL);昨日VOL:=REF(VOL,1)*2.0;ABS(VVOL)-昨日VOL>=0;{大于昨日的2.0倍};成交量是昨日的1.8倍VVOL:=IF(CURRBARSCOUNT=1 AND PERIOD=5,VOL*240/FROMOPEN,DRAWNULL);昨日VOL:=REF(VOL,1)*1.8;ABS(VVOL)-昨日VOL>=0;{大于昨日的1.8倍};6、PDI上穿三线选股公式源码:TR0:= 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;DMP:= SUM(IF(HD>0 AND HD>LD,HD,0),14);DMM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);PDI:=DMP*100/TR0,colorred;MDI:=DMM*100/TR0;ADX:=MA(ABS(MDI-PDI)/(MDI+PDI)*100,6);ADXR:=(ADX+REF(ADX,6))/2;CROSS(PDI,MDI) AND CROSS(PDI,ADX) AND CROSS(PDI,ADXR)今日量比昨放大1倍后三日股价不跌回当日收盘价的选股公式选股公式:{成交量比前一天放大1倍,后3天,股价没有跌破放量那天的收盘价}var1:=v>ref(v,1)*2;ref(var1,3) and count(c>ref(c,3),3)=3;7、倍量柱加三天量减价升喇叭形的真黄金柱公式倍数:=1.9;倍量1:=REF(VOL,3)>倍数*REF(VOL,4) AND REF(C,3)>=REF(O,3);价升量缩:= LLV(C,3)>=REF(L,3) AND HHV(VOL,3)<=REF(VOL,3);连阳:= COUNT(C>=O,4)=4;选股:倍量1 AND 价升量缩 AND 连阳;8、“凹口起柱”理论编写的凹口指标王子老师的平台起柱、过顶起柱、凹口起柱理论真是了不得,十分佩服,这里我冒昧的加一个,那就是顶部起柱,经观察,股票起柱时是主力行为的表现,是主力意图的表现!是主力留下的痕迹!是量柱开口说话的语言!这个指标或许可以帮助朋友们看懂主力的行为意图,看出量柱的语言!T7:=REF(VOL,6)/REF(VOL,7)>=2;T6:=REF(VOL,5)/REF(VOL,6)>=2;T5:=REF(VOL,5)/REF(VOL,4)>=1.5;T4:=REF(VOL,4)/REF(VOL,3)>=1.5;T3:=REF(VOL,2)/REF(VOL,3)>=1.5;T1:=V/REF(VOL,1)>2;T0:=C>O AND C>REF(C,1);选股:T7 AND T1 AND T0 OR T6 AND T1 AND T0 OR T5 AND T1 AND T0 OR T4 AND T1 AND T0 OR T3 AND T1 AND T0 ;下载 (53.76 KB)2010-1-12 21:299、倍量过左峰选股源码--通达信SR1:=REF(HIGH,10)=HHV(HIGH,2*10+1);SR2:=FILTER(SR1,10);SR3:=BACKSET(SR2,10+1);HD:=FILTER(SR3,10);前高:=REF(H,BARSLAST(HD));倍量:=VOL/REF(VOL,1)>=2 AND COUNT(CLOSE>OPEN,1) OR LOW>REF(HIGH,1) AND COUNT(OPEN>CLOSE,1) AND VOL/REF(VOL,1)>=2;突破前高:=CROSS(C,前高);XG:突破前高 AND 倍量;10、{MACD、KDJ、RSI底背离}DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);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));底背离:B1>0 OR B2>0 OR B3>0;{集成了MACD、KDJ、RSI三个指标的底背离};11、老鼠仓AA1:=AMOUNT/V;BB1:=L<AA1*0.9;CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;DD1:=L<MA(C,5)*0.921;EE1:=V<MA(V,5)*1.5;老鼠仓:BB1 AND CC1 AND DD1 AND EE1;12、主力进场VAR1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);VAR2:=SMA(ABS(LOW-VAR1),13,1)/SMA(MAX(LOW-VAR1,0),10,1);VAR3:=EMA(VAR2,10);VAR4:=LLV(LOW,33);VAR5:=EMA(IF(LOW<=VAR4,VAR3,0),3);XG:(VAR5>REF(VAR5,1) AND VAR5>0 ) OR (VAR5<REF(VAR5,1) AND NOT(VAR5=0)=1);13、60日天量T1:=V=HHV(V,100);T2:=V/REF(VOL,1)>=3;选股:T1 AND T2;14、135均量线选股VOLUME:=VOL;MAVOL1:=MA(VOLUME,5);MAVOL2:=MA(VOLUME,35);MAVOL3:=MA(VOLUME,135);选股:CROSS(MAVOL1,MAVOL2)OR CROSS(MAVOL1,MAVOL3) OR CROSS(MAVOL2,MAVOL3);15、二次翻红DIF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIF,9);MACD:=2*(DIF-DEA);FH1:=REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4); FH2:=MACD>=0 AND COUNT(MACD>REF(MACD,1),1)=1;FH3:=FH1 AND FH2 AND EMA(C,13)>REF(EMA(C,13),1);FH4:=FH1 AND FH2 AND ABS((DIF-DEA)/C)<0.018;FH5:=FH1 AND FH2 AND MACD<0.10;二次翻红:=(FH3 OR FH4 OR FH5);低买:=CROSS(DIF,DEA) AND DIF<0;加油:=CROSS(DIF,DEA) AND DIF>0;XG:二次翻红 OR 低买 OR 加油;16、均量互换VOLUME:=VOL;MAVOL1:=MA(VOLUME,5);MAVOL2:=MA(VOLUME,35);MAVOL3:=MA(VOLUME,135);选股:CROSS(MAVOL2,MAVOL3);17、成交额均量互换AMO:=AMOUNT;MAAMO1:=MA(AMO,5);MAAMO2:=MA(AMO,10);MAAMO3:=MA(AMO,40);XG:CROSS(TJ1,TJ2)AND CROSS(TJ1,TJ3)OR CROSS(MAAMO1,MAAMO2)AND CROSS(MAAMO1,MAAMO3);18、凹口起柱T7:=REF(VOL,6)/REF(VOL,7)>=2;T6:=REF(VOL,5)/REF(VOL,6)>=2;T5:=REF(VOL,5)/REF(VOL,4)>=1.5;T4:=REF(VOL,4)/REF(VOL,3)>=1.5;T3:=REF(VOL,2)/REF(VOL,3)>=1.5;T1:=V/REF(VOL,1)>2;T0:=C>O AND C>REF(C,1);选股:T7 AND T1 AND T0 OR T6 AND T1 AND T0 OR T5 AND T1 AND T0 OR T4 AND T1 AND T0OR T3 AND T1 AND T0;19、黄金柱选股VAR1:=V>REF(V,1)*2;REF(VAR1,3) AND COUNT(C>REF(C,3),3)=3;20、日成交量触及5日均量线M1:=MA(V,5);M2:V > M1;21、早盘量满--一个很管用的预警指标本指标描述的是上午10点前个股成交量与昨天基本相等(指标在上午10点以后就不工作了);这类股票往往是比较强势,只有在10点前成交量达到昨天水平才会预警;其中下跌的股票必须用肉眼给过滤掉。
通达信公式指标源码双底背离指标公式
S05:=SUM(MACD,0);
QST:=BARSLAST(MACD<0 AND REF(MACD,1)>0)+1;
QXT:=BARSLAST(MACD>0 AND REF(MACD,1)<0)+1;
S5:=IF(MACD>0,S05-REF(S05,BARSLAST(MACD<0)),S05-REF(S05,BARSLAST (MACD>0)))/10;
通达信公式指标源码双底背离指标公式 通达信双底背离指标公式 信号出现后买入,因为是见底信号. dif:=ema(c,12)-ema(c,26); dea:=ema(dif,9); macd:=2*(dif-dea); qzq:=barslast(ref(macd,1)<0 and macd>0); qm:=llvbars(macd,qzq+20); mqdz:=if(qm>qzq,ref(macd,qm),0); qf:=llvbars(dif,qzq+20); dqdz:=if(qf>qzq,ref(dif,qf),0); xg1:=macd<0 and macd>mqdz and dif<0 and dif>dqdz and c=llv(c,qzq+20) and mqdz<0 and dqdz<0; xg:ref(xg1,1)=1 and macd>ref(macd,1); s05:=sum(macd,0); qst:=barslast(macd<0 and ref(macd,1)>0)+1; qxt:=barslast(macd>0 and ref(macd,1)<0)+1; s5:=if(macd>0,s05-ref(s05,barslast(macd<0)),s05-ref(s05,barslast (macd>0)))/10; st:=if(macd>0,ref(qst,qxt)+qxt,ref(qxt,qst)+qst); rs5:=ref(s5,st); bc:if(macd>0 and s5 rs5 and dea<0,1,0));
通达信MACD+KDJ+RSI背离指标公式(实用)
通达信MACD+KDJ+RSI背离指标公式(实用)DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK;低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;STICKLINE(低位金叉,0,-0.18,1,0),COLORYELLOW;DRAWTEXT(低位金叉,-0.15,' 低位金叉'),COLORRED;JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;STICKLINE(二次金叉,0,-0.18,1,0),COLORFF00FF;DRAWTEXT(二次金叉,-0.3,' 二次金叉'),COLORFF00FF;A1:=BARSLAST(REF(CROSS(DIF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);STICKLINE(底背离,0,0.13,1,0),COLOR00FF00;DRAWTEXT(底背离,0.18,' 底背离'),COLOR00FF00;A2:=BARSLAST(REF(CROSS(DEA,DIF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,0.51,'三全项'),COLORYELLOW,LINETHICK2;DRAWTEXT(低位金叉AND 底背离,0.31,'两全项'),COLORLIBLUE,LINETHICK2;上翘:IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK2;下拐:IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLORLIBLUE,LINETHICK2;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.8,'RSI顶离'),COLORGREEN;{RSI顶背离};。
通达信选股最全公式
1、通达信选股公式{MACD、KDJ、RSI底背离}DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);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));底背离:B1>0 OR B2>0 OR B3>0;{集成了MACD、KDJ、RSI三个指标的底背离};2、老鼠仓AA1:=AMOUNT/VOL;BB1:=L< AA1*0.9;CC1:=(C-REF(C,1))/REF(C,1)*100> 1.2;DD1:=L< MA(C,5)*0.921;EE1:=VOL< MA(V,5)*1.5;老鼠仓:BB1 AND CC1 AND DD1 AND EE1;3、抄底高手{M 15 35 30N 12 32 27D 18 50 42}VAR1:=(CLOSE-MA(CLOSE,48))/MA(CLOSE,48)*100+M<0;VAR2:=(CLOSE-MA(CLOSE,70))/MA(CLOSE,70)*100+N<0;VAR3:=VAR1 AND VAR2;VAR4:=VAR1 AND VAR2 AND COUNT(VAR3,2)=1 AND DATE>940101 AND (CLOSE>OPEN OR CLOSE<OPEN) AND (OPEN-REF(CLOSE,1))/REF(CLOSE,1)>-0.07 AND (REF(OPEN,1)>REF(CLOSE,1) OR REF(OPEN,1)<REF(CLOSE,1)) AND(REF(OPEN,2)>REF(CLOSE,2) OR REF(OPEN,2)<REF(CLOSE,2)) AND (REF(OPEN,3)>REF(CLOSE,3) OR REF (OPEN,3)<REF(CLOSE,3)) AND (REF(OPEN,4)>REF(CLOSE,4) OR REF(OPEN,4)<REF(CLOSE,4)) AND (REF(OPEN,5)>REF(CLOSE,5) OR REF(OPEN,5)<REF(CLOSE,5));VAR5:=DMA(EMA(CLOSE,8),SUM(VOL,9)/2.8/CAPITAL);VAR6:=(CLOSE-VAR5)/VAR5*100;VAR7:=REF(VAR6,1)+D<0 AND VAR6>REF(VAR6,1) AND REF(VAR6,1)<REF(VAR6,2) AND VAR6-REF(VAR6,1)>1.8 AND (HIGH>LOW) AND (REF(HIGH,1)>REF(LOW,1)) AND (REF(HIGH,2)>REF(LOW,2)) AND(REF(HIGH,3)>REF(LOW,3)) AND (REF(HIGH,4)>REF(LOW,4)) AND (REF(HIGH,5)>REF(LOW,5));VAR4 OR VAR7;3、短线黑马{K 100 140 100}VAR1:=DMA(CLOSE,VOL/MA(VOL,4)/4);VAR2:=DMA(CLOSE,VOL/MA(VOL,33)/33);VAR3:=(CLOSE-VAR1)/VAR1*100<-11/K*100;VAR4:=(VAR1-VAR2)/VAR2*100<-22.3/K*100;VAR5:=VAR3 AND VAR4 AND (OPEN>CLOSE OR OPEN<CLOSE) AND(OPEN-REF(CLOSE,1))/REF(CLOSE,1)>-0.07 AND(REF(CLOSE,1)>REF(OPEN,1) OR REF(CLOSE,1)<REF(OPEN,1)) AND(REF(OPEN,2)>REF(CLOSE,2) OR REF(OPEN,2)<REF(CLOSE,2)) AND (REF(OPEN,3)>REF(CLOSE,3) OR REF(OPEN,3)<REF(CLOSE,3)) AND (REF (OPEN,4)>REF(CLOSE,4) OR REF(OPEN,4)<REF(CLOSE,4)) AND (REF(OPEN,5)>REF(CLOSE,5) OR REF(OPEN,5) <REF(CLOSE,5)) AND (REF(OPEN,6)>REF(CLOSE,6) OR REF(OPEN,6)<REF(CLOSE,6)) AND (REF(OPEN,7)>REF (CLOSE,7) OR REF(OPEN,7)<REF(CLOSE,7));VAR6:=DMA(CLOSE,VOL/MA(VOL,3)/3);VAR7:=DMA(CLOSE,VOL/MA(VOL,33)/33);VAR8:=(CLOSE-VAR6)/VAR6*100<-5;VAR9:=(VAR6-VAR7)/VAR7*100<-18;VARA:=(INDEXC-LLV(INDEXL,250))/(HHV(INDEXH,250)-LLV(INDEXL,250))*100;VARB:=SMA(VARA,30,1);VARC:=SMA(VARB,50,1);VARD:=VAR8 AND VAR9 AND (OPEN>CLOSE OR OPEN<CLOSE) AND(OPEN-REF(CLOSE,1))/REF(CLOSE,1)>-0.05 AND(REF(CLOSE,1)>REF(OPEN,1) OR REF(CLOSE,1)<REF(OPEN,1));VARE:=VARD AND COUNT(VARD,2)=1 ;VAR5 OR VARE;4、逆势操作VAR1:=DMA(CLOSE,VOL/MA(VOL,4)/4);VAR2:=DMA(CLOSE,VOL/MA(VOL,32)/32);VAR3:=(CLOSE-VAR1)/VAR1*100<-8;VAR4:=(VAR1-VAR2)/VAR2*100<-21;VAR5:=VAR3 AND VAR4 AND (OPEN>CLOSE OR OPEN<CLOSE) AND (OPEN-REF(CLOSE,1))/REF(CLOSE,1)>-0.05 AND(REF(CLOSE,1)>REF(OPEN,1) OR REF(CLOSE,1)<REF(OPEN,1)) AND (REF(OPEN,2)>REF(CLOSE,2) OR REF(OPEN,2)<REF(CLOSE,2)) AND (REF(OPEN,3)>REF(CLOSE,3) OR REF(OPEN,3)<REF(CLOSE,3)) AND (REF(OPEN,4)>REF(CLOSE,4) OR REF(OPEN,4)<REF(CLOSE,4)) AND (REF(OPEN,5)>REF(CLOSE,5) OR REF(OPEN,5)<REF(CLOSE,5)) AND (REF(OPEN,6)>REF(CLOSE,6) OR REF(OPEN,6)<REF(CLOSE,6)) AND (REF(OPEN,7)>REF(CLOSE,7) OR REF(OPEN,7)<REF(CLOSE,7));VAR6:=(CLOSE-MA(CLOSE,70))/MA(CLOSE,70)*100<-23;VAR7:=(INDEXC-LLV(INDEXL,275))/(HHV(INDEXH,275)-LLV(INDEXL,275))*100;VAR8:=SMA(VAR7,50,1);VAR9:=SMA(VAR8,40,1);VARA:=VAR6 AND VAR9<23 AND COUNT(VAR6,2)=1 AND (OPEN>CLOSE OR OPEN<CLOSE) AND OPEN/REF(CLOSE,1)>0.96 ;(VAR5 OR VARA) ;5、成交量变异率VR买入WVR := SUM((IF(CLOSE>OPEN,VOL,0)+IF(CLOSE=OPEN,VOL/2,0)),N)/SUM((IF(CLOSE<OPEN,VOL,0)+IF(CLOSE=OPEN ,VOL/2,0)),26)*100;VOL变异率VR买入:CROSS(LL,WVR);{N 5 100 26 5}{LL 0 80 70 5};MA5:=MA(C,5);MA10:=MA(C,10);MA20:=MA(C,20);MA30:=MA(C,30);MA120:=SMA(C,120,1);ZH520:=ABS(MA5-MA20)/MA20*100<=10;ZH530:=ABS(MA5-MA30)/MA30*100<=10;QSXS1:=MA5>REF(MA5,1);QSXS2:=MA20>REF(MA20,1);QSXS3:=MA30>REF(MA30,1);DTPL:=MA20>MA30 AND MA30>MA120;LYT:=DTPL AND QSXS2 AND QSXS3 AND COUNT(QSXS1,4)<=1;GJHS:=C>MA5 AND ((QSXS1 AND NOT(REF(QSXS1,1))) OR C>REF(C,3));LYKK:=GJHS AND (ZH520 OR ZH530) AND LYT;买:LYKK AND NOT(REF(LYKK,1));虚拟成交量>昨日VOL的2倍的股VVOL:=IF(CURRBARSCOUNT=1 AND PERIOD=5,VOL*240/FROMOPEN,DRAWNULL);昨日VOL:=REF(VOL,1)*2.0;ABS(VVOL)-昨日VOL>=0;{大于昨日的2.0倍};成交量是昨日的1.8倍VVOL:=IF(CURRBARSCOUNT=1 AND PERIOD=5,VOL*240/FROMOPEN,DRAWNULL);昨日VOL:=REF(VOL,1)*1.8;ABS(VVOL)-昨日VOL>=0;{大于昨日的1.8倍};6、PDI上穿三线选股公式源码:TR0:= 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;DMP:= SUM(IF(HD>0 AND HD>LD,HD,0),14);DMM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);PDI:=DMP*100/TR0,colorred;MDI:=DMM*100/TR0;ADX:=MA(ABS(MDI-PDI)/(MDI+PDI)*100,6);ADXR:=(ADX+REF(ADX,6))/2;CROSS(PDI,MDI) AND CROSS(PDI,ADX) AND CROSS(PDI,ADXR)今日量比昨放大1倍后三日股价不跌回当日收盘价的选股公式选股公式:{成交量比前一天放大1倍,后3天,股价没有跌破放量那天的收盘价}var1:=v>ref(v,1)*2;ref(var1,3) and count(c>ref(c,3),3)=3;7、倍量柱加三天量减价升喇叭形的真黄金柱公式倍数:=1.9;倍量1:=REF(VOL,3)>倍数*REF(VOL,4) AND REF(C,3)>=REF(O,3);价升量缩:= LLV(C,3)>=REF(L,3) AND HHV(VOL,3)<=REF(VOL,3);连阳:= COUNT(C>=O,4)=4;选股:倍量1 AND 价升量缩 AND 连阳;8、“凹口起柱”理论编写的凹口指标王子老师的平台起柱、过顶起柱、凹口起柱理论真是了不得,十分佩服,这里我冒昧的加一个,那就是顶部起柱,经观察,股票起柱时是主力行为的表现,是主力意图的表现!是主力留下的痕迹!是量柱开口说话的语言!这个指标或许可以帮助朋友们看懂主力的行为意图,看出量柱的语言!T7:=REF(VOL,6)/REF(VOL,7)>=2;T6:=REF(VOL,5)/REF(VOL,6)>=2;T5:=REF(VOL,5)/REF(VOL,4)>=1.5;T4:=REF(VOL,4)/REF(VOL,3)>=1.5;T3:=REF(VOL,2)/REF(VOL,3)>=1.5;T1:=V/REF(VOL,1)>2;T0:=C>O AND C>REF(C,1);选股:T7 AND T1 AND T0 OR T6 AND T1 AND T0 OR T5 AND T1 AND T0 OR T4 AND T1 AND T0 OR T3 AND T1 AND T0 ;下载 (53.76 KB)2010-1-12 21:299、倍量过左峰选股源码--通达信SR1:=REF(HIGH,10)=HHV(HIGH,2*10+1);SR2:=FILTER(SR1,10);SR3:=BACKSET(SR2,10+1);HD:=FILTER(SR3,10);前高:=REF(H,BARSLAST(HD));倍量:=VOL/REF(VOL,1)>=2 AND COUNT(CLOSE>OPEN,1) OR LOW>REF(HIGH,1) AND COUNT(OPEN>CLOSE,1) AND VOL/REF(VOL,1)>=2;突破前高:=CROSS(C,前高);XG:突破前高 AND 倍量;10、{MACD、KDJ、RSI底背离}DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);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));底背离:B1>0 OR B2>0 OR B3>0;{集成了MACD、KDJ、RSI三个指标的底背离};11、老鼠仓AA1:=AMOUNT/V;BB1:=L<AA1*0.9;CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;DD1:=L<MA(C,5)*0.921;EE1:=V<MA(V,5)*1.5;老鼠仓:BB1 AND CC1 AND DD1 AND EE1;12、主力进场VAR1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);VAR2:=SMA(ABS(LOW-VAR1),13,1)/SMA(MAX(LOW-VAR1,0),10,1);VAR3:=EMA(VAR2,10);VAR4:=LLV(LOW,33);VAR5:=EMA(IF(LOW<=VAR4,VAR3,0),3);XG:(VAR5>REF(VAR5,1) AND VAR5>0 ) OR (VAR5<REF(VAR5,1) AND NOT(VAR5=0)=1);13、60日天量T1:=V=HHV(V,100);T2:=V/REF(VOL,1)>=3;选股:T1 AND T2;14、135均量线选股VOLUME:=VOL;MAVOL1:=MA(VOLUME,5);MAVOL2:=MA(VOLUME,35);MAVOL3:=MA(VOLUME,135);选股:CROSS(MAVOL1,MAVOL2)OR CROSS(MAVOL1,MAVOL3) OR CROSS(MAVOL2,MAVOL3);15、二次翻红DIF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIF,9);MACD:=2*(DIF-DEA);FH1:=REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4); FH2:=MACD>=0 AND COUNT(MACD>REF(MACD,1),1)=1;FH3:=FH1 AND FH2 AND EMA(C,13)>REF(EMA(C,13),1);FH4:=FH1 AND FH2 AND ABS((DIF-DEA)/C)<0.018;FH5:=FH1 AND FH2 AND MACD<0.10;二次翻红:=(FH3 OR FH4 OR FH5);低买:=CROSS(DIF,DEA) AND DIF<0;加油:=CROSS(DIF,DEA) AND DIF>0;XG:二次翻红 OR 低买 OR 加油;16、均量互换VOLUME:=VOL;MAVOL1:=MA(VOLUME,5);MAVOL2:=MA(VOLUME,35);MAVOL3:=MA(VOLUME,135);选股:CROSS(MAVOL2,MAVOL3);17、成交额均量互换AMO:=AMOUNT;MAAMO1:=MA(AMO,5);MAAMO2:=MA(AMO,10);MAAMO3:=MA(AMO,40);XG:CROSS(TJ1,TJ2)AND CROSS(TJ1,TJ3)OR CROSS(MAAMO1,MAAMO2)AND CROSS(MAAMO1,MAAMO3);18、凹口起柱T7:=REF(VOL,6)/REF(VOL,7)>=2;T6:=REF(VOL,5)/REF(VOL,6)>=2;T5:=REF(VOL,5)/REF(VOL,4)>=1.5;T4:=REF(VOL,4)/REF(VOL,3)>=1.5;T3:=REF(VOL,2)/REF(VOL,3)>=1.5;T1:=V/REF(VOL,1)>2;T0:=C>O AND C>REF(C,1);选股:T7 AND T1 AND T0 OR T6 AND T1 AND T0 OR T5 AND T1 AND T0 OR T4 AND T1 AND T0OR T3 AND T1 AND T0;19、黄金柱选股VAR1:=V>REF(V,1)*2;REF(VAR1,3) AND COUNT(C>REF(C,3),3)=3;20、日成交量触及5日均量线M1:=MA(V,5);M2:V > M1;21、早盘量满--一个很管用的预警指标本指标描述的是上午10点前个股成交量与昨天基本相等(指标在上午10点以后就不工作了);这类股票往往是比较强势,只有在10点前成交量达到昨天水平才会预警;其中下跌的股票必须用肉眼给过滤掉。
【股票指标公式下载】-【通达信】真正背离(底背离、顶背离、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背离的公式选股器DIFF = EMA(CLOSE,12) - EMA(CLOSE,26);DEA = EMA(DIFF,9);MACD = 2*(DIFF-DEA);A1 = BARSLAST(REF(CROSS(DIFF,DEA),1));B1 = REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);FILTER(B1>0,5)该选股公式的意思是,选出MACD底背离的股票。
DIFF 是12日EMA和26日EMA的差值,DEA是DIFF的9日EMA,MACD是DIFF和DEA的差值的两倍。
A1表示DIFF 和DEA的交叉点距离当前的天数,B1表示前一天的收盘价高于当天的收盘价,DIFF也比前一天小,并且DIFF和DEA发生了交叉。
最后使用FILTER函数过滤出符合条件的股票。
条件选股公式:MACD、RSI、KDJ底背离KDJ_K = "KDJ.K"(9,3,3);KDJ_D = "KDJ.D"(9,3,3);KDJ_J = "KDJ.J"(9,3,3);买1 = CROSS(KDJ_J,0) OR (CROSS(KDJ_J,KDJ_K) AND KDJ_D<26);买2 = CROSS("RSI.RSI1"(6,2,2),20) ORCROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));买3 = CROSS("MACD.DIF","MACD.DEA") OR CROSS("MACD.MACD",0);买0 = 买1 + 买2 + 买3;买 = IF(买0>1,买0,0);该选股公式的意思是,选出MACD、RSI、KDJ底背离的股票。
【通达信】(底背离、顶背离、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" AND CROSS("MACD.DIF","MACD.DE A");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" AND CROSS("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" AND CROSS("RSI.RSI1","RSI.RSI2"); DRAWTEXT(B3>0,-0.3,'RSI底离'),COLORCY AN;{RSI底背离};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.DI F");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" AND CROSS("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(低位金叉、二次金叉、底背离)-指标公式源码参数Short 2 200 12Long 2 200 26Mid 2 200 9DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIFF,6);MACD:(DIFF-DEA)*2, COLORSTICK,LINETHICK2;低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;DRAWTEXT(低位金叉,0.16,' 低位金叉'),COLORWHITE;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;DRAWICON(二次金叉,DEA*0.9,1);DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA); STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4;DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK3;DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,0.25,'三全项'),COLOR0000FF,LINETHICK2;。
通达信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;
通达信实用背离指标公式
通达信实用背离指标公式来源: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),COLOR0000 FF,NODRAW;绿面积:SUM(MACD,BARSLAST(MACD>0))*(MACD<0),COLORFFFF 00,NODRAW;AA:=ROUND(REF(绿面积,1)*100);BB:=ROUND(REF(红面积,1)*100);DRAWNUMBER(CROSS(0,MACD),,ABS(BB)),COLORMAGENTA; DRAWNUMBER(CROSS(MACD,0),,ABS(AA)),COLORGREEN; {CCI}TYP:=(HIGH+LOW+CLOSE)/3;CCI:=(TYP-MA(TYP,14))/*AVEDEV(TYP,14)); {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 AND NOT(A2),4)) OR (REFX(T=5 ANDNOT(A2),5)) OR (REFX(T=6 AND NOT(A2),6)) OR (REFX(T=7 AND 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 AND NOT(A2),4)) OR (REFX(T=6 ANDNOT(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 AND NOT(A2),4)) OR (REFX(T=7 ANDNOT(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 AND NOT(A2),4)) OR (REFX(T=8 ANDNOT(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 AND NOT(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 AND NOT(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 AND NOT(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 AND NOT(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=6 AND NOT(B2),4)) OR (REFX(T1=7 AND NOT(B2),5)) OR (REFX(T1=8 AND NOT(B2),6));M11:=T1=3 AND REFX(T1=4 AND NOT(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 AND NOT(M15),WZG,'8'),COLOR9900CC; DRAWTEXT(N15 ,WZD,'9'),COLORGREEN;。