通達信MACD共振指標公式
基本概況:
- 指標類別: 通達信指標
- 授權(quán)方式: 免費版
- 指標評級: ★★★★★
- 指標語言: 簡體中文
- 指標來源: 互聯(lián)網(wǎng)
- 指標日期: 2017-07-31 00:00:00
內(nèi)容介紹:
通達信MACD共振指標公式:
N:=12;
M:=26;
M1:=9;
DIF:EMA(CLOSE,N)-EMA(CLOSE,M),NODRAW;
DEA:EMA(DIF,M1),NODRAW;
MACD:(DIF-DEA)*2,COLORSTICK;
{多周期統(tǒng)計}
當紅:IF(BARSLAST(MACD<0),BARSLAST(MACD<0),0),NODRAW,COLORRED;
當綠:IF(BARSLAST(MACD>0),BARSLAST(MACD>0),0),NODRAW,COLORGREEN;
{MACD周值}
周DIF:="MACD.DIF#WEEK";
周DEA:="MACD.DEA#WEEK";
周MACD:=(周DIF-周DEA)*2;
周紅:IF(周MACD>0,BARSLAST(CROSS(周MACD,0)),DRAWNULL)+1,COLORYELLOW,NODRAW;
周綠:IF(周MACD<0,BARSLAST(CROSS(0,周MACD)),DRAWNULL)+1,COLORCYAN,NODRAW;
{MACD月值}
月DIF:="MACD.DIF#MONTH";
月DEA:="MACD.DEA#MONTH";
月MACD:=(月DIF-月DEA)*2;
月紅:IF(月MACD>0,BARSLAST(CROSS(月MACD,0)),DRAWNULL)+1,COLORRED,NODRAW;
月綠:IF(月MACD<0,BARSLAST(CROSS(0,月MACD)),DRAWNULL)+1,COLORGREEN,NODRAW;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1,0),COLORRED;
STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,1,-1),COLORRED;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1,0),COLORGREEN;
STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,1,-1),COLORGREEN;
ZM:=REF(MACD,BARSLAST(周紅=1));
STICKLINE(MACD>ZM AND ZM>0,ZM,ZM,1,0),COLORWHITE;
DRAWBAND(DEA,RGB(250,250,0),DEA,RGB(0,0,0));
DRAWBAND(IF(DIF>DEA,DIF,DRAWNULL),RGB(250,0,0),DIF,RGB(0,0,0));
DRAWBAND(IF(周紅<1,DEA,DRAWNULL),RGB(0,250,0),DEA,RGB(0,0,0));
DRAWTEXT(周紅=1,0,'周'),COLORYELLOW,DRAWABOVE;
低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;
JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
DRAWTEXT(二次金叉,DEA*0.2,'二金'),COLORWHITE;
三次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=3,60)=1;
DRAWTEXT(三次金叉,DEA*0.2,'三金'),COLORLIMAGENTA;
四次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=4,90)=1;
DRAWTEXT(四次金叉,DEA*0.2,'四金'),COLORYELLOW;
五次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=5,120)=1;
DRAWTEXT(五次金叉,DEA*0.2,'五金'),COLORBROWN;
六次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=6,150)=1;
DRAWTEXT(六次金叉,DEA*0.2,'六金'),COLORBLUE;
通達信MACD共振指標公式
{MACD日線底背離}
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背離:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
DRAWTEXT(底背離,DIF*0.5,'底背'),COLORRED;
{日底背畫線:DRAWLINE(A1=0,DEA,底背離,DEA,0),COLORRED,DOTLINE;}
{MACD日線頂背離}
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
頂背離:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
DRAWTEXT(頂背離,DIF*1.12,'頂背'),COLORGREEN;
{日頂背畫線:DRAWLINE(A2=0,DEA,頂背離,DEA,0),COLORGREEN,DOTLINE;}
{MACD積背離}
JC:= DEA-DIF;
綠柱面積:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);
紅柱面積:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);
本次最低價:=LLV(L,BARSLAST(
相關(guān)推薦: