MACD和KD指标
2015-10-14 15:00:03点击:
该指标由民间高手精心编写而成,将传统的MACD和KDJ两个指标融合成一个指标,当两指标同时发出买入或卖出信号,即指标曲线出现“金叉共振”为加强型买入信号,后势上涨概率较大。反之,两指标同时发出卖出信号为加强型卖出信号。
在原来的基础上,增加了MACD顶底背离和KDJ顶底背离,提供的结果仅供参考,不作为依据。
//macd
DIF:(EMA(CLOSE,12)-EMA(CLOSE,26))*100;
DEA:EMA(DIF,9),coloryellow,LINETHICK1;
MACD:(DIF-DEA)*2,COLORSTICK;
STICKLINE(MACD>0,0,MACD,2,0),colorred;
STICKLINE(MACD<0,0,MACD,2,0),colorgreen;
STICKLINE(MACD>REF(MACD,1) AND MACD<0 ,0,MACD,2,0),colorff00ff;
STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,2,0),colorliblue;
上翘:IF(DIF>REF(DIF,1),DIF,DRAWNULL),colorred,LINETHICK1;
下拐:IF(DIF<REF(DIF,1),DIF,DRAWNULL),colorliblue,LINETHICK1;
//DRAWICON(CROSS(DIF,DEA),DIF,1);
//DRAWICON(CROSS(DEA,DIF),DEA,2);
DRAWICON(CROSS(DIF,DEA),DEA,'buy');
DRAWICON(CROSS(DEA,DIF),DEA,'sell');
//macd背离
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
STICKLINE(底背离,DEA*1.09,DEA*0.86,6,0),Color00FF00;
DRAWLINE(A1=0,DEA,底背离,DEA,0),colorred,linethick1;
DRAWTEXT(底背离,DEA*1.09,' 底背离'),colorwhite;
...
...