通达信美化版MACD
SHORT:=9;
LONG:=26;
MID:=12;
DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG),LINETHICK1;
{股票指标网}
DEA:=EMA(DIF,MID),LINETHICK2;
MACD:=(DIF-DEA)*2,COLORSTICK;
STICKLINE(MACD>0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLOR0000FF;
STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,1,0),COLOR000066;
STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,1,0),COLOR00CC33;
STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLOR006633;
DIFF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG),LINETHICK1;
DEAA:EMA(DIF,MID),COLOR00FFFF,LINETHICK1;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
SHORT赋值:9
LONG赋值:26
MID赋值:12
DIF赋值:收盘价的SHORT日指数移动平均-收盘价的LONG日指数移动平均,LINETHICK1
{股票指标网}
DEA赋值:DIF的MID日指数移动平均, 线宽为2
MACD赋值:(DIF-DEA)*2,COLORSTICK
STICKLINE(MACD>0 AND MACD>=1日前的MACD,0,MACD,1,0),COLOR0000FF
STICKLINE(MACD>0 AND MACD<1日前的MACD,0,MACD,1,0),COLOR000066
STICKLINE(MACD<0 AND MACD<1日前的MACD,0,MACD,1,0),COLOR00CC33
STICKLINE(MACD<0 AND MACD>=1日前的MACD,0,MACD,1,0),COLOR006633
DIFF:收盘价的SHORT日指数移动平均-收盘价的LONG日指数移动平均,LINETHICK1
输出
DEAA:DIF的MID日指数移动平均,COLOR00FFFF,LINETHICK1