通达信胤夫老师原创 MACD 一眼看清主升 副图指标 源码 附图
V1:=IF(C/REF(C,1) AND C=O AND C=H,HHV(V,10),V);
C1:=IF(C>O,H,L);
MAH:=MA(H,3);
MA20:=MA(C1,20);
MA60:=MA(C1,60);
DIF:=V1*MAH-V1*MA20,LINETHICK2;
DEA:=EMA(DIF,6),LINETHICK2;
MACD:(DIF-DEA)*2,COLORSTICK,COLORGREEN;
DIF2:=V1*MAH-V1*MA60;
DEA2:=EMA(DIF,6),LINETHICK2;
MACD2:(DIF2-DEA2)*2,COLORSTICK;
DRAWBAND(-DIF2,RGB(100,55,0),-DEA2,RGB(255,0,255));
DRAWBAND(DIF,RGB(255,255,0),DEA,RGB(0,255,0));
DRAWBAND(DEA,RGB(222,111,0),-DEA2,RGB(0,11,222));
升:=(-DIF2<-DEA2 AND DIF>DEA AND DEA>-DEA2);
STICKLINE(MACD>REF(MACD,1),MACD,REF(MACD,1),2,0),COLOR000080;
STICKLINE(MACD>REF(MACD,1),MACD,REF(MACD,1),0.1,0),COLOR0000FF;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,MACD,REF(MACD,1),2,0),COLOR8C008C;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,MACD,REF(MACD,1),0.1,0),COLORFF00FF;
STICKLINE(MACD<REF(MACD,1) AND MACD>0,MACD,REF(MACD,1),2,0),COLOR009D9D;
STICKLINE(MACD<REF(MACD,1) AND MACD>0,MACD,REF(MACD,1),0.1,0),COLOR00FFFF;
STICKLINE(MACD<REF(MACD,1) AND MACD<0,MACD,REF(MACD,1),2,0),COLOR008000;
STICKLINE(MACD<REF(MACD,1) AND MACD<0,MACD,REF(MACD,1),0.1,0),COLOR00FF00;
STICKLINE(MACD2>REF(MACD2,1),-MACD2,-REF(MACD2,1),2,0),COLOR000080;
STICKLINE(MACD2>REF(MACD2,1),-MACD2,-REF(MACD2,1),0.1,0),COLOR0000FF;
STICKLINE(MACD2>REF(MACD2,1) AND MACD2<0,-MACD2,-REF(MACD2,1),2,0),COLOR8C008C;
STICKLINE(MACD2>REF(MACD2,1) AND MACD2<0,-MACD2,-REF(MACD2,1),0.1,0),COLORFF00FF;
STICKLINE(MACD2<REF(MACD2,1) AND MACD2>0,-MACD2,-REF(MACD2,1),2,0),COLOR009D9D;
STICKLINE(MACD2<REF(MACD2,1) AND MACD2>0,-MACD2,-REF(MACD2,1),0.1,0),COLOR00FFFF;
STICKLINE(MACD2<REF(MACD2,1) AND MACD2<0,-MACD2,-REF(MACD2,1),2,0),COLOR008000;
STICKLINE(MACD2<REF(MACD2,1) AND MACD2<0,-MACD2,-REF(MACD2,1),0.1,0),COLOR00FF00;
DRAWTEXT(升 AND COUNT(升,5)=1,MACD,'★升'),COLORWHITE;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
V1赋值:IF(C/1日前的C AND C=O AND C=H,10日内V最高值,V)
如果C>O返回H否则返回L
MAH赋值:H的3日简单移动平均
MA20赋值:C1的20日简单移动平均
MA60赋值:C1的60日简单移动平均
DIF赋值:V1*MAH-V1*MA20, 线宽为2
DEA赋值:DIF的6日指数移动平均, 线宽为2
输出MACD:(DIF-DEA)*2,COLORSTICK,画绿色
DIF2:=V1*MAH-V1*MA60
DEA2:=DIF的6日指数移动平均, 线宽为2
MACD2:(DIF2-DEA2)*2,COLORSTICK
DRAWBAND(-DIF2,RGB(100,55,0),-DEA2,RGB(255,0,255))
DRAWBAND(DIF,RGB(255,255,0),DEA,RGB(0,255,0))
DRAWBAND(DEA,RGB(222,111,0),-DEA2,RGB(0,11,222))
升赋值:(-DIF2<-DEA2 AND DIF>DEA AND DEA>-DEA2)
STICKLINE(MACD>1日前的MACD,MACD,1日前的MACD,2,0),COLOR000080
STICKLINE(MACD>1日前的MACD,MACD,1日前的MACD,0.1,0),COLOR0000FF
STICKLINE(MACD>1日前的MACD AND MACD<0,MACD,1日前的MACD,2,0),COLOR8C008C
STICKLINE(MACD>1日前的MACD AND MACD<0,MACD,1日前的MACD,0.1,0),COLORFF00FF
STICKLINE(MACD<1日前的MACD AND MACD>0,MACD,1日前的MACD,2,0),COLOR009D9D
STICKLINE(MACD<1日前的MACD AND MACD>0,MACD,1日前的MACD,0.1,0),COLOR00FFFF
STICKLINE(MACD<1日前的MACD AND MACD<0,MACD,1日前的MACD,2,0),COLOR008000
STICKLINE(MACD<1日前的MACD AND MACD<0,MACD,1日前的MACD,0.1,0),COLOR00FF00
STICKLINE(MACD2>1日前的MACD2,-MACD2,-1日前的MACD2,2,0),COLOR000080
STICKLINE(MACD2>1日前的MACD2,-MACD2,-1日前的MACD2,0.1,0),COLOR0000FF
STICKLINE(MACD2>1日前的MACD2 AND MACD2<0,-MACD2,-1日前的MACD2,2,0),COLOR8C008C
STICKLINE(MACD2>1日前的MACD2 AND MACD2<0,-MACD2,-1日前的MACD2,0.1,0),COLORFF00FF
STICKLINE(MACD2<1日前的MACD2 AND MACD2>0,-MACD2,-1日前的MACD2,2,0),COLOR009D9D
STICKLINE(MACD2<1日前的MACD2 AND MACD2>0,-MACD2,-1日前的MACD2,0.1,0),COLOR00FFFF
STICKLINE(MACD2<1日前的MACD2 AND MACD2<0,-MACD2,-1日前的MACD2,2,0),COLOR008000
STICKLINE(MACD2<1日前的MACD2 AND MACD2<0,-MACD2,-1日前的MACD2,0.1,0),COLOR00FF00
DRAWTEXT(升 AND 统计5日满足升的天数=1,MACD,'★升'),画白色