下面还有几种MACD选股指标,大家参考
macd二次金叉选股公式大全
一、通达信MACD二次金叉选股公式:
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
二、大智慧MACD二次金叉选股公式:
{XG二次金叉}
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26); {选股设JC=10即可}
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
a:=if(CROSS(0,dea),1,0);
a1:=if(diff<0 and CROSS(diff,dea),1,0);
SS:=IF(A,SUM(A1,0),0);
SSB:=HHV(SS,0);
SSS:=SUM(A1,0);
jc:IF(SSS-SSB=2 AND SSS>REF(SSS,1),10,0)
三、MACD二次翻红选股公式
所谓MACD连续二次翻红是指MACD第一次出现红柱后,还没有等红柱缩短变绿便再次放大其红柱,这是利用MACD选强势股的关键,也是介入的最佳买点。特别是前期下跌时间长、下跌幅度大的个股,一旦出现“MACD连续二次翻红”形态,股价企稳回升的概率较大。如某只股票的股价开始缓慢回升,MACD由绿变红,一段时间后股价再度下探,红柱又开始缩短至零轴附近,红柱又翻红并逐渐伸长,这便是“MACD连续二次翻红”,也是最佳的买点。在第一次翻红后,红柱开始缩短,越短越好,最好不要超过0轴的第一横线;成交量由萎缩逐渐放大,特别是在二次翻红后,若能得到成交量的配合,该股后市向上冲击的力量会更大。
依据上面的法则以及“MACD二次翻红”的形态,从MACD二次翻红找起涨点入手编写指标如下:
应大家要求现将原码制作如下:
{macd二次翻红选股原码}
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
FH1:=REF(MACD,1)
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((DIFF-DEA)/C)<0.018;
FH5:=FH1 AND FH2 AND MACD<0.10;
FH3 OR FH4 OR FH5;
四、MACD在零轴下二次金叉副图公式
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA), 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;
五、MACD 0轴上第一次金叉选股
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
A2:=IF(CROSS(0,DEA),1,0);
A12:=IF(DIF>0 AND CROSS(DIF,DEA),1,0);
SS2:=IF(A2,SUM(A12,0),0);
SSB2:=HHV(SS2,0);
SSS2:=SUM(A12,0);
轴上第1次金叉:IF(SSS2-SSB2=1 AND SSS2>REF(SSS2,1),1,0);
六、MACD突破指标
MA3: MA(CLOSE,3),coloryellow;
MA34: MA(CLOSE,34),colorwhite;
箱顶: HHV(MA((LOW+HIGH+CLOSE+OPEN)/4,5),58),color00aaff;
箱底: LLV(MA((LOW+HIGH+CLOSE+OPEN)/4,6),58),color00ff00;
Var1:=EMA((HIGH+LOW+CLOSE)/3*(HHV(HIGH,10)-CLOSE)/(HHV(HIGH,10)-LLV(LOW,10))*20/10+箱底,2);
Var2:=(3*Var1-2*SMA(Var1,5,1))*0.3;
Var3:=(HHV(INDEXH,13)-INDEXC)/(HHV(INDEXH,13)-LLV(INDEXL,13));
Var4:=EMA(3*Var3-2*SMA(Var3,18,1),5);
Var5:=(INDEXC-LLV(INDEXL,8))/(HHV(INDEXH,8)-LLV(INDEXL,8));
Var6:=3*SMA(Var5,3,1)-2*SMA(SMA(Var5,3,1),5,1);
Var7:=(INDEXC*2+INDEXH+INDEXL)/4;
Var8:=EMA(Var7,13)-EMA(Var7,34);
Var9:=EMA(Var8,5);
VarA:=(Var8-Var9+箱底)*1;
VarB:=1.86*EMA(CLOSE,12)-EMA(CLOSE,34);
趋势力度: VarB,colorffaa99;
VarC:=箱底;
STICKLINE(C>=O,C,O,7,0),colorred;
STICKLINE(C<=O,C,O,7,0),COLORFF2020;
牛气冲天: STICKLINE(趋势力度>=VarC,VarC,趋势力度,4,0),colorred;
STICKLINE(趋势力度<=REF(趋势力度,1) AND 趋势力度>VarC,VarC,趋势力度,4,1),colorwhite;
趁机派发: STICKLINE(REF(趋势力度,2)<=REF(趋势力度,1) AND 趋势力度>VarC,VarC,趋势力度,4,0),colorgreen;
DRAWICON(REF(趋势力度,2)<=REF(趋势力度,1) AND 趋势力度>VarC,趋势力度,2);
熊气盖天: STICKLINE(趋势力度coloryellow;
转强信号:STICKLINE(趋势力度>REF(趋势力度,1) AND 趋势力度colorred;
七、MACD白线长期(30天)大于黄线选股
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
aa:=COUNT(DIFF>DEA,30);
SELECT aa==30;
八、MACD(1-5日资金流量)附图指标
群内共享文件下载
九、MACD空中加油指标
DIF:EMA(CLOSE,9)-EMA(CLOSE,23),COLORYELLOW;
DEA:EMA(DIF,6),COLORGREEN;
MACD:(DIF-DEA)*2,,COLORRED,DOTLINE;
0,COLORWHITE;
DRAWTEXT(CROSS(MACD,0) AND DIF>0,0.1,'空中加油'),COLORYELLOW;
十、精准的MACD
DIF:EMA(CLOSE,8)-EMA(CLOSE,20);
DEA:EMA(DIF,5);
MACD:(DIF-DEA)*2,COLORSTICK;
VAR1:=EMA(CLOSE,8)-EMA(CLOSE,20);
VAR2:=EMA(VAR1,5);
VAR3:=VAR1>VAR2;
VAR4:=VAR1
牛熊分界:0,COLORYELLOW,LINETHICK3,POINTDOT;
STICKLINE(VAR3,VAR1,VAR2,2,0),COLORRED;
STICKLINE(VAR4,VAR1,VAR2,2,0),COLORGREEN;
11、MACD面积公式
一、MACD面积公式(通达信)
DIFF := EMA(CLOSE,12) - EMA(CLOSE,26);
DEA := EMA(DIFF,9);
MACD := 2*(DIFF-DEA), COLORSTICK;
BV:=SUM(MACD,0);
BA:=IF(MAX(BV,REF(BV,2))REF(BV,1),1,0);
BC:=BARSLAST(BA)+1;
SMACD:BV-REF(BV,BC),COLORSTICK;
二、MACD面积飞狐源码:
p:=26;s:=12;m:=9;
var1:="[email=chzhshch@kxian]chzhshch@kxian[/email]";{处理K线关系}
var2:="[email=chzhshch@bi]chzhshch@bi[/email]";{处理笔关系}
var3:="[email=chzhshch@duan]chzhshch@duan[/email]";{处理段关系}
DIFF : EMA(CLOSE,s) - EMA(CLOSE,p);
DEA : EMA(DIFF,m);
MACD : 2*(DIFF-DEA), COLORSTICK;
var4:"[email=chzhshch@macds]chzhshch@macds"(macd)/20[/email];{图形比例缩小1/20,可自己修改}
var5:="[email=chzhshch@macdsnum]chzhshch@macdsnum[/email]";
drawnumber(ref(var4,1)>0 and var4<=0 ,ref(var4,1),ref(var5,1),0),shift1,colorred;
drawnumber(ref(var4,1)<0 and var4>=0 ,ref(var4,1),ref(abs(var5),1),0),shift1,colorgreen;
drawnumber(islastbar and var4<0,var4,abs(var5),0),align2,colorgreen,pxup25;
drawnumber(islastbar and var4>0,var4,var5,0),align2,colorred,pxdn10;
12、MACD主力进出
N:=8;
M:=13;
P:=60;
S:=3;
V1:=(C*2+H+L)/4*30;
V2:=EMA(V1,13)-EMA(V1,34);
V3:=EMA(V2,5);
V4:=2*(V2-V3)*5.5;
主力开始出: IF(V4<=0,V4,0),COLOR00FF00,LINETHICK2;
主力开始进: IF(V4>=0,V4,0),COLORFF00FF,LINETHICK2;
DIFF:= EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=1000* (2*(DIFF-DEA))/EMA(C,30);
VARA:=EMA(REF(CLOSE,1),4);
VAR1:=(SMA(MAX(CLOSE-VARA,0),6,1)/SMA(ABS(CLOSE-VARA),6,1)*100);
准备:IF(VAR1<3.5,10,0),colorcyan,LINETHICK2;
13、主图叠加MACD指标
DIFZ:=EMA(C,12)-EMA(C,26);
DEAZ:=EMA(DIFZ,9);
MACDZ:=8*(DIFZ-DEAZ);
NN:=60;
A01:=REF(HIGH,NN)=HHV(HIGH,2*NN+1); B01:=FILTER(A01,NN);
C01:=BACKSET(B01,NN+1); D01:=FILTER(C01,NN);
A02:=REF(LOW,NN)=LLV(LOW,2*NN+1); B02:=FILTER(A02,NN);
C02:=BACKSET(B02,NN+1); D02:=FILTER(C02,NN);
E01:=(REF(LLV(LOW,2*NN),1)+REF(HHV(HIGH,2*NN),1))/2; E02:=(HIGH+LOW)/2;
H01:=(D01 AND NOT(D02 AND E01>=E02)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
L01:=(D02 AND NOT(D01 AND E01
X01:=REF(BARSLAST(H01),1)+1; F01:=BACKSET(H01 AND COUNT(L01,X01)>0,LLVBARS(IF(L01,LOW,10000),X01));
G01:=F01>REF(F01,1); I01:=BACKSET(G01,2); LD:=I01>REF(I01,1);
WW:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
QQ:=WW>REF(WW,1);
RCC:REF(L,BARSLAST(QQ));
DRAWBAND(MACDZ+RCC,RGB(70,20,20),RCC,RGB(100,100,100));
DRAWBAND(DIFZ*4+RCC,RGB(255,140,140),EMA(DIFZ*4+RCC,9),RGB(147,234,249));
STICKLINE((RCC+MACDZ)>RCC AND (RCC+MACDZ)<=REF(RCC+MACDZ,1),RCC,RCC+MACDZ,0,0),COLOR400080;
STICKLINE((RCC+MACDZ)>RCC AND (RCC+MACDZ)>REF(RCC+MACDZ,1),RCC,RCC+MACDZ,0,0),COLOR00FFFF;
STICKLINE((RCC+MACDZ)<=RCC AND (RCC+MACDZ)<=REF(RCC+MACDZ,1),RCC,RCC+MACDZ,0,0),COLOR008080;
STICKLINE((RCC+MACDZ)<=RCC AND (RCC+MACDZ)>REF(RCC+MACDZ,1),RCC,RCC+MACDZ,0,0),COLORC080FF;
MA1:MA(CLOSE,M1);
MA2:MA(CLOSE,M2);
MA3:MA(CLOSE,M3);
MA4:MA(CLOSE,M4);
14、MACD资金动能指标
REFLINE:0;
DIFF:=EMA(CLOSE,3)-EMA(CLOSE,8);
DEA:=EMA(DIFF,5);
MACD := 2*(DIFF-DEA);
X1:=EMA(DIFF,5)*5;
X2:=((EMA(CLOSE,3)-EMA(CLOSE,8)))*5;
X3:IF(X2>0,X2,0),POINTDOT,colorred;
X4:IF(X2<0,X2,0),POINTDOT,colorgreen;
STICKLINE(X2>0,0,X2,2.8,0),colorred;
STICKLINE(X2>0,0,X2,2.8,0),COLOR000088;
STICKLINE(X2>0,0,X2,2.6,0),COLOR000099;
STICKLINE(X2>0,0,X2,2.4,0),COLOR0000AA;
STICKLINE(X2>0,0,X2,2.2,0),COLOR0000BB;
STICKLINE(X2>0,0,X2,2,0),COLOR0000CC;
STICKLINE(X2>0,0,X2,1.8,0),COLOR0000DD;
STICKLINE(X2>0,0,X2,1.5,0),COLOR0000EE;
STICKLINE(X2>0,0,X2,1.0,0),COLOR0000FF;
STICKLINE(X2>0,0,X2,0.0,0),COLOR0000FF;
STICKLINE(X2<0,0,X2,2.8,0),colorgreen;
STICKLINE(X2<0,0,X2,2.8,0),COLOR007700;
STICKLINE(X2<0,0,X2,2.6,0),COLOR008800;
STICKLINE(X2<0,0,X2,2.6,0),COLOR009900;
STICKLINE(X2<0,0,X2,2.4,0),COLOR00BB00;
STICKLINE(X2<0,0,X2,2.0,0),COLOR00CC00;
STICKLINE(X2<0,0,X2,1.8,0),COLOR00DD00;
STICKLINE(X2<0,0,X2,1.5,0),COLOR00EE00;
STICKLINE(X2<0,0,X2,1,0),COLOR00FF00;
STICKLINE(X2<0,0,X2,0,0),,COLOR00FF00;
资金动能A:X2,coloryellow,LINETHICK2;
资金动能B:X1,COLORFFFF00,LINETHICK2;
DRAWTEXT(CROSS(资金动能A,资金动能B),资金动能A,'始');
DRAWTEXT(CROSS(资金动能B,资金动能A),资金动能B,'终');
15、MACD老八种形态选股!
地址:MACD老八种形态 日周月同步之MACD选股法 <wbr>及步骤!
{1、双佛手向上}
DIFF1:= EMA(CLOSE,12) - EMA(CLOSE,26);
DEA1 := EMA(DIFF1,27);
MACD1:= 2*(DIFF1-DEA1);
双佛手向上:CLOSE>OPEN AND MA(CLOSE,5)>MA(CLOSE,10) AND MA(CLOSE,10)>MA(CLOSE,30)
AND DIFF1>DEA1 AND MACD1>REF(MACD1,1) AND DIFF1>0 AND DEA1>0 AND MA(VOL,5)>MA(VOL,34)
AND MA(CLOSE,30)>=REF(MA(CLOSE,30),1);
{2、漫步青云}
DIFF2:= EMA(CLOSE,12) - EMA(CLOSE,26);
DEA2 := EMA(DIFF2,27);
DJE:=DIFF2>=0 AND DEA2>=0 AND CROSS(DIFF2,DEA2);
A5:=MA(CLOSE,5)>MA(CLOSE,10);
V5:=VOL>MA(VOL,5) AND MA(VOL,5)>MA(VOL,10);
漫步青云:DJE AND A5 AND V5 AND MA(CLOSE,30)>=REF(MA(CLOSE,30),1);
{3、空中缆绳}
DIFF3:= EMA(CLOSE,12) - EMA(CLOSE,26);
DEA3 := EMA(DIFF3,27);
MACD3:= 2*(DIFF3-DEA3);
B:=MIN(DIFF3,DEA3)/MAX(DIFF3,DEA3)>0.95;
空中缆绳:MA(CLOSE,30)>REF(MA(CLOSE,30),1) AND DIFF3>0 AND DEA3>0 AND MACD3>REF(MACD3,1) AND B;
{4、小鸭出水}
DIFF4:= EMA(CLOSE,12) - EMA(CLOSE,26);
DEA4 := EMA(DIFF4,27);
小鸭出水:MA(C,30)>=REF(MA(C,30),1) AND DIFF4<0 AND DEA4<0 AND CROSS(DIFF4,DEA4) AND MA(C,5)>MA(C,10) AND MA(V,5)>MA(V,34);
{5、海底捞月}
DIFF5:= EMA(CLOSE,12) - EMA(CLOSE,26);
DEA5 := EMA(DIFF5,27);
MACD5:= 2*(DIFF5-DEA5);
海底捞月:DIFF5<0 AND DEA5<0 AND CROSS(DIFF5,DEA5) AND VOL>MA(VOL,5) AND MA(VOL,5)>MA(VOL,34) AND MA(C,30)>=REF(MA(C,30),1);
{6、天鹅展翅}
DIFF6:= EMA(CLOSE,12) - EMA(CLOSE,26);
DEA6 := EMA(DIFF6,27);
MACD6:= 2*(DIFF6-DEA6);
天鹅展翅:MACD6>0 AND CROSS(DIFF6,0); |