多周期MACD【副图指标】

{多周期MACD}

背景色:DRAWGBK(C>0, RGB(0,0,0),RGB(0,0,10'该数值可以调整'),0,0,0);{浅色背景};

{周线MACD}
    DIF周:(EMA(CLOSE,30)-EMA(CLOSE,90))*0.55,NODRAW,COLOR00FFFF;
    DEA周:(EMA(DIF周,26))NODRAW,COLORGREEN;
    MACD周:=(DIF周-DEA周)*2, COLORSTICK;
    周线MACD走势:DRAWBAND(DEA周,RGB(135,255,35),DIF周,RGB(240,160,0));
    周线MACD:DRAWTEXT(CURRBARSCOUNT=1,DIF周,'--周MACD'),COLORRED;

{日线MACD}
    DIF日:EMA(CLOSE,12)-EMA(CLOSE,26)NODRAW,COLORRED;
    DEA日:EMA(DIF日,9)NODRAW,COLORLIBLUE;
    日线MACD走势:DRAWBAND(DIF日,RGB(255,80,120),DEA日,RGB(21,138,255));
    日线MACD:DRAWTEXT(CURRBARSCOUNT=1,DIF日,'--日MACD'),COLOR00FFFF;

{60分钟MACD}
    DIF60:EMA(CLOSE,12/2)-EMA(CLOSE,26/2)NODRAW,COLORMAGENTA;
    DEA60:EMA(DIF60,9/2)NODRAW,COLORGREEN;
    MACD60分钟走势:DRAWBAND(DIF60,RGB(120,20,255),DEA60,RGB(80,255,20));
    MACD60分钟:DRAWTEXT(CURRBARSCOUNT=1,DIF60,'--60分钟MACD'),COLORFF00FF;

{30分钟MACD}
    DIF30:(EMA(CLOSE,12/4)-EMA(CLOSE,26/4))NODRAW,COLORRED;
    DEA30:(EMA(DIF30,9/4))NODRAW,COLORGREEN;
    MACD30分钟走势:DRAWBAND(DIF30,RGB(220,50,50),DEA30,RGB(50,120,50));
    MACD30分钟:DRAWTEXT(CURRBARSCOUNT=1,DIF30,'--30分钟MACD'),COLORGREEN;

{日MACD柱}
    零轴:0,COLOR555555;
    MACD:(DIF日-DEA日)*2,COLORRED,COLORSTICK; {COLORSTICK}
    STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1,1),COLORRED,;
    STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,1,1),COLOR4080FF,;
    STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1,1),COLORYELLOW,;
    STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,1,1),COLORLIGREEN,;

(0)

相关推荐