通达信金牌MACD指标源码分享
GG:=VOL/SUM(REF(VOL,1),5);ZS:=INDEXV/SUM(REF(INDEXV,1),5);量比:GG/ZS COLORBLUE;SQX:=(C-MA(CLOSE,13))*3;DIFF:EMA(MA(SQX,7),1),COLORWHITE;DEA:EMA(DIFF,7),COLORYELLOW;MACD:=(DIFF-DEA)*2,COLORSTICK;低位金叉:IF(CROSS(DIFF,DEA) AND DIFF< -0.1,1,DRAWNULL),COLORYELLOW,LINETHICK4,CROSSDOT;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次金叉:IF(CROSS(DIFF,DEA) AND DEA< 0 AND COUNT(JCCOUNT=2,21)=1,1.1,DRAWNULL),COLORFF00FF,LINETHICK4,CROSSDOT;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:IF(REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA),1.2,DRAWNULL),COLORRED,LINETHICK4,CROSSDOT;势:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED LINETHICK2;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)< CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF),COLORWHITE;顶背离_:IF(REF(CLOSE,A2+1)< CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF),1.3,DRAWNULL) ,COLORF08000,LINETHICK4,CROSSDOT;压:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN LINETHICK2;A3:=CROSS(DIFF,DEA) AND DEA< 0;零下二次金叉_:IF(FILTER(COUNT(A3,21)=2,10),1.4,DRAWNULL) ,COLORWHITE,LINETHICK4,CROSSDOT;NN:=35;N:=20;M:=18;AAA1:=-(EMA(CLOSE,NN/2) - EMA(CLOSE,N/2))*10,COLORYELLOW;BBB1:=EMA(AAA1,M/2),COLORWHITE;MACD2:=100*(AAA1-BBB1)/N/2, COLORSTICK;STICKLINE(MACD2>=0,MACD2,0,0.000001,0) COLORRED;STICKLINE(MACD2< 0,MACD2,0,0.000001,0) COLORCYAN;年线:EMA(MACD2,250) COLORMAGENTA;SHORT:=6;LONG:=10;MID:=5;DIF1:=EMA(CLOSE,SHORT)*10-EMA(CLOSE,LONG)*10 COLORBROWN;DEA1:=EMA(DIF1,MID) COLORBLUE;MACD1:=(DIF1-DEA1)*2,COLORSTICK;STICKLINE(MACD1>=0,MACD1,0,0.0000001,0) COLORMAGENTA;STICKLINE(MACD1< 0,MACD1,0,0.0000001,0) COLORGREEN;0.7 POINTDOT COLORYELLOW;3 POINTDOT COLORWHITE;
来函数检测结果如下:
该公式没有未来函数
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
GG赋值:成交量/5的1日前的成交量日累和
ZS赋值:INDEXV/5的1日前的INDEXV日累和
输出量比:GG/ZS 画蓝色
SQX赋值:(C-收盘价的13日简单移动平均)*3
输出DIFF:ESQX的7日简单移动平均,1),画白色
输出DEA:DIFF的7日指数移动平均,画黄色
MACD赋值:(DIFF-DEA)*2,COLORSTICK
输出低位金叉:IF(DIFF上穿DEA AND DIFF< -0.1,1,DRAWNULL),画黄色,LINETHICK4,CROSSDOT
JCCOUNT赋值:COUNT(DIFF上穿DEA,上次DEA>=0距今天数)
输出二次金叉:IF(DIFF上穿DEA AND DEA< 0 AND 统计21日满足JC=2的天数=1,1.1,DRAWNULL),COLORFF00FF,LINETHICK4,CROSSDOT
A1赋值:上次1日前的DIFF上穿DEA距今天数
输出底背离:IF(A1+1日前的收盘价>收盘价 AND DIFF>A1+1日前的DIFF AND DIFF上穿DEA,1.2,DRAWNULL),画红色,LINETHICK4,CROSSDOT
输出势:DRAWLINE(A1=0,DEA,底背离,DEA,0),画红色 LINETHICK2
A2赋值:上次1日前的DEA上穿DIFF距今天数
顶背离赋值:A2+1日前的收盘价< 收盘价 AND A2+1日前的DIFF>DIFF AND DEA上穿DIFF,画白色
顶背离_:IF(A2+1日前的收盘价< 收盘价 AND A2+1日前的DIFF>DIFF AND DEA上穿DIFF,1.3,DRAWNULL) ,COLORF08000,LINETHICK4,CROSSDOT
输出压:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN LINETHICK2
A3赋值:DIFF上穿DEA AND DEA< 0
零下二次金叉_:IF(FILTER(统计21日满足A3的天数=2,10),1.4,DRAWNULL) ,画白色,LINETHICK4,CROSSDOT
NN赋值:35
N赋值:20
M赋值:18
AAA1赋值:-(收盘价的NN/2日指数移动平均 - 收盘价的N/2日指数移动平均)*10,画黄色
BBB1赋值:AAA1的M/2日指数移动平均,画白色
MACD2:=100*(AAA1-BBB1)/N/2, COLORSTICK
当满足条件MACD2>=0时,在MACD2和0之间画柱状线
当满足条件MACD2< 0时,在MACD2和0之间画柱状线
输出年线:MACD2的250日指数移动平均 COLORMAGENTA
SHORT赋值:6
LONG:=10
MID:=5
DIF1赋值:收盘价的SHORT日指数移动平均*10-收盘价的LONG日指数移动平均*10 COLORBROWN
DEA1:=DIF1的MID日指数移动平均 画蓝色
MACD1:=(DIF1-DEA1)*2,COLORSTICK
当满足条件MACD1>=0时,在MACD1和0之间画柱状线
当满足条件MACD1< 0时,在MACD1和0之间画柱状线
0.7 POINTDOT 画黄色
3 POINTDOT 画白色