个股,大盘MACD同时看{源码,贴图}介绍
个股,大盘MACD同时看{源码,贴图}
个股,大盘MACD同时看{源码,贴图}:
在一张图上同时显示大盘和个股的MACD 指标,可以省去来回翻看大盘,也方便对比个股与大盘是否联动。
需要说明一点有过长期停牌的个股大盘MACD显示不正常,不知何故?如郑州煤电
{个股用,加了B,S 买卖点,即个股MACD}
input: long(26,20,100) ,short(12,5,40,) , m(9,2,60);
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA : EMA(DIFF,M);
MACD : 2*(DIFF-DEA), COLORSTICK;
bu:=cross(DIFF,DEA );
SEL:=cross(dea,diff);
drawtext(bu,macd,'B'),ALIGN1,VALIGN0,colorred,linethick4;
drawtext(sel,macd,'S'),ALIGN1,VALIGN2,colorgreen,linethick4;
{大盘用,加了B,S 买卖点,大盘MACD}
input: long(26,20,100) ,short(12,5,40,) , m(9,2,60);
DIFF1 : EMA(INDEXC,SHORT) - EMA(INDEXC,LONG);
DEA1 : EMA(DIFF1,M);
MACD1 : 2*(DIFF1-DEA1), COLORSTICK;
bu:=cross(DIFF1,DEA1 );
SEL:=cross(dea1,diff1);
drawtext(bu,macd1,'B'),ALIGN1,VALIGN0,colorred,linethick4;
drawtext(sel,macd1,'S'),ALIGN1,VALIGN2,colorgreen,linethick4;
gd17468