唐山信息港

通達信多線MACD指標公式

更新時間:2020-03-11 15:48

N1:=30;
N2:=60;
N3:=90;
N4:=120;
N5:=150;
M:=12;
Q:=9;
DIFF:=(EMA(CLOSE,12)-EMA(CLOSE,26));
DEA:=EMA(DIFF,9);
MACD2:=2*(DIFF-DEA);
STICKLINE(MACD2>=0,0,MACD2,2,0),COLORFF00FF;
STICKLINE(MACD2>=0 AND MACD2<REF(MACD2,1),0,MACD2,2,1),COLORGREEN;
STICKLINE(MACD2<0,0,MACD2,2,0),COLORFFFF00;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,2,0),COLORYELLOW;
DIFF_1:=(EMA(CLOSE,M)-EMA(CLOSE,N1));
DEA_1:=EMA(DIFF_1,Q);
MACD_1:=2*(DIFF_1-DEA_1);
DIFF_2:=(EMA(CLOSE,M)-EMA(CLOSE,N2));
DEA_2:=EMA(DIFF_2,Q);
MACD_2:=2*(DIFF_2-DEA_2);
DIFF_3:=(EMA(CLOSE,M)-EMA(CLOSE,N3));
DEA_3:=EMA(DIFF_3,Q);
MACD_3:=2*(DIFF_3-DEA_3);
DIFF_4:=(EMA(CLOSE,M)-EMA(CLOSE,N4));
DEA_4:=EMA(DIFF_4,Q);
MACD_4:=2*(DIFF_4-DEA_4);
DIFF_5:=(EMA(CLOSE,M)-EMA(CLOSE,N5));
DEA_5:=EMA(DIFF_5,Q);
MACD_5:=2*(DIFF_5-DEA_5);
X_1:=EMA(SUM(MACD_1,2),3);
X_2:=EMA(SUM(MACD_2,2),3);
X_3:=EMA(SUM(MACD_3,2),3);
X_4:=EMA(SUM(MACD_4,2),3);
X_5:=EMA(SUM(MACD_5,2),3);
多線MACD:(X_1+X_2+X_3+X_4+X_5)/5,COLORBLUE,LINETHICK2;
均線:MA(多線MACD,3);
TJ_B1:=(HHV(MACD_1,4)<0 AND MACD_1>REF(MACD_1,1) AND REF(MACD_1,1)<REF(MACD_1,2) AND REF(MACD_1,2)<REF(MACD_1,3));
TJ_S1:=(LLV(MACD_1,4)>0 AND MACD_1<REF(MACD_1,1) AND REF(MACD_1,1)>REF(MACD_1,2) AND REF(MACD_1,2)>REF(MACD_1,3));
TJ_B2:=(HHV(MACD_2,4)<0 AND MACD_2>REF(MACD_2,1) AND REF(MACD_2,1)<REF(MACD_2,2) AND REF(MACD_2,2)<REF(MACD_2,3));
TJ_S2:=(LLV(MACD_2,4)>0 AND MACD_2<REF(MACD_2,1) AND REF(MACD_2,1)>REF(MACD_2,2) AND REF(MACD_2,2)>REF(MACD_2,3));
TJ_B3:=(HHV(MACD_3,4)<0 AND MACD_3>REF(MACD_3,1) AND REF(MACD_3,1)<REF(MACD_3,2) AND REF(MACD_3,2)<REF(MACD_3,3));
TJ_S3:=(LLV(MACD_3,4)>0 AND MACD_3<REF(MACD_3,1) AND REF(MACD_3,1)>REF(MACD_3,2) AND REF(MACD_3,2)>REF(MACD_3,3));
TJ_B4:=(HHV(MACD_4,4)<0 AND MACD_4>REF(MACD_4,1) AND REF(MACD_4,1)<REF(MACD_4,2) AND REF(MACD_4,2)<REF(MACD_4,3));
TJ_S4:=(LLV(MACD_4,4)>0 AND MACD_4<REF(MACD_4,1) AND REF(MACD_4,1)>REF(MACD_4,2) AND REF(MACD_4,2)>REF(MACD_4,3));
TJ_B5:=(HHV(MACD_5,4)<0 AND MACD_5>REF(MACD_5,1) AND REF(MACD_5,1)<REF(MACD_5,2) AND REF(MACD_5,2)<REF(MACD_5,3));
TJ_S5:=(LLV(MACD_5,4)>0 AND MACD_5<REF(MACD_5,1) AND REF(MACD_5,1)>REF(MACD_5,2) AND REF(MACD_5,2)>REF(MACD_5,3));
BB_TJ:=(TJ_B1+TJ_B2+TJ_B3+TJ_B4+TJ_B5)>=3,NODRAW;
SS_TJ:=(TJ_S1+TJ_S2+TJ_S3+TJ_S4+TJ_S5)>=3;
DRAWICON(TJ_B1,多線MACD,1);
DRAWICON(TJ_S1,多線MACD,2);
DRAWICON(TJ_B2,多線MACD,1);
DRAWICON(TJ_S2,多線MACD,2);
DRAWICON(TJ_B3,多線MACD,1);
DRAWICON(TJ_S3,多線MACD,2);
DRAWICON(TJ_B4,多線MACD,1);
DRAWICON(TJ_S4,多線MACD,2);
DRAWICON(TJ_B5,多線MACD,1);
DRAWICON(TJ_S5,多線MACD,2);
DRAWICON(BB_TJ,多線MACD,34);
DRAWICON(SS_TJ,多線MACD,35);

通達信多線MACD指標公式

推薦文章

收音鸡赚钱 北京pk赛车官网开结果 南昌股票期货配资 北京11选5规则 体育彩票广西11选5 盈在线上有名杨方配资 黑龙江省福彩快乐十分 藏宝阁2肖2码默认论坛 浙江11选五玩法规则 富成配资 河北十一选五的走势图一定牛