【通达信免费源码】MACD平滑背离 转载和谐完全加密指标源码
XA_1:=EMA(EMA(EMA(CLOSE,N),N),9);
TRIX:(XA_1-REF(XA_1,1))/REF(XA_1,1)*20000;
MATRIX:MA(TRIX,M),COLORYELLOW;
MACD:(TRIX-MATRIX)*2,COLORSTICK;
STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,1,0),COLOR009999;
STICKLINE(MACD>REF(MACD,1) AND MACD>=0,0,MACD,1,0),COLORFF66FF;
XA_2:=CROSS(0,TRIX);
STICKLINE(XA_2,0,MACD,0.1,1),COLOR0088FF;
XA_3:=MACD<0 AND MACD>REF(MACD,1) AND REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4);
STICKLINE(XA_3,0,MACD,0.3,0),COLORMAGENTA;
XA_4:=MACD>0 AND MACD<REF(MACD,1) AND REF(MACD,1)>REF(MACD,2) AND REF(MACD,2)>REF(MACD,3) AND REF(MACD,3)>REF(MACD,4);
XA_5:=MACD>0 AND MACD>REF(MACD,1) AND REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4);
XA_6:=BARSLAST(REF(XA_3,1));
XA_7:=REF(CLOSE,XA_6+1)>CLOSE AND MACD>REF(MACD,XA_6+1) AND XA_3;
DRAWLINE(BARSLAST(XA_3=0),MACD,XA_7,MACD,0),DOTLINE,COLORMAGENTA;
XA_8:=BARSLAST(REF(XA_4,1));
XA_9:=REF(CLOSE,XA_8+1)<CLOSE AND MACD<REF(MACD,XA_8+1) AND XA_4;
STICKLINE(XA_7,MACD-0.2,TRIX,1,0),COLORYELLOW;
版权声明
本文版权归掌上指标所有。
未经许可,不得转载,转载请注明出处!