多周期MACD指标 通达信公式源码

拾荒网 MACD 553


 

 

DIF:EMA(CLOSE,10)-EMA(CLOSE,22);
DEA:EMA(DIF,7);
MACD:(DIF-DEA)*2,COLORSTICK;
DRAWTEXT(CROSS(DIF,DEA),DIF,'☆'),COLORRED;
{DRAWICON(CROSS(DIF,DEA),DIF*1.05,1);
DRAWICON(CROSS(DEA,DIF),DEA*0.90,2);}
月DIF:="MACD.DIF#MONTH"COLOR0080FF;
月DEA:="MACD.DEA#MONTH",COLOR0080FF,LINETHICK2;
周DIF:="MACD.DIF#WEEK"COLORRED;
周DEA:="MACD.DEA#WEEK",COLORRED,LINETHICK2;
日DIF:="MACD.DIF",COLORWHITE;
日DEA:="MACD.DEA",COLORWHITE,LINETHICK2;
日金:IF(CROSS(日DIF,日DEA),0.1,0),COLORYELLOW;
周金:IF(CROSS(周DIF,周DEA),0.125,0),COLORRED;
月金:IF(CROSS(月DIF,月DEA),0.15,0),COLORGREEN;
DRAWICON(周金 AND 日金,-0.1,7);
DRAWICON(周金 AND 月金,-0.15,11);
DRAWICON(日金 AND 月金,-0.1,1);
日死:IF(CROSS(日DEA,日DIF),-0.1,0),COLORYELLOW;
周死:IF(CROSS(周DEA,周DIF),-0.125,0),COLORRED;
月死:IF(CROSS(月DEA,月DIF),-0.15,0),COLORGREEN;
DRAWICON(周死 AND 日死,-0.1,8);
DRAWICON(周死 AND 月死,-0.15,12);
DRAWICON(日死 AND 月死,-0.15,2);