主力资金 黑马启动 非妖即顶配合使用通达信公式 副图 源码附图
X_1:=VOL;
X_2:=SMA((CLOSE-REF(CLOSE,1))*X_1,3,1)/10000;
X_3:=EMA(X_2,12)-EMA(X_2,26);
X_4:=EMA(X_3,9);
X_5:=(X_3-X_4)*2;
主力资金:X_5,NODRAW,COLORYELLOW;
流入:CROSS(X_5,0),NODRAW,COLORRED;
DRAWICON(CROSS(X_5,0),REF(X_5,1),38);
流出:CROSS(0,X_5),NODRAW,COLORGREEN;
DRAWICON(CROSS(0,X_5),REF(X_5,1),39);
X_6:=1;{股票指标网 }
X1:=CLOSE*VOL,NODRAW;
X2:=EMA((EMA(X1,3)/EMA(VOL,3)+EMA(X1,6)/EMA(VOL,6)+EMA(X1,12)/EMA(VOL,12)+EMA(X1,24)/EMA(VOL,24))/4,13),NODRAW;
X3:=(EMA(CLOSE,5)*7+EMA(CLOSE,10)*3)/10,NODRAW;
X_7:=X3;
X_8:=X1;
X_9:=X2;
X_10:=1.06*X_9;
X_11:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100>6;
X_12:=EMA(HIGH,10)*(1+6/100);
X_13:=X_6 AND X_11>0 AND CROSS(CLOSE,X_12) AND CROSS(CLOSE,X_10);
X_14:=FILTER(CROSS(X_7,EMA(HIGH,55)*(1+10/100)),5);
黑马启动:IF(X_6 AND X_13,1,0),NODRAW,COLORRED;
非妖即顶:IF(X_6 AND X_14,1,0),NODRAW,COLORMAGENTA;
STICKLINE(X_5>0 AND X_5>=REF(X_5,1),X_5,0,3,1),COLORRED;
STICKLINE(X_5>0 AND X_5<REF(X_5,1),X_5,0,3,1),COLORGREEN;
STICKLINE(X_5<0,X_5,0,3,1),COLORCYAN;
STICKLINE(黑马启动>0,X_5,0,4,0),COLORRED;
STICKLINE(非妖即顶>0,X_5,0,4,0),COLORMAGENTA;
X_15:=X_6;
X_16:=IF(X_6<=0,0,HHVBARS(X_5,BARSLAST(X_5<0)+1));
X_17:=IF(X_15>0,CROSS(BACKSET(CROSS(0,X_5),REF(X_16,1)+2),0.5),0);
X_18:=CROSS(BACKSET(CROSS(0,X_5) OR (ISLASTBAR AND X_5>0),REF(X_16,1)+2),0.5);
X_19:=DRAWLINE(X_17,X_5,REF(X_17,1),REF(X_5,1),1);
NOTEXT前高:X_19,COLORGRAY;
X_20:=LLVBARS(X_5,BARSLAST(X_5>0)+1);
X_21:=CROSS(BACKSET(CROSS(X_5,0),REF(X_20,1)+2),0.5);
X_22:=BARSLAST(FILTERX(CROSS(0,X_5),BARSCOUNT(CLOSE)));
X_23:=DRAWLINE(X_21,X_5,REF(X_21,1),REF(X_5,1),1);
NOTEXT前低:X_23,COLORGRAY;
X_24:=IF(X_5<0,FILTERX(X_5=LLV(X_5,BARSLAST(X_5>0)),BARSCOUNT(CLOSE)),DRAWNULL);
X_25:=BARSLAST(X_24);
X_26:=FILTERX(X_5<CONST(LLV(X_5,X_22+1)),BARSCOUNT(CLOSE));
X_27:=BARSLAST(X_26);
X_28:=IF(X_22+1>=1,CONST(LLV(X_5,X_22+1)),DRAWNULL);
NOTEXT本低:X_28,COLORWHITE;
X_29:=CROSS(COUNT(CROSS(X_5>X_28/2 AND X_5<0,0.5),X_25)=1,0.5) AND X_25>=0;
X_30:=IF(ISLASTBAR AND X_5>0 AND X_5=HHV(X_5,BARSLAST(X_5<0)),1,IF(FILTERX(X_18,BARSCOUNT(CLOSE)),2,DRAWNULL));
X_31:=X_30=1 OR X_30=2 AND X_5>0;
X_32:=FILTERX(X_31,BARSCOUNT(CLOSE));
X_33:=DRAWLINE(X_32,X_5,REF(X_32,1),REF(X_5,1),1);
NOTEXT本高:X_33,COLORWHITE;
X_34:=CONST(REF(X_5,BARSLAST(X_32)));
X_35:=X_5>X_34;
X_36:=FILTERX(REFX(BARSLAST(X_35),1)=1,BARSCOUNT(CLOSE));
NOTEXT天数:BARSLAST(X_36),NODRAW,COLORYELLOW;
NOTEXT上横线:DRAWLINE(X_36,X_34,X_32,X_34,0),DOTLINE,COLORGREEN;
NOTEXT下横线:DRAWLINE(X_26,CONST(LLV(X_5,X_22+1)),X_24=1,X_5,0),DOTLINE,COLORYELLOW;
X_37:=IF(X_36,BARSNEXT(X_32),DRAWNULL);
X_38:=IF(NOTEXT天数>0 AND NOTEXT天数<=REF(X_37,NOTEXT天数),SUM(X_5>0,NOTEXT天数),DRAWNULL);
X_39:=REF(CLOSE,NOTEXT天数);
X_40:=(X_39-CLOSE)/CLOSE*100;
X_41:=BARSLAST(X_32);
X_42:=CROSS(COUNT(CROSS(X_5<X_33/2 AND X_5>0,0.5),X_32)=1,0.5) AND X_32>=0;
STICKLINE(X_5>X_19 AND X_33>X_19 AND BARSLAST(CROSS(X_5<X_33/2,0.5))>0 AND X_5>(X_19+X_33)/2,X_5,X_19,1,0),COLORYELLOW;
X_43:=IF(X_5>0 AND X_33!=X_19,DRAWLINE(X_42,(X_19+X_33)/2,REF(X_42,1),REF((X_19+X_33)/2,1),1),DRAWNULL);
STICKLINE(X_5>X_19,X_5,X_19,1,0),COLORYELLOW;
STICKLINE(X_42,X_5,0,1,0),COLORGREEN;
STICKLINE(X_5<0 AND X_5<X_23 AND X_23<0,X_5,X_23,1,0),COLORBLUE;
X_44:=IF(CROSS(X_5<0,0.5),BARSNEXT(X_24),DRAWNULL);
X_45:=BARSLAST(X_5>0)-1;
STICKLINE(BARSLAST(X_29)>=0 AND X_5<X_23 AND X_5<0,X_5,X_23,1,0),COLORGREEN;
STICKLINE(X_29,X_5,0,1,0),COLORWHITE;
STICKLINE(X_5>X_19 AND X_33>X_19 AND BARSLAST(X_42)>0,X_5,X_19,1,0),COLORRED;
STICKLINE(CROSS(X_19,0.01) OR CROSS(X_33,0.01),X_5,0,0,0),COLORWHITE;
STICKLINE(CROSS(X_23<0,0.01) OR CROSS(X_28<0,0.01),X_5,0,0,0),COLORWHITE;
IF(BARSLAST(X_29)>=0,X_28/2,DRAWNULL),DOTLINE,COLORRED;
未来函数检测结果如下:
该公式包含未来函数:BACKSET
该公式包含未来函数:BARSNEXT
该公式包含未来函数:REFX
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
X_1赋值:成交量
X_2赋值:SMA((收盘价-1日前的收盘价)*X_1,3,1)/10000
X_3赋值:X_2的12日指数移动平均-X_2的26日指数移动平均
X_4赋值:X_3的9日指数移动平均
X_5赋值:(X_3-X_4)*2
输出主力资金:X_5,NODRAW,画黄色
输出流入:X_5上穿0,NODRAW,画红色
DRAWICON(X_5上穿0,1日前的X_5,38)
输出流出:0上穿X_5,NODRAW,画绿色
DRAWICON(0上穿X_5,1日前的X_5,39)
X_6赋值:1
{股票指标网 }
X1赋值:收盘价*成交量,NODRAW
X2赋值:EMA((EMA(X1,3)/EMA(成交量,3)+EMA(X1,6)/EMA(成交量,6)+EMA(X1,12)/EMA(成交量,12)+EMA(X1,24)/EMA(成交量,24))/4,13),NODRAW
X3赋值:(收盘价的5日指数移动平均*7+收盘价的10日指数移动平均*3)/10,NODRAW
X_7赋值:X3
X_8赋值:X1
X_9赋值:X2
X_10:=1.06*X_9
X_11:=(收盘价-1日前的收盘价)/1日前的收盘价*100>6
X_12:=最高价的10日指数移动平均*(1+6/100)
X_13:=X_6 AND X_11>0 AND 收盘价上穿X_12 AND 收盘价上穿X_10
X_14:=FILTER(CROSS(X_7,最高价的55日指数移动平均*(1+10/100)),5)
如果X_6 AND X_13返回1否则返回0
如果X_6 AND X_14返回1否则返回0
STICKLINE(X_5>0 AND X_5>=1日前的X_5,X_5,0,3,1),画红色
STICKLINE(X_5>0 AND X_5<1日前的X_5,X_5,0,3,1),画绿色
当满足条件X_5<0时,在X_5和0之间画柱状线
当满足条件黑马启动>0时,在X_5和0之间画柱状线
当满足条件非妖即顶>0时,在X_5和0之间画柱状线
X_15:=X_6
X_16:=IF(X_6<=0,0,HHVBARS(X_5,上次X_5<0距今天数+1))
X_17:=IF(X_15>0,CROSS(BACKSET(CROSS(0,X_5),1日前的X_16+2),0.5),0)
X_18:=CROSS(BACKSET(CROSS(0,X_5) OR (ISLASTBAR AND X_5>0),1日前的X_16+2),0.5)
X_19:=DRAWLINE(X_17,X_5,1日前的X_17,1日前的X_5,1)
输出NOTEXT前高:X_19,COLORGRAY
X_20:=LLVBARS(X_5,上次X_5>0距今天数+1)
X_21:=CROSS(BACKSET(CROSS(X_5,0),1日前的X_20+2),0.5)
X_22:=上次FILTERX(0上穿X_5,收盘价的有效数据周期数距今天数)
X_23:=DRAWLINE(X_21,X_5,1日前的X_21,1日前的X_5,1)
输出NOTEXT前低:X_23,COLORGRAY
X_24:=IF(X_5<0,FILTERX(X_5=LLV(X_5,上次X_5>0距今天数),收盘价的有效数据周期数),DRAWNULL)
X_25:=上次X_24距今天数
X_26:=FILTERX(X_5
X_27:=上次X_26距今天数
X_28:=IF(X_22+1>=1,CONST(X_22+1日内X_5最低值),DRAWNULL)
输出NOTEXT本低:X_28,画白色
X_29:=CROSS(COUNT(CROSS(X_5>X_28/2 AND X_5<0,0.5),X_25)=1,0.5) AND X_25>=0
X_30:=IF(ISLASTBAR AND X_5>0 AND X_5=HHV(X_5,上次X_5<0距今天数),1,IF(FILTERX(X_18,收盘价的有效数据周期数),2,DRAWNULL))
X_31:=X_30=1 OR X_30=2 AND X_5>0
X_32:=FILTERX(X_31,收盘价的有效数据周期数)
X_33:=DRAWLINE(X_32,X_5,1日前的X_32,1日前的X_5,1)
输出NOTEXT本高:X_33,画白色
X_34:=CONST(REF(X_5,上次X_32距今天数))
X_35:=X_5>X_34
X_36:=FILTERX(REFX(上次X_35距今天数,1)=1,收盘价的有效数据周期数)
输出NOTEXT天数:上次X_36距今天数,NODRAW,画黄色
输出NOTEXT上横线:DRAWLINE(X_36,X_34,X_32,X_34,0),DOTLINE,画绿色
输出NOTEXT下横线:DRAWLINE(X_26,CONST(X_22+1日内X_5最低值),X_24=1,X_5,0),DOTLINE,画黄色
X_37:=IF(X_36,BARSNEXT(X_32),DRAWNULL)
X_38:=IF(NOTEXT天数>0 AND NOTEXT天数<=NOTEXT天数日前的X_37,NOTEXT天数的X_5>0日累和,DRAWNULL)
X_39:=NOTEXT天数日前的收盘价
X_40:=(X_39-收盘价)/收盘价*100
X_41:=上次X_32距今天数
X_42:=CROSS(COUNT(CROSS(X_50,0.5),X_32)=1,0.5) AND X_32>=0
STICKLINE(X_5>X_19 AND X_33>X_19 AND 上次X_50 AND X_5>(X_19+X_33)/2,X_5,X_19,1,0),画黄色
X_43:=IF(X_5>0 AND X_33!=X_19,DRAWLINE(X_42,(X_19+X_33)/2,1日前的X_42,REF((X_19+X_33)/2,1),1),DRAWNULL)
当满足条件X_5>X_19时,在X_5和X_19之间画柱状线
当满足条件X_42时,在X_5和0之间画柱状线
当满足条件X_5<0 AND X_5
X_44:=IF(X_5<0上穿0.5,BARSNEXT(X_24),DRAWNULL)
X_45:=上次X_5>0距今天数-1
STICKLINE(上次X_29距今天数>=0 AND X_5当满足条件X_29时,在X_5和0之间画柱状线
STICKLINE(X_5>X_19 AND X_33>X_19 AND 上次X_42距今天数>0,X_5,X_19,1,0),画红色
STICKLINE(X_19上穿0.01 OR X_33上穿0.01,X_5,0,0,0),画白色
STICKLINE(X_23<0上穿0.01 OR X_28<0上穿0.01,X_5,0,0,0),画白色
IF(上次X_29距今天数>=0,X_28/2,DRAWNULL),DOTLINE,画红色