通达信“MACD共振”指标公式和选股公式——指标分享,胜率76.82%
公式如下:
DIF:="MACD.DIF";
DEA:="MACD.DEA";
WDIF:="MACD.DIF#WEEK";
WDEA:="MACD.DEA#WEEK";
MDIF:="MACD.DIF#MONTH";
MDEA:="MACD.DEA#MONTH";
DJC:=CROSS(DIF,DEA);
WJC:=CROSS(WDIF,WDEA);
MJC:=CROSS(MDIF,MDEA);
STICKLINE(DIF>DEA,1,2,4,0),COLORLIRED;
STICKLINE(DIF
STICKLINE(WDIF>WDEA,-0.5,0.5,4,0),COLORLIRED;
STICKLINE(WDIF
STICKLINE(MDIF>MDEA,-1,-2,4,0),COLORLIRED;
STICKLINE(MDIF
DRAWTEXT_FIX(C>O,0.01,0.9,0,'微信公众号:彩虹桥投资学习'),COLORRED;
DRAWTEXT(ISLASTBAR,1.5,'日'),COLORWHITE;
DRAWTEXT(ISLASTBAR,0,'周'),COLORWHITE;
DRAWTEXT(ISLASTBAR,-1.5,'月'),COLORWHITE;
GZ1:=DJC AND WJC AND MDIF>MDEA;
GZ2:=DJC AND WDIF>WDEA AND MJC;
GZ3:=DIF>DEA AND WJC AND MJC;
GZ4:=DJC AND WJC AND MJC;
STICKLINE(GZ1,-2.5,2.5,2,0),COLORWHITE;
DRAWTEXT(GZ1,2,'日周金叉'),COLORWHITE;
STICKLINE(GZ2,-2.5,2.5,2,0),COLORYELLOW;
DRAWTEXT(GZ2,2,'日月金叉'),COLORYELLOW;
STICKLINE(GZ3,-2.5,2.5,2,0),COLORMAGENTA;
DRAWTEXT(GZ3,2,'周月金叉'),COLORMAGENTA;
STICKLINE(GZ4,-2.5,2.5,2,0),COLORRED;
DRAWTEXT(GZ4,2,'日周月金叉'),COLORRED;
有四组共振信号,就做个“MACD共振”的选股公式吧。
选股公式如下:
DIF:="MACD.DIF";DEA:="MACD.DEA";WDIF:="MACD.DIF#WEEK";WDEA:="MACD.DEA#WEEK";MDIF:="MACD.DIF#MONTH";MDEA:="MACD.DEA#MONTH";DJC:=CROSS(DIF,DEA);WJC:=CROSS(WDIF,WDEA);MJC:=CROSS(MDIF,MDEA);GZ1:=DJC AND WJC AND MDIF>MDEA;GZ2:=DJC AND WDIF>WDEA AND MJC;GZ3:=DIF>DEA AND WJC AND MJC;GZ4:=DJC AND WJC AND MJC;XG:GZ1 OR GZ2 OR GZ3 OR GZ4;
测试一下,平仓规则是,不论盈亏,以持股5天后平仓为条件
胜率76.82%
END