【通达信指标源码免费送】多周期MACD同图趋势公式源码 提前一目了然

将MACD的:周、日、60分钟、30分钟整合在日级同图显示同图趋势提前一目了然,大小周期关联配合KDJ一起使用,是一个很好的短线组合指标。我们要明白大周期和小周期的关系是如何呢? 大周期因为时间间隔比较长, 所以只适合判断方向,不能捕捉买卖点;而小周期适合捕捉买卖点,不适合判断方向. 总结一句话是:大周期判断方向,小周期决定交易。

公式源码:

{周MACD}

DIF55:(EMA(CLOSE,30)-EMA(CLOSE,90))*0.55;

DEA55:(EMA(DIF55,26));

MACD周:=(DIF55-DEA55)*2, COLORSTICK;

DRAWBAND(DEA55,RGB(135,255,35),DIF55,RGB(240,160,0));

DRAWTEXT(CURRBARSCOUNT=1,DIF55,'--周MACD'),COLORRED;

{日MACD}

DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);

DEA:=EMA(DIFF,9);

DRAWBAND(DIFF,RGB(255,80,120),DEA,RGB(21,138,255));

DRAWTEXT(CURRBARSCOUNT=1,DIFF,'--日MACD'),COLOR00FFFF;

{60分MACD}

DIF60:=EMA(CLOSE,12/2)-EMA(CLOSE,26/2);

DEA60:=EMA(DIF60,9/2);

DRAWBAND(DIF60,RGB(120,20,255),DEA60,RGB(80,255,20));

DRAWTEXT(CURRBARSCOUNT=1,DIF60,'--60分钟MACD'),COLORFF00FF;

{30分MACD}

DIF30:=(EMA(CLOSE,12/4)-EMA(CLOSE,26/4)),COLORGREEN,LINETHICK2;

DEA30:=(EMA(DIF30,9/4)),COLORMAGENTA,LINETHICK2;

DRAWBAND(DIF30,RGB(220,50,50),DEA30,RGB(50,120,50));

DRAWTEXT(CURRBARSCOUNT=1,DIF30,'--30分钟MACD'),COLORGREEN;

{日MACD柱}

0,COLORWHITE,DOTLINE;

MACD:(DIFF-DEA)*2,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)

相关推荐