MACD底背离的通达信选股公式
MACD背离指标通达信
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA : EMA(DIFF,M);
MACD : 2*(DIFF-DEA), COLORSTICK,COLOR5454FF;
DD:=C=HHV(C,180);
STICKLINE(进出量>0,0,进出量,3,0),COLOR000099;
STICKLINE(进出量>0,0,进出量,3,0),COLOR0000CC;
STICKLINE(进出量>0,0,进出量,1.0,0),COLOR0000FF;
STICKLINE(进出量>0,0,进出量,0.5,0),COLORCC66FF;N:=1;QJ0:=(HIGH+LOW+CLOSE)/3;
趋势线: EMA(V11,3);
V12:=(趋势线-REF(趋势线,1))/REF(趋势线,1)*100;
准备现金: STICKLINE(趋势线<=13,0,20,5,0),COLORCC9900;
AA:=(趋势线<=13) AND FILTER((趋势线<=13),15);
DRAWTEXT (AA,30,'准备现金'),COLORCC9900;
STICKLINE(主力潜伏中,0,MACD*30,8,0),COLORRED;
100,COLOR1C1C1C;
0,COLOR1C1C1C;
-100,COLOR1C1C1C;
-100,STICK,COLOR1C1C1C;
2.【通达信】资金监控(主力撤、主力撤、趋势线、准备现金)-指标公式源码
MACD底背离的通达信选股公式
MACD【1】底背离的通达信选股公式条件选股公式: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,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);通达信百发百中{百发百中K:100,120,105}VARA:=CLOSE/MA(CLOSE,48)*100<71*K/100;VARB:=CLOSE/MA(CL OSE,50)*100<70*K/100;VARC:=HIGH/LOW>1.078/K*100;VARD:=VARC AND COUNT(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*100 AND 入<80*K/100) OR (VARD AND (VARA OR VARB)))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)BOLL开口放大;6)5日线走平并上穿10日线且10日线走平并向上。
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(低位金叉、底背离、顶背离)-指标公式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;。
通达信选股最全公式
通达信选股最全公式.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、抄底高手抄底是指在股票价格低迷时买入,等待价格反弹后卖出获取利润的行为。
macd底背离公式
macd底背离公式
MACD底背离公式(通达信版、同花顺版):
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)。
底背离一般出现在股价的低位区。
当行情连续回调一段相当长的时间,股价仍在震荡向下回落。
而MACD指标图形上的由绿柱构成的图形的走势是一底比一底高,即当股价的低点比前一次低点底,而指标的低点却比前一次的低点高,这叫底背离现象。
MACD的底背离的出现说明了多方力量正在逐步增强,开始拉升股价了,但是空方的力量已经逐步的衰竭了,是没有力气再来打压股价了。
这也就是预示出股价即将室友下跌的行情转变为上升的行情了。
底背离的次数越多,反转上涨的可能性就越大,此时,不必盲目割肉,当市场出现了明显的放量上涨信号的时候,可以反手做多。
通达信选股最全公式.
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底背离的通达信选股公式
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底背离的股票。
通达信实用背离指标公式
通达信实用背离指标公式来源: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;。
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函数的作用是求最低值。
通达信MACD背驰缠论指标公式
通达信MACD背驰缠论指标公式0;SJV:=FINANCE(34);{每股净资产}市净率:C/SJV,NODRAW,COLOR00FF00;每股税后利润:=(FINANCE(1)/FINANCE(29));市盈率:C/FINANCE(33),NODRAW,COLORFFFF00;DIF:=EMA(CLOSE,10)-EMA(CLOSE,22);DE:=EMA(DIF,7.5);MACDA:=2*(DIF-DE),;HZL:=CROSS(MACDA,0);LZH:=CROSS(0,MACDA);BC:=BARSLAST(HZL OR LZH)+1;ZGHZ:=IF(MACDA>0,HHV(MACDA,BC),0);ZGLZ:=IF(MACDA<0,LLV(MACDA,BC),0);DRAWBAND(ZGHZ,RGB(105,77,77),0,RGB(77,77,77));DRAWBAND(ZGLZ,RGB(80,0,0),0,RGB(66,88,66));DIFF:EMA(CLOSE,10)-EMA(CLOSE,22),COLORFFFFFF;DEA:EMA(DIFF,7.5),COLOR00FFFF;MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK0;STICKLINE(MACD>0 AND MACD>REF(MACD,1),0,MACD,1.5,1),COLORRED;STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,1.5,0),COLOR90FF00;STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,1.5,1),COLOREFFF00;STICKLINE(MACD<0 AND MACD>REF(MACD,1),0,MACD,1.5,0),COLORFFAAFF;↑:TROUGHBARS(3,3,1),COLOR0000FF,NODRAW;↓:PEAKBARS(3,3,1),COLOR00FF00,NODRAW;{ 股旁网_通达信股票指标公式}低:IF(↑=0,DIFF,IF(↓<↑,TROUGH(3,3,1),REF(TROUGH(3,3,1),1))), COLOR00FFFF,NODRAW;高:IF(↓=0,DIFF,IF(↑<↓,PEAK(3,3,1),REF(PEAK(3,3,1),1))),COLOR 00FF00,NODRAW;STICKLINE(↑=0 AND DIFF<0 AND DIFF<DEA,0,DIFF,0,0),COLORFFAAFF;STICKLINE(↓=0 AND DIFF>0 AND DIFF>DEA,DIFF,0,0,0),COLOR00FF00;DRAWTEXT(↑=0 AND DIFF<0 AND DIFF<DEA,DIFF,'低'),COLORFFAAFF;DRAWTEXT(↓=0 AND DIFF>0 AND DIFF>DEA,DIFF,'高'),COLOR00FF00;低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;AA1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=(REF(L,AA1+1)>L OR REF(C,AA1+1)>C) AND (L,DIFF)>REF((L,DIFF),AA1+1) AND CROSS(DIFF,DEA);DRAWLINE(AA1=0,DEA,底背离,DEA,0),COLOR0000FF,LINETHICK1;AA2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=(REF(C,AA2+1)<C OR REF(H,AA2+1)<H) AND REF((H,DIFF),AA2+1)>(H,DIFF) AND CROSS(DEA,DIFF);DRAWLINE(AA2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK1;DRAWICON(CROSS(DIFF,DEA) AND DIFF>0,DEA,36);DRAWICON(CROSS(DEA,DIFF) AND DIFF>0,DEA,37);DRAWICON(CROSS(DIFF,DEA) AND DIFF<0,DEA,1);DRAWICON(二次金叉,DEA*0.9,36) ;解盘1:=CONST(IF(MACD>0,1,0));解盘2:=CONST(IF(MACD<0,1,0));解盘A:=IF(解盘1=1,'【精华8个字买小卖小,缩头缩脚】当股价一波比一波高时,反而红柱的堆,一堆比一堆小,证明产生了顶背离现象,应该及时卖出',IF(解盘2=1,'【精华8个字买小卖小,缩头缩脚】当股价一波比一波低时,反而绿柱的堆一堆比一堆小,证明产生了底背离,应该买进',DRAWNULL));DRAWTEXT_FIX((解盘1=1 OR 解盘2=1),0.16,0,0,解盘A),COLORFFEE00;。
通达信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) ANDOMD<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 AND CROSS(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;。
【通达信】经典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;BB:=COUNT(CROSS(DEA,DIF),BARSLAST(DEA<=0));二次绿叉:=CROSS(DEA,DIF) AND DEA>0 AND COUNT(BB=2,21)=1;DRAWTEXT(二次绿叉,0.2,' 二次绿叉'),COLORGREEN;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真正的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顶背离};。
请高手编写个通达信的简单公式MACD红绿柱子背离
请高手编写个通达信的简单公式MACD红绿柱子背离macd顶底背离(同时包含kdj背离,rsi背离)公式如下:diff:ema(close,12) – ema(close,26);dea:ema(diff,9);macd:2*(diff-dea),colorstick;a1:=barslast(ref(cross(diff,dea),1));b1:=ref(c,a1+1)>c and ref(diff,a1+1)c and ref(“kdj.k”(9,3,3),a2+1)c and ref(“rsi.rsi1″(6,12,24),a3+1)0,-0.1,0),colorred,pointdot;kdj底背:if(b2>0,-0.1,0),colorff00ff,pointdot;rsi底背:if(b3>0,-0.1,0),coloryellow,pointdot;macd顶背:if(d1>0,0.1,0),color00ff00,pointdot;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;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;请高手帮我写一个通达信的选股公式:筛选出周线的macd绿柱子越来越短红柱子不变或者越来越多,股价在横盘xg:every(macd.macd>=ref(macd.macd,1),3);公式含义:macd连续bai3天以du上绿柱子越来越短红柱zhi子不变或者越dao来越多。
关于MACD背离的思考与公式(通达信)
关于MACD背离的思考与公式(通达信)MACD背离公式,关于底背离,网上好多人的定义是:条件一:股价(或最低价)低于前股价(或最低价)波谷时,对应的macd数值指标高于前股价(或最低价)波谷所对应的macd数值。
但是我愿意再加上一个条件——条件二:在条件一基础上,股价(或最低价)继续抬高,确认形成新的股价(或最低价)波谷。
原因在于:一、前股价(或最低价)波谷的定义是不确定的,除非我们给出级别定义价格的走势是由无数个小波浪组成的,实际上,如果我们在不同级别(这里说的可不是什么日线周线哦)的波浪下看,前股价(或最低价)波谷的定义是不同的,所以,在任意时刻,前股价(或最低价)波谷的定义实际上是不确定的,除非——我们确定级别!比如股价(或最低价)百分之三的ZIG转向,其中的百分之三就是对这个波浪大小的一种定义。
我还注意到,关于级别,现在很多人在学习的缠中说禅的理论里也有类似的思想。
二、新股价(或最低价)是否形成新的波谷,也需要定义级别。
这个级别的定义应当与对前股价(或最低价)波谷的级别定义相同。
所以,即便当前股价创新低,我们也必须等待反转,来确认新波谷的形成。
在这种情况下,大家最避讳的未来函数TROUGH和PEAK其实是可以发挥作用的,只要我们等待确认即可。
不是吗?这些都是观察者的判断而已。
为此,我编写以下MACD背离指标,个人认为这个指标还是有价值的。
另外,虽然(AND L>REF(L*1.03,1)在一定程度上解决了未来函数的不确定性,但是,实际上单独据此公式进行抄底操作还是有风险的。
因为,根据ZIG转向的定义,并不能确保在信号发出之后入场的人必定实现收益,理论上,随时还可以有一个向下的3%的ZIG转向并跌破前低的,相信这一点大家都会了解。
DIFF:= EMA(CLOSE,12) - EMA(CLOSE,26);DIF:EMA(CLOSE,12) - EMA(CLOSE,26);DEA:EMA(DIF,9);MACD:2*(DIF-DEA),COLORSTICK;CON1:=TROUGH(2,3,1)<TROUGH(2,3,2);CON2:=TROUGHBARS(2,3,1)=1 AND L>REF(L*1.03,1);CON3:=REF(MACD,1)>REF(MACD,TROUGHBARS(2,3,2)) AND HHV(MACD,TROUGHBARS(2,3,2))>0;CON4:=MACD>REF(MACD,1);T_REVERSE:=CON1 AND CON2 AND CON3 AND CON4;{上面是对MACD背离的定义,下面是画线}FLAG:=BACKSET(T_REVERSE,TROUGHBARS(2,3,2)+1);FLAG1:=BACKSET(T_REVERSE,2);FLAG2:=COUNT(T_REVERSE,TROUGHBARS(2,3,2)+1)*T_REV ERSE;FLAG3:=BACKSET(FLAG2=2,TROUGHBARS(2,3,2)+1);DRAWLINE(CROSS(FLAG,0.5),MACD,FLAG2=1,MACD,0),COL ORRED,LINETHICK2;DRAWLINE(CROSS(FLAG3,0.5),MACD,FLAG2=2,MACD,0),CO LORYELLOW,LINETHICK2;DRAWICON(T_REVERSE,MACD*1.2,1);以下是选股公式:DIFF:= EMA(CLOSE,12) - EMA(CLOSE,26);DIF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIF,9);MACD:=2*(DIF-DEA);CON1:=TROUGH(2,3,1)<TROUGH(2,3,2);CON2:=TROUGHBARS(2,3,1)=1 AND L>REF(L*1.03,1);CON3:=REF(MACD,1)>REF(MACD,TROUGHBARS(2,3,2)) AND HHV(MACD,TROUGHBARS(2,3,2))>0;CON4:=MACD>REF(MACD,1);T_REVERSE:CON1 AND CON2 AND CON3 AND CON4;。
macd隔位背离指标公式选股
macd隔位背离指标公式选股
在MACD指标中,隔位背离是一种重要的选股信号。
背离是指价格和指标之间存在反向运动的关系,而隔位背离则特指价格与指标在相隔一段时间的高点或低点发生的背离。
以下是一些常用的MACD隔位背离选股公式:
1. **MACD底背离**: 这是一种寻找股票下跌过程中可能发生反转的信号。
- DIF:=EMA(C,12)-EMA(C,26);
- DEA:=EMA(DIF,9);
- JC:=CROSS(DIF,DEA);
- T:=BARSLAST(REF(JC,1));
- A1:=REF(C,T+1)>C;
- A2:=DIF>REF(DIF,T+1);
- XG:JC AND A1 AND A2;
这个公式可以帮助投资者找到在价格下跌过程中可能产生反转的股票。
2. **MACD三背离选股**: 这是一个综合底背离、柱背离和积背离的方法,虽然机会不多,但很实用。
- MACD2:=2* (MACD.DIF-MACD.DEA);
- STICKLINE (MACD2>=0 AND MACD2>REF
(MACD2,1),0,MACD2,1.2,0),COLOR0000A5;
- STICKLINE (MACD2>=0 AND MACD2<REF
(MACD2,1),0,MACD2,1.2,0),COLORAA7800;
- STICKLINE (MACD2<0 AND MACD2<REF
(MACD2,1),0,MACD2,1.2,0),COLOR00A500;
通过这个公式,可以帮助投资者识别出在多个时间周期内发生的背离情况,从而提高交易的准确性。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
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,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) AND KDJ_D<26);
买2:=CROSS(""(6,2,2),20) OR CROSS(""(6,12,24),""(6,12,24));
买3:=CROSS("","") OR CROSS("",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<70*K/100;
VARC:=HIGH/LOW>K*100;
VARD:=VARC AND COUNT(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*100 AND 入<80*K/100) OR (VARD AND (VARA OR VARB)))
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)BOLL 开口放大;6)5日线走平并上穿10日线且10日线走平并向上。
试着将上述条件编成一公式,经测试,结果为零。
于是,删除并放宽一些条件,有如下公式:DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
AA1:=DIFF<0 AND DIFF>=DEA AND DEA>REF(DEA,1)AND MACD>REF(MACD,1);
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
AA2:=3*K-2*D<25;
LC:= REF(CLOSE,1);
AA3:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100<30;
ROC:=(CLOSE-REF(CLOSE,12))/REF(CLOSE,12)*100;
ROCMA:=MA(ROC,6);
AA4:=ROCMA<0 AND ROC>=ROCMA AND ROCMA>REF(ROCMA,1);
AA5:=C<SAR(10,2,20)OR CROSS(C,SAR(10,2,20));
MID:=MA(CLOSE,26);
UPPER:=MID+2*STD(CLOSE,26);
AA1 AND AA2 AND AA3 AND AA4 AND AA5;
大家可再减少一些条件试试,信号会逐步增多。
比如去掉最后两个后,成功率仍是百分之百,而信号由6个增加到10个。