通达信末日MACD指标公式
2021/1/8 18:28:33
SHORT:=6;
LONG:=13;
MID:=4;
HJ_1:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
HJ_2:=EMA(HJ_1,MID);
HJ_3:=2*(HJ_1-HJ_2);
HJ_4:=IF(HJ_3>0,1,(-1));
HJ_5:=REF(HJ_4,1);
HJ_6:=HJ_4*HJ_5;
HJ_7:=BARSLAST(HJ_6<0);
HJ_8:=HJ_7+1;
HJ_9:=(SUM(HJ_3,0)-REF(SUM(HJ_3,0),HJ_8))/10;
HJ_10:=IF(HJ_3>0 AND HJ_3>=REF(HJ_3,1),HJ_3,0);
HJ_11:=IF(HJ_3>0 AND HJ_3<=REF(HJ_3,1),HJ_3,0);
HJ_12:=IF(HJ_3<0 AND HJ_3<REF(HJ_3,1),HJ_3,0);
HJ_13:=IF(HJ_3<0 AND HJ_3>REF(HJ_3,1),HJ_3,0);
STICKLINE(HJ_10>0,0,HJ_3,2,0),COLOR0000BB;
STICKLINE(HJ_11>0,0,HJ_3,2,1),COLOR0000BB;
STICKLINE(HJ_12<0,HJ_3,0,2,0),COLORGREEN;
STICKLINE(HJ_13<0,HJ_3,0,2,1),COLORGREEN;
快线:HJ_1,COLORWHITE;
慢线:HJ_2,COLORYELLOW;
乖离:HJ_3*100,NODRAW;
面积:=HJ_9,NODRAW;
HJ_14:=CROSS(HJ_1,HJ_2) AND HJ_1<(-0.01);
DRAWICON(HJ_14,HJ_2*1.02,36);
HJ_15:=COUNT(CROSS(HJ_1,HJ_2),BARSLAST(HJ_2>=0));
HJ_16:=CROSS(HJ_1,HJ_2) AND HJ_2<0 AND COUNT(HJ_15=2,21)=1;
DRAWICON(HJ_16,HJ_2*1.12,1);
HJ_17:=BARSLAST(REF(CROSS(HJ_1,HJ_2),1));
HJ_18:=REF(CLOSE,HJ_17+1)>CLOSE AND HJ_1>REF(HJ_1,HJ_17+1) AND CROSS(HJ_1,HJ_2);
底背:DRAWLINE(HJ_17=0,HJ_2,HJ_18,HJ_2,0),COLORMAGENTA,LINETHICK2;
DRAWICON(HJ_18,HJ_2*1.22,38);
HJ_19:=BARSLAST(REF(CROSS(HJ_2,HJ_1),1));
HJ_20:=REF(CLOSE,HJ_19+1)<CLOSE AND REF(HJ_1,HJ_19+1)>HJ_1 AND CROSS(HJ_2,HJ_1);
顶背:DRAWLINE(HJ_19=0,HJ_2,HJ_20,HJ_2,0),COLORGREEN,LINETHICK2;
DRAWICON(HJ_20,HJ_2*1.02,2);
DRAWICON(HJ_14 AND HJ_16 AND HJ_18,HJ_2*1.32,9);
HJ_21:=ATAN((HJ_1/REF(HJ_1,1)-1)*100)*180/3.141159;
HJ_22:=ATAN((HJ_2/REF(HJ_2,1)-1)*100)*180/3.141159;
HJ_23:=HJ_1>REF(HJ_1,1) AND REF(HJ_1,1)>REF(HJ_1,2) AND REF(HJ_1,3)<REF(HJ_1,2);
HJ_24:=HJ_2>REF(HJ_2,1) AND REF(HJ_2,1)>REF(HJ_2,2) AND REF(HJ_2,3)<REF(HJ_2,2);
夹角:HJ_21-HJ_22>=30 AND HJ_23 AND HJ_24,NODRAW,COLORGREEN;
投股 票网 www.tou18. cn
股市公式下载推荐