股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 通达信专攻MACD公式,本人多次测试的私有指标,真实准确率83%!


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2023-10-9 19:57:30

以下是通达信专攻MACD公式,本人多次测试的私有指标,真实准确率83%!

通达信专攻MACD公式,本人多次测试的私有指标,真实准确率83%!

源码

DRAWGBK(C>0, RGB(40,120,20),RGB(00,00,00),0,0,1),LINETHICK2;
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9),COLORGREEN,LINETHICK2;
MACD:(DIF-DEA)*2,COLORSTICK;
DIF1:EMA(CLOSE,8)-EMA(CLOSE,18),COLORYELLOW,LINETHICK2;
DEA1:=EMA(DIF1,8),COLORWHITE,LINETHICK2;

空中加油:IF(DIF>REF(DIF,1) AND DIF>=DEA AND REF(DIF,1)<=REF(DIF,2) AND REF(DIF,1)>=REF(DEA,1) ,1,0),NODRAW;
DRAWICON(空中加油=1,DIF,23);

STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR00BBFF;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,1,0 ),COLOR00DDFF;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,0,0 ),COLOR00FFFF;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,2,0 ),COLOR0011EE;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,1,0 ),COLOR0033DD;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,0,0 ),COLOR0055FF;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORBB11BB;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,1,0 ),COLORDD33BB;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,0,0 ),COLORFF55BB;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,2,0 ),COLORFFBB11;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,1,0 ),COLORFFDD33;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,0,0 ),COLORFFFF55;

JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,-0.18,6,0),COLORFF00FF;
DRAWICON(二次金叉,DEA*1.1,13) ;
VAR0004:="MACD.DIF#WEEK"(6,13,5);
VAR0005:="MACD.DEA#WEEK"(6,13,5);
VAR0006:="MACD.MACD#WEEK"(6,13,5);
VAR7:="MACD.DIF#MONTH"(6,13,5);
VAR8:="MACD.DEA#MONTH"(6,13,5);
周金叉:IF(CROSS(VAR0004,VAR0005),0.3,0)LINESTICK, COLORRED,LINETHICK3;
月金叉:IF(CROSS(VAR7,VAR8),-0.5,0)LINESTICK, COLORYELLOW,LINETHICK3;
零轴金叉:IF(CROSS(VAR0004,0),0.2,0)LINESTICK,COLORGREEN,LINETHICK2;
0,LINETHICK3;
DRAWICON(CROSS(MACD,0),MACD,1);
DRAWICON(CROSS(DIF1,0),DIF1,1);
DRAWICON(CROSS(DIF,DEA),DIF,1);
DRAWICON(CROSS(DEA,DIF),DEA,2);
低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;

DRAWTEXT(低位金叉,-0.2,' 金叉'),COLORFFFFFF;
JCCOUNT1:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二次金叉1:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,-0.18,10,0),COLOR0042CC;
STICKLINE(二次金叉,0,-0.18,8,0),COLOR004FF2;
STICKLINE(二次金叉,0,-0.18,8,0),COLOR3375FF;
DRAWTEXT(二次金叉,-0.2,' 金叉二'),COLOR3375FF;
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,10,0),COLORCECE00;
STICKLINE(底背离,0,0.13,4,0),COLORFFFF00;
STICKLINE(底背离,0,0.13,2,0),COLORFFFF44;
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORFFFFFF,LINETHICK1;
DRAWTEXT(底背离,0.3,' 底背离'),COLORFFFF26;
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,LINETHICK1;





回复

举报

QQ|

GMT+8, 2024-11-20 17:38

快速回复 返回顶部 返回列表