通达信【万箭穿心】副图指标 一击必中终难逃 用法详解 源码
HGW1:=(CLOSE-LLV(LOW,9));
HGW2:=(HHV(HIGH,9)-LLV(LOW,9));
HGW3:=HGW1/HGW2*100;
HGW4:=SMA(HGW3,2,1);
HGW5:=SMA(HGW4,2,1);
HGW6:=3*HGW4-2*HGW5;
HGW7:=CROSS(HGW6,0);
HGW8:=(EMA(CLOSE,15)-EMA(CLOSE,26));
HGW16:=EMA(HGW8,5);
MACD:2*(HGW8-HGW16),COLORSTICK;
DIF2:4*HGW8-3*HGW16,COLORFF00FF;
HGW17:=EMA(DIF2,1);
HGW19:=MACD<0 AND MACD>REF(MACD,1) AND REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4);
IF(C>HGW17,HGW17,DRAWNULL),COLOR0000F0,LINETHICK3;
IF(HGW17<=REF(HGW17,1),HGW17,DRAWNULL),COLOR00E600,LINETHICK3;
STICKLINE(HGW19,1,MACD,2,0),COLORFF00FF;
分界线:0,COLORFF00FF;
DRAWICON(HGW19,1.5,1);
DRAWICON(HGW7 AND HGW19,1.2,1);
DRAWTEXT(HGW7 AND HGW19,1.3,'←万箭穿心'),COLOR00FFFF;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1.8,0),COLOR000055;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1.1,0),COLOR000099;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0.6,0),COLOR0000BB;
STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,1.8,0),COLOR40FF00;
STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,1.1,0),COLOR40FF00;
STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,0.6,0),COLOR40FF00;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1.8,0),COLOR000055;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1.1,0),COLOR000099;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,0.6,0),COLOR0000BB;
STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,1.8,0),COLOR40FF00;
STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,1.1,0),COLOR40FF00;
STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,0.6,0),COLOR40FF00;
来函数检测结果如下:
该公式没有未来函数
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
HGW1赋值:(收盘价-9日内最低价最低值)
HGW2赋值:(9日内最高价最高值-9日内最低价最低值)
HGW3赋值:HGW1/HGW2*100
HGW3的2日[1日权重]移动平均
HGW4的2日[1日权重]移动平均
HGW6赋值:3*HGW4-2*HGW5
HGW7赋值:HGW6上穿0
HGW8赋值:(收盘价的15日指数移动平均-收盘价的26日指数移动平均)
HGW16:=HGW8的5日指数移动平均
输出MACD:2*(HGW8-HGW16),COLORSTICK
输出DIF2:4*HGW8-3*HGW16,COLORFF00FF
HGW17:=DIF2的1日指数移动平均
HGW19:=MACD<0 AND MACD>1日前的MACD AND 1日前的MACD<2日前的MACD AND 2日前的MACD<3日前的MACD AND 3日前的MACD<4日前的MACD
如果C>HGW17返回HGW17否则返回DRAWNULL
IF(HGW17<=1日前的HGW17,HGW17,DRAWNULL),COLOR00E600, 线宽为3
当满足条件HGW19时,在1和MACD之间画柱状线
输出分界线:0,COLORFF00FF
当满足条件HGW19时,在1.5和1之间画图标
当满足条件HGW7 AND HGW19时,在1.2和1之间画图标
当满足条件HGW7 AND HGW19时,在1.3和'←万箭穿心'位置书写文字
STICKLINE(MACD>1日前的MACD AND MACD>0,0,MACD,1.8,0),COLOR000055
STICKLINE(MACD>1日前的MACD AND MACD>0,0,MACD,1.1,0),COLOR000099
STICKLINE(MACD>1日前的MACD AND MACD>0,0,MACD,0.6,0),COLOR0000BB
STICKLINE(MACD<=1日前的MACD AND MACD>0,0,MACD,1.8,0),COLOR40FF00
STICKLINE(MACD<=1日前的MACD AND MACD>0,0,MACD,1.1,0),COLOR40FF00
STICKLINE(MACD<=1日前的MACD AND MACD>0,0,MACD,0.6,0),COLOR40FF00
STICKLINE(MACD>1日前的MACD AND MACD<0,0,MACD,1.8,0),COLOR000055
STICKLINE(MACD>1日前的MACD AND MACD<0,0,MACD,1.1,0),COLOR000099
STICKLINE(MACD>1日前的MACD AND MACD<0,0,MACD,0.6,0),COLOR0000BB
STICKLINE(MACD<=1日前的MACD AND MACD<0,0,MACD,1.8,0),COLOR40FF00
STICKLINE(MACD<=1日前的MACD AND MACD<0,0,MACD,1.1,0),COLOR40FF00
STICKLINE(MACD<=1日前的MACD AND MACD<0,0,MACD,0.6,0),COLOR40FF00