【四色柱】经典不牛指标副图——源码发放
DIF:=10*(EMA(CLOSE,20)-EMA(CLOSE,120));
DEA:=EMA(DIF,10);
MACD:=(DIF-DEA)*2,COLORSTICK;
A3:=DIF;
STICKLINE(A3>REF(A3,1)AND A3<0,0,A3,-1,0),COLOR003399;
STICKLINE(A3>REF(A3,1)AND A3<0,0,A3,2,0),COLOR0099BB;
STICKLINE(A3>REF(A3,1)AND A3<0,0,A3,1,0),COLOR00AADD;
STICKLINE(A3>REF(A3,1)AND A3<0,0,A3,0.1,0),COLOR00FFFF;
STICKLINE(A3>REF(A3,1)AND A3>0,0,A3,-1,0),COLOR000099;
STICKLINE(A3>REF(A3,1)AND A3>0,0,A3,2,0),COLOR0000BB;
STICKLINE(A3>REF(A3,1)AND A3>0,0,A3,1,0),COLOR0000DD;
STICKLINE(A3>REF(A3,1)AND A3>0,0,A3,0.1,0),COLOR0000FF;
STICKLINE(A3<REF(A3,1)AND A3<0,0,A3,-1,0),COLOR339900;
STICKLINE(A3<REF(A3,1)AND A3<0,0,A3,2,0),COLOR77BB00;
STICKLINE(A3<REF(A3,1)AND A3<0,0,A3,1,0),COLOR9ADD00;
STICKLINE(A3<REF(A3,1)AND A3<0,0,A3,0.1,0),COLORDDFF00;
STICKLINE(A3<REF(A3,1)AND A3>0,0,A3,-1,0),COLOR330099;
STICKLINE(A3<REF(A3,1)AND A3>0,0,A3,2,0),COLOR9900BB;
STICKLINE(A3<REF(A3,1)AND A3>0,0,A3,1,0),COLORBB00DD;
STICKLINE(A3<REF(A3,1)AND A3>0,0,A3,0.1,0),COLORFF00FF;
{DRAWICON(MACD>REF(MACD,1)AND DIF<-20 AND REF(MACD,1)<REF(MACD,2),DIF,1);
DRAWICON(MACD<REF(MACD,1)AND DIF>20 AND REF(MACD,1)>REF(MACD,2),DIF,2)};
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
DIF赋值:10*(收盘价的20日指数移动平均-收盘价的120日指数移动平均)
DEA赋值:DIF的10日指数移动平均
MACD赋值:(DIF-DEA)*2,COLORSTICK
A3赋值:DIF
STICKLINE(A3>1日前的A3AND A3<0,0,A3,-1,0),COLOR003399
STICKLINE(A3>1日前的A3AND A3<0,0,A3,2,0),COLOR0099BB
STICKLINE(A3>1日前的A3AND A3<0,0,A3,1,0),COLOR00AADD
STICKLINE(A3>1日前的A3AND A3<0,0,A3,0.1,0),COLOR00FFFF
STICKLINE(A3>1日前的A3AND A3>0,0,A3,-1,0),COLOR000099
STICKLINE(A3>1日前的A3AND A3>0,0,A3,2,0),COLOR0000BB
STICKLINE(A3>1日前的A3AND A3>0,0,A3,1,0),COLOR0000DD
STICKLINE(A3>1日前的A3AND A3>0,0,A3,0.1,0),COLOR0000FF
STICKLINE(A3<1日前的A3AND A3<0,0,A3,-1,0),COLOR339900
STICKLINE(A3<1日前的A3AND A3<0,0,A3,2,0),COLOR77BB00
STICKLINE(A3<1日前的A3AND A3<0,0,A3,1,0),COLOR9ADD00
STICKLINE(A3<1日前的A3AND A3<0,0,A3,0.1,0),COLORDDFF00
STICKLINE(A3<1日前的A3AND A3>0,0,A3,-1,0),COLOR330099
STICKLINE(A3<1日前的A3AND A3>0,0,A3,2,0),COLOR9900BB
STICKLINE(A3<1日前的A3AND A3>0,0,A3,1,0),COLORBB00DD
STICKLINE(A3<1日前的A3AND A3>0,0,A3,0.1,0),COLORFF00FF
{DRAWICON(MACD>1日前的MACDAND DIF<-20 AND 1日前的MACD<2日前的MACD,DIF,1)
DRAWICON(MACD<1日前的MACDAND DIF>20 AND 1日前的MACD>2日前的MACD,DIF,2)}