通达信极道MACD副图指标 很有特色的MACD优化改编指标 源码附图
SHORT:=12;
LONG:=26;
MID:=9;
周期:=60;
DRAWGBK(C>0, RGB(180,100,100),RGB(10,50,150),0,'',0);
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG),NODRAW;
DEA:EMA(DIF,MID),NODRAW;
DRAWBAND(DIF,RGB(150,10,150),0,RGB(10,150,150));
MACD:(DIF-DEA)*2,NODRAW;
高线:MA(REF(HHV(MACD,周期),1),2),COLORWHITE,DOTLINE;
STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,1.5,0),COLORRED;
STICKLINE(MACD>=0 AND MACD<REF(MACD,1),0,MACD,1.5,0),COLOR000050;
STICKLINE(MACD>高线,MAX(高线,0),MACD,1.5,0),COLORYELLOW;
STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,1.5,0),COLOR00AA00;
STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,1.5,0),COLOR006000;
修复:DEA,COLORBLACK,LINETHICK2;
DRAWICON(CROSS(DIF,DEA),DEA,1);
DRAWICON(CROSS(DEA,DIF),DIF,2);
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
SHORT赋值:12
LONG赋值:26
MID赋值:9
周期赋值:60
填充背景(C>0, RGB(180,100,100),RGB(10,50,150),0,'',0)
输出DIF:收盘价的SHORT日指数移动平均-收盘价的LONG日指数移动平均,NODRAW
输出DEA:DIF的MID日指数移动平均,NODRAW
DRAWBAND(DIF,RGB(150,10,150),0,RGB(10,150,150))
输出MACD:(DIF-DEA)*2,NODRAW
输出高线:MA(REF(周期日内MACD最高值,1),2),画白色,DOTLINE
STICKLINE(MACD>=0 AND MACD>=1日前的MACD,0,MACD,1.5,0),画红色
STICKLINE(MACD>=0 AND MACD<1日前的MACD,0,MACD,1.5,0),COLOR000050
STICKLINE(MACD>高线,高线和0较大值,MACD,1.5,0),画黄色
STICKLINE(MACD<0 AND MACD<1日前的MACD,0,MACD,1.5,0),COLOR00AA00
STICKLINE(MACD<0 AND MACD>=1日前的MACD,0,MACD,1.5,0),COLOR006000
输出修复:DEA,COLORBLACK, 线宽为2
DRAWICON(DIF上穿DEA,DEA,1)
DRAWICON(DEA上穿DIF,DIF,2)