专攻MACD本人多次测试的私有指标真实准确率83%!
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;
未来函数检测结果如下:
该公式包含未来函数:#MONTH
该公式包含未来函数:#WEEK
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
DIF赋值:收盘价的12日指数移动平均-收盘价的26日指数移动平均
输出
DEA:DIF的9日指数移动平均,画绿色, 线宽为2
输出
MACD:(DIF-DEA)*2,COLORSTICK
DIF1:收盘价的8日指数移动平均-收盘价的18日指数移动平均,画黄色, 线宽为2
DEA1:=DIF1的8日指数移动平均,画白色, 线宽为2
输出空中加油:IF(DIF>1日前的DIF AND DIF>=DEA AND 1日前的DIF<=2日前的DIF AND 1日前的DIF>=1日前的DEA ,1,0),NODRAW
当满足条件空中加油=1时,在DIF和23之间画图标
STICKLINE(MACD<1日前的MACDAND MACD>0,0,MACD,2,0 ),COLOR00BBFF
STICKLINE(MACD<1日前的MACDAND MACD>0,0,MACD,1,0 ),COLOR00DDFF
STICKLINE(MACD<1日前的MACDAND MACD>0,0,MACD,0,0 ),COLOR00FFFF
STICKLINE(MACD>=1日前的MACDAND MACD>0,0,MACD,2,0 ),COLOR0011EE
STICKLINE(MACD>=1日前的MACDAND MACD>0,0,MACD,1,0 ),COLOR0033DD
STICKLINE(MACD>=1日前的MACDAND MACD>0,0,MACD,0,0 ),COLOR0055FF
STICKLINE(MACD>1日前的MACDAND MACD<0,0,MACD,2,0 ),COLORBB11BB
STICKLINE(MACD>1日前的MACDAND MACD<0,0,MACD,1,0 ),COLORDD33BB
STICKLINE(MACD>1日前的MACDAND MACD<0,0,MACD,0,0 ),COLORFF55BB
STICKLINE(MACD<=1日前的MACDAND MACD<0,0,MACD,2,0 ),COLORFFBB11
STICKLINE(MACD<=1日前的MACDAND MACD<0,0,MACD,1,0 ),COLORFFDD33
STICKLINE(MACD<=1日前的MACDAND MACD<0,0,MACD,0,0 ),COLORFFFF55
JCCOUNT赋值:COUNT(DIF上穿DEA,上次DEA>=0距今天数)
二次金叉赋值:DIF上穿DEA AND DEA<0 AND 统计21日满足JC=2的天数=1
当满足条件二次金叉时,在0和-0.18之间画柱状线
当满足条件二次金叉时,在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(VAR0004上穿VAR0005,0.3,0)LINESTICK, 画红色, 线宽为3
输出
月金叉:IF(VAR7上穿VAR8,-0.5,0)LINESTICK, 画黄色, 线宽为3
输出
零轴金叉:IF(VAR0004上穿0,0.2,0)LINESTICK,画绿色, 线宽为2
0, 线宽为3
{}
DRAWICON(MACD上穿0,MACD,1)
DRAWICON(DIF1上穿0,DIF1,1)
DRAWICON(DIF上穿DEA,DIF,1)
DRAWICON(DEA上穿DIF,DEA,2)
低位金叉赋值:DIF上穿DEA AND DIF<-0.1
当满足条件低位金叉时,在-0.2和' 金叉'位置书写文字
JCCOUNT1:=COUNT(DIF上穿DEA,上次DEA>=0距今天数)
二次金叉1:=DIF上穿DEA AND DEA<0 AND 统计21日满足JC=2的天数=1
当满足条件二次金叉时,在0和-0.18之间画柱状线
当满足条件二次金叉时,在0和-0.18之间画柱状线
当满足条件二次金叉时,在0和-0.18之间画柱状线
当满足条件二次金叉时,在-0.2和' 金叉二'位置书写文字
A1赋值:上次1日前的DIF上穿DEA距今天数
底背离赋值:A1+1日前的收盘价>收盘价 AND DIF>A1+1日前的DIF AND DIF上穿DEA
当满足条件底背离时,在0和0.13之间画柱状线
当满足条件底背离时,在0和0.13之间画柱状线
当满足条件底背离时,在0和0.13之间画柱状线
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORFFFFFF,LINETHICK1
当满足条件底背离时,在0.3和' 底背离'位置书写文字
A2赋值:上次1日前的DEA上穿DIF距今天数
顶背离赋值:A2+1日前的收盘价<收盘价 AND A2+1日前的DIF>DIF AND DEA上穿DIF
DRAWLINE(A2=0,DEA,顶背离,DEA,0),画绿色,LINETHICK1