撑压线通达信公式 主图 源码附图
X_1:=CLOSE/REF(CLOSE,1)>1.095;
STICKLINE(X_1,OPEN,CLOSE,0.8,0),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0,0,0,HYBLOCK);
DRAWTEXT_FIX(ISLASTBAR,0.05,0,0,DYBLOCK);
DRAWTEXT_FIX(ISLASTBAR,0.1,0,0,GNBLOCK);
X_2:=MA(VOL,5);
X_3:=CONST(PEAKBARS(X_2,50,1));
X_4:=CONST(PEAKBARS(X_2,50,2));
X_5:=CONST(PEAKBARS(X_2,50,3));
X_6:=CONST(PEAKBARS(X_2,50,4));
X_7:=CONST(PEAKBARS(X_2,50,5));
X_8:=CONST(PEAKBARS(X_2,50,6));
X_9:=CONST(TROUGHBARS(X_2,50,1));
X_10:=CONST(TROUGHBARS(X_2,50,2));
X_11:=CONST(TROUGHBARS(X_2,50,3));
X_12:=CONST(TROUGHBARS(X_2,50,4));
X_13:=CONST(TROUGHBARS(X_2,50,5));
X_14:=CONST(TROUGHBARS(X_2,50,6));
X_15:=CONST(FINDLOW(LOW,X_3,X_4-X_3,1));
X_16:=CONST(FINDLOW(LOW,X_4,X_5-X_4,1));
X_17:=CONST(FINDLOW(LOW,X_5,X_6-X_5,1));
X_18:=CONST(FINDLOW(LOW,X_6,X_7-X_6,1));
X_19:=CONST(FINDLOW(LOW,X_7,X_8-X_7,1));
DRAWLINE(LOW=X_15 AND CURRBARSCOUNT>X_3,X_15,CURRBARSCOUNT=1,X_15,1),DOTLINE,COLORGREEN;
DRAWLINE(LOW=X_16 AND CURRBARSCOUNT>X_4,X_16,CURRBARSCOUNT=1,X_16,1),DOTLINE,COLORGREEN;
DRAWLINE(LOW=X_17 AND CURRBARSCOUNT>X_5,X_17,CURRBARSCOUNT=1,X_17,1),DOTLINE,COLORGREEN;
DRAWLINE(LOW=X_18 AND CURRBARSCOUNT>X_6,X_18,CURRBARSCOUNT=1,X_18,1),DOTLINE,COLORGREEN;
DRAWLINE(LOW=X_19 AND CURRBARSCOUNT>X_7,X_19,CURRBARSCOUNT=1,X_19,1),DOTLINE,COLORGREEN;
X_20:=CONST(FINDHIGH(HIGH,X_9,X_10-X_9,1));
X_21:=CONST(FINDHIGH(HIGH,X_10,X_11-X_10,1));
X_22:=CONST(FINDHIGH(HIGH,X_11,X_12-X_11,1));
X_23:=CONST(FINDHIGH(HIGH,X_12,X_13-X_12,1));
X_24:=CONST(FINDHIGH(HIGH,X_13,X_14-X_13,1));
DRAWLINE(HIGH=X_20 AND CURRBARSCOUNT>X_9,HIGH,CURRBARSCOUNT=1,X_20,1),DOTLINE,COLORRED;
DRAWLINE(HIGH=X_21 AND CURRBARSCOUNT>X_10,HIGH,CURRBARSCOUNT=1,X_21,1),DOTLINE,COLORRED;
DRAWLINE(HIGH=X_22 AND CURRBARSCOUNT>X_11,HIGH,CURRBARSCOUNT=1,X_22,1),DOTLINE,COLORRED;
DRAWLINE(HIGH=X_23 AND CURRBARSCOUNT>X_12,HIGH,CURRBARSCOUNT=1,X_23,1),DOTLINE,COLORRED;
DRAWLINE(HIGH=X_24 AND CURRBARSCOUNT>X_13,HIGH,CURRBARSCOUNT=1,X_24,1),DOTLINE,COLORRED;
未来函数检测结果如下:
该公式包含未来函数:PEAK
该公式包含未来函数:PEAKBARS
该公式包含未来函数:TROUGH
该公式包含未来函数:TROUGHBARS
该公式包含未来函数:DHIGH
该公式包含未来函数:DLOW
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
X_1赋值:收盘价/1日前的收盘价>1.095
当满足条件X_1时,在开盘价和收盘价之间画柱状线
当满足条件ISLASTBAR时,在横轴0纵轴0位置书写文字
当满足条件ISLASTBAR时,在横轴0.05纵轴0位置书写文字
当满足条件ISLASTBAR时,在横轴0.1纵轴0位置书写文字
X_2赋值:成交量的5日简单移动平均
X_3赋值:CONST(PEAKBARS(X_2,50,1))
X_4赋值:CONST(PEAKBARS(X_2,50,2))
X_5赋值:CONST(PEAKBARS(X_2,50,3))
X_6赋值:CONST(PEAKBARS(X_2,50,4))
X_7赋值:CONST(PEAKBARS(X_2,50,5))
X_8赋值:CONST(PEAKBARS(X_2,50,6))
X_9赋值:CONST(TROUGHBARS(X_2,50,1))
X_10:=CONST(TROUGHBARS(X_2,50,2))
X_11:=CONST(TROUGHBARS(X_2,50,3))
X_12:=CONST(TROUGHBARS(X_2,50,4))
X_13:=CONST(TROUGHBARS(X_2,50,5))
X_14:=CONST(TROUGHBARS(X_2,50,6))
X_15:=CONST(FIND最低价(最低价,X_3,X_4-X_3,1))
X_16:=CONST(FIND最低价(最低价,X_4,X_5-X_4,1))
X_17:=CONST(FIND最低价(最低价,X_5,X_6-X_5,1))
X_18:=CONST(FIND最低价(最低价,X_6,X_7-X_6,1))
X_19:=CONST(FIND最低价(最低价,X_7,X_8-X_7,1))
DRAWLINE(最低价=X_15 AND 到最后交易的周期>X_3,X_15, 到最后交易的周期=1,X_15,1),DOTLINE,画绿色
DRAWLINE(最低价=X_16 AND 到最后交易的周期>X_4,X_16, 到最后交易的周期=1,X_16,1),DOTLINE,画绿色
DRAWLINE(最低价=X_17 AND 到最后交易的周期>X_5,X_17, 到最后交易的周期=1,X_17,1),DOTLINE,画绿色
DRAWLINE(最低价=X_18 AND 到最后交易的周期>X_6,X_18, 到最后交易的周期=1,X_18,1),DOTLINE,画绿色
DRAWLINE(最低价=X_19 AND 到最后交易的周期>X_7,X_19, 到最后交易的周期=1,X_19,1),DOTLINE,画绿色
X_20:=CONST(FIND最高价(最高价,X_9,X_10-X_9,1))
X_21:=CONST(FIND最高价(最高价,X_10,X_11-X_10,1))
X_22:=CONST(FIND最高价(最高价,X_11,X_12-X_11,1))
X_23:=CONST(FIND最高价(最高价,X_12,X_13-X_12,1))
X_24:=CONST(FIND最高价(最高价,X_13,X_14-X_13,1))
DRAWLINE(最高价=X_20 AND 到最后交易的周期>X_9,最高价, 到最后交易的周期=1,X_20,1),DOTLINE,画红色
DRAWLINE(最高价=X_21 AND 到最后交易的周期>X_10,最高价, 到最后交易的周期=1,X_21,1),DOTLINE,画红色
DRAWLINE(最高价=X_22 AND 到最后交易的周期>X_11,最高价, 到最后交易的周期=1,X_22,1),DOTLINE,画红色
DRAWLINE(最高价=X_23 AND 到最后交易的周期>X_12,最高价, 到最后交易的周期=1,X_23,1),DOTLINE,画红色
DRAWLINE(最高价=X_24 AND 到最后交易的周期>X_13,最高价, 到最后交易的周期=1,X_24,1),DOTLINE,画红色