如何使用通达信副图指标-MACD背离指标附指标源码
MACD背离、级别、操作模式MACD指标的背离就是指MACD指标的图形的走势正好和K线图的走势方向正好相反。MACD指标的背离有顶背离和底背离两种。顶背离当股价K线图上的股票走势一峰比一峰高,股价一直在向上涨,而MACD指标图形上的由红柱构成的图形的走势是一峰比一峰低,即当股价的高点比前一次的高点高、而MACD指标的高点比指标的前一次高点低,这叫顶背离现象。顶背离现象一般是股价在高位即将反转转势的信号,表明股价短期内即将下跌,是卖出股票的信号。底背离底背离一般出现在股价的低位区。当股价K线图上的股票走势,股价还在下跌,而MACD指标图形上的由绿柱构成的图形的走势是一底比一底高,即当股价的低点比前一次低点底,而指标的低点却比前一次的低点高,这叫底背离现象。底背离现象一般是预示股价在低位可能反转向上的信号,表明股价短期内可能反弹向上,是短期买入股票的信号。在实践中,MACD指标的背离一般出现在强势行情中比较可靠,股价在高价位时,通常只要出现一次背离的形态即可确认位股价即将反转,而股价在低位时,一般要反复出现几次背离后才能确认。因此,MACD指标的顶背离研判的准确性要高于底背离,这点投资者要加以留意。【详细阅读】MACD背离指标源码DIFF:EMA(CLOSE,12)-EMA(CLOSE,27);DEA:EMA(DIFF,9);MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK2;低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;DRAWTEXT(低位金叉,0.16,' 低位金叉'),COLORWHITE;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;DRAWICON(二次金叉,DEA*0.9,1) ;DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4;DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,0.25,'三全项'),COLOR0000FF,LINETHICK2; 多谢分享哈…… 还不错,有水平!!!继续,学习了 nice!!!!!!!!!!!! 亏损中…………………… 围观中~~~
页:
[1]
2