量能分析法线上买入通达信公式 副图 源码附图
X_1:=OBV-MA(OBV,30);
W1:STICKLINE(X_1>0,X_1,0,3,1),COLORRED;
W2:STICKLINE(X_1<0,X_1,0,3,1),COLORCYAN;
X_2:=HHVBARS(X_1,BARSLAST(X_1<0)+1);
X_3:=CROSS(BACKSET(CROSS(0,X_1),REF(X_2,1)+2),0.5);
X_4:=CROSS(BACKSET(CROSS(0,X_1) OR (ISLASTBAR AND X_1>0),REF(X_2,1)+2),0.5);
前高:DRAWLINE(X_3,X_1,REF(X_3,1),REF(X_1,1),1),COLORMAGENTA;
X_5:=LLVBARS(X_1,BARSLAST(X_1>0)+1);
X_6:=CROSS(BACKSET(CROSS(X_1,0),REF(X_5,1)+2),0.5);
X_7:=BARSLAST(FILTERX(CROSS(0,X_1),BARSCOUNT(CLOSE)));
前低:DRAWLINE(X_6,X_1,REF(X_6,1),REF(X_1,1),1);
X_8:=IF(X_1<0,FILTERX(X_1=LLV(X_1,BARSLAST(X_1>0)),BARSCOUNT(CLOSE)),DRAWNULL);
X_9:=BARSLAST(X_8);
X_10:=FILTERX(X_1<CONST(LLV(X_1,X_7+1)),BARSCOUNT(CLOSE));
X_11:=BARSLAST(X_10);
本低:IF(X_7+1>=1,CONST(LLV(X_1,X_7+1)),DRAWNULL);
X_12:=CROSS(COUNT(CROSS(X_1>本低/2 AND X_1<0,0.5),X_9)=1,0.5) AND X_9>=0;
X_13:=IF(ISLASTBAR AND X_1>0 AND X_1=HHV(X_1,BARSLAST(X_1<0)),1,IF(FILTERX(X_4,BARSCOUNT(CLOSE)),2,DRAWNULL));
X_14:=X_13=1 OR X_13=2 AND X_1>0;
X_15:=FILTERX(X_14,BARSCOUNT(CLOSE));
本高:DRAWLINE(X_15,X_1,REF(X_15,1),REF(X_1,1),1),COLORWHITE;
X_16:=CONST(REF(X_1,BARSLAST(X_15)));
X_17:=X_1>X_16;
X_18:=FILTERX(REFX(BARSLAST(X_17),1)=1,BARSCOUNT(CLOSE));
X_19:=BARSLAST(X_18);
X_20:=DRAWLINE(X_18,X_16,X_15,X_16,0);
X_21:=DRAWLINE(X_10,CONST(LLV(X_1,X_7+1)),X_8=1,X_1,0);
TDXSTEP1219:DRAWNUMBER(X_8,CONST(LLV(X_1,X_7+1))*0.9,X_11);
TDXSTEP1220:DRAWNUMBER(X_15,X_20*1.1,X_19);
X_22:=IF(X_18,BARSNEXT(X_15),DRAWNULL);
X_23:=IF(X_19>0 AND X_19<=REF(X_22,X_19),SUM(X_1>0,X_19),DRAWNULL);
X_24:=REF(CLOSE,X_19);
X_25:=(X_24-CLOSE)/CLOSE*100;
X_26:=BARSLAST(X_15);
X_27:=CROSS(COUNT(CROSS(X_1<本高/2 AND X_1>0,0.5),X_15)=1,0.5) AND X_15>=0;
TDXSTEP1221:STICKLINE(X_1>前高 AND 本高>前高 AND BARSLAST(CROSS(X_1<本高/2,0.5))>0 AND X_1>(前高+本高)/2,X_1,前高,1,0),COLORYELLOW;
前高本高二分位:IF(X_1>0 AND 本高!=前高,DRAWLINE(X_27,(前高+本高)/2,REF(X_27,1),REF((前高+本高)/2,1),1),DRAWNULL),DOTLINE,COLORLIBLUE;DRAWTEXT_FIX(1,0.980,20,1,'★股票指标网'),COLOR444444;
X_28:=STRCAT(STRCAT(STRCAT(53,54),55),CON2STR(IF(X_25,X_25,DRAWNULL),2));
TDXSTEP1222:STICKLINE(X_1>前高,X_1,前高,1,0),COLORYELLOW;
TDXSTEP1223:STICKLINE(X_27,X_1,0,1,0),COLORGREEN;
TDXSTEP1224:STICKLINE(X_1<0 AND X_1<前低 AND 前低<0,X_1,前低,1,0),COLORBLUE;
X_29:=IF(CROSS(X_1<0,0.5),BARSNEXT(X_8),DRAWNULL);
X_30:=BARSLAST(X_1>0)-1;
TDXSTEP1225:STICKLINE(BARSLAST(X_12)>=0 AND X_1<前低 AND X_1<0,X_1,前低,1,0),COLORGREEN;
TDXSTEP1226:STICKLINE(X_12,X_1,0,1,0),COLORWHITE;
TDXSTEP1227:STICKLINE(X_1>前高 AND 本高>前高 AND BARSLAST(X_27)>0,X_1,前高,1,0),COLORRED;
TDXSTEP1228:DRAWTEXT(X_3 AND X_3!=X_14,X_1/10*9,56);
TDXSTEP1229:DRAWTEXT(X_3 AND X_3!=X_14,X_1/10,57);
TDXSTEP1230:DRAWTEXT(X_15,X_1/10*7,58),COLORBLUE;
TDXSTEP1231:DRAWTEXT(X_15,X_1/10,57),COLORBLUE;
TDXSTEP1232:DRAWTEXT(X_8,X_1/10*9,59),COLORRED;
TDXSTEP1233:DRAWTEXT(X_8,X_1/10,58),COLORRED;
TDXSTEP1234:IF(BARSLAST(X_12)>=0,本低/2,DRAWNULL),DOTLINE,COLORRED;
X_31:=EMA(CLOSE,14)-EMA(CLOSE,28);
X_32:=EMA(X_31,9);
X_33:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
X_34:=SMA(X_33,3,1);
X_35:=SMA(X_34,3,1);
X_36:=X_31;
X_37:=X_32;
X_38:=X_34;
X_39:=X_35;
X_40:=REF(LOW,1);
X_41:=REF(HIGH,1);
X_42:=SMA(ABS(HIGH-X_41),14,1)/SMA(MAX(HIGH-X_41,0),14,1)*100;
X_43:=SMA(ABS(LOW-X_40),14,1)/SMA(MAX(LOW-X_40,0),14,1)*100;
X_44:=REF(CLOSE,1);
X_45:=MA(X_43,13);
X_46:=LLV(LOW,34);
X_47:=SMA(MAX(CLOSE-X_44,0),6,1)/SMA(ABS(CLOSE-X_44),6,1)*100;
X_48:=CROSS(93,X_47);
X_49:=EMA(IF(LOW<=X_46,X_45,0),3);
X_50:=HIGH>LLV(LOW,0)*7;
X_51:=SMA(SMA((CLOSE-LLV(LOW,54))/(HHV(HIGH,54)-LLV(LOW,54))*100,7,1),5,1);
X_52:=SMA((CLOSE-LLV(LOW,54))/(HHV(HIGH,54)-LLV(LOW,54))*100,7,1)*16.18-X_51*10.9;
X_53:=FILTER(IF(X_52<=X_51 AND X_49>REF(X_49,1),X_49*8,0),20);
洗盘结束:IF(X_52<=X_51 AND X_49>REF(X_49,1),100000,0),COLORMAGENTA,LINETHICK2;
T0:FILTER(IF(CROSS(X_39,X_38) AND SUM(X_36>REF(X_36,1),3)>3,CROSS(X_39,X_38) AND CROSS(X_37,X_36),0),13),STICK,COLOR5E8262,LINETHICK3;
T1:FILTER(CROSS(X_36,X_37) AND VOL>REF(SUM(VOL,5),1),3),STICK,COLORYELLOW,LINETHICK3;
T2:FILTER(X_48 AND CLOSE/(REF(CLOSE,1)-1)*100!=5 AND X_50 AND VOL>REF(SUM(VOL,3),1),5),STICK,COLORCYAN,LINETHICK3;
T3:FILTER(X_50 AND CROSS(X_39,X_38) AND CLOSE/(REF(CLOSE,1)-1)*100!=5,24),STICK,COLORGREEN,LINETHICK3;
TDXSTEP1235:DRAWTEXT(T0,T0,23),COLOR5E8262;
TDXSTEP1237:DRAWTEXT(T1,T1*0.9,25),COLORYELLOW;
TDXSTEP1238:DRAWTEXT(T2,T2*0.9,26),COLORMAGENTA;
TDXSTEP1239:DRAWTEXT(T3,T3*0.9,27),COLORGREEN;
未来函数检测结果如下:
该公式包含未来函数:BACKSET
该公式包含未来函数:BARSNEXT
该公式包含未来函数:REFX
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
X_1赋值:OBV-OBV的30日简单移动平均
当满足条件X_1>0时,在X_1和0之间画柱状线
当满足条件X_1<0时,在X_1和0之间画柱状线
X_2赋值:HHVBARS(X_1,上次X_1<0距今天数+1)
X_3赋值:CROSS(BACKSET(CROSS(0,X_1),1日前的X_2+2),0.5)
X_4赋值:CROSS(BACKSET(CROSS(0,X_1) OR (ISLASTBAR AND X_1>0),1日前的X_2+2),0.5)
输出前高:DRAWLINE(X_3,X_1,1日前的X_3,1日前的X_1,1),画洋红色
X_5赋值:LLVBARS(X_1,上次X_1>0距今天数+1)
X_6赋值:CROSS(BACKSET(CROSS(X_1,0),1日前的X_5+2),0.5)
X_7赋值:上次FILTERX(0上穿X_1,收盘价的有效数据周期数距今天数)
输出前低:DRAWLINE(X_6,X_1,1日前的X_6,1日前的X_1,1)
X_8赋值:IF(X_1<0,FILTERX(X_1=LLV(X_1,上次X_1>0距今天数),收盘价的有效数据周期数),DRAWNULL)
X_9赋值:上次X_8距今天数
X_10:=FILTERX(X_1
X_11:=上次X_10距今天数
输出本低:IF(X_7+1>=1,CONST(X_7+1日内X_1最低值),DRAWNULL)
X_12:=CROSS(COUNT(CROSS(X_1>本低/2 AND X_1<0,0.5),X_9)=1,0.5) AND X_9>=0
X_13:=IF(ISLASTBAR AND X_1>0 AND X_1=HHV(X_1,上次X_1<0距今天数),1,IF(FILTERX(X_4,收盘价的有效数据周期数),2,DRAWNULL))
X_14:=X_13=1 OR X_13=2 AND X_1>0
X_15:=FILTERX(X_14,收盘价的有效数据周期数)
输出本高:DRAWLINE(X_15,X_1,1日前的X_15,1日前的X_1,1),画白色
X_16:=CONST(REF(X_1,上次X_15距今天数))
X_17:=X_1>X_16
X_18:=FILTERX(REFX(上次X_17距今天数,1)=1,收盘价的有效数据周期数)
X_19:=上次X_18距今天数
X_20:=DRAWLINE(X_18,X_16,X_15,X_16,0)
X_21:=DRAWLINE(X_10,CONST(X_7+1日内X_1最低值),X_8=1,X_1,0)
输出TDXSTEP1219:DRAWNUMBER(X_8,CONST(X_7+1日内X_1最低值)*0.9,X_11)
输出TDXSTEP1220:DRAWNUMBER(X_15,X_20*1.1,X_19)
X_22:=IF(X_18,BARSNEXT(X_15),DRAWNULL)
X_23:=IF(X_19>0 AND X_19<=X_19日前的X_22,X_19的X_1>0日累和,DRAWNULL)
X_24:=X_19日前的收盘价
X_25:=(X_24-收盘价)/收盘价*100
X_26:=上次X_15距今天数
X_27:=CROSS(COUNT(CROSS(X_1<本高/2 AND X_1>0,0.5),X_15)=1,0.5) AND X_15>=0
输出TDXSTEP1221:STICKLINE(X_1>前高 AND 本高>前高 AND 上次X_1<本高/2上穿0.5距今天数>0 AND X_1>(前高+本高)/2,X_1,前高,1,0),画黄色
前高本高二分位:IF(X_1>0 AND 本高!=前高,DRAWLINE(X_27,(前高+本高)/2,1日前的X_27,REF((前高+本高)/2,1),1),DRAWNULL),DOTLINE,COLORLIBLUE
当满足条件1时,在横轴0.980纵轴20位置书写文字
如果X_25返回X_25否则返回DRAWNULL
当满足条件X_1>前高时,在X_1和前高之间画柱状线
当满足条件X_27时,在X_1和0之间画柱状线
当满足条件X_1<0 AND X_1<前低 AND 前低<0时,在X_1和前低之间画柱状线
X_29:=IF(X_1<0上穿0.5,BARSNEXT(X_8),DRAWNULL)
X_30:=上次X_1>0距今天数-1
输出TDXSTEP1225:STICKLINE(上次X_12距今天数>=0 AND X_1<前低 AND X_1<0,X_1,前低,1,0),画绿色
当满足条件X_12时,在X_1和0之间画柱状线
输出TDXSTEP1227:STICKLINE(X_1>前高 AND 本高>前高 AND 上次X_27距今天数>0,X_1,前高,1,0),画红色
当满足条件X_3 AND X_3!=X_14时,在X_1/10*9和56位置书写文字
当满足条件X_3 AND X_3!=X_14时,在X_1/10和57位置书写文字
当满足条件X_15时,在X_1/10*7和58位置书写文字
当满足条件X_15时,在X_1/10和57位置书写文字
当满足条件X_8时,在X_1/10*9和59位置书写文字
当满足条件X_8时,在X_1/10和58位置书写文字
输出TDXSTEP1234:IF(上次X_12距今天数>=0,本低/2,DRAWNULL),DOTLINE,画红色
X_31:=收盘价的14日指数移动平均-收盘价的28日指数移动平均
X_32:=X_31的9日指数移动平均
X_33:=(收盘价-9日内最低价最低值)/(9日内最高价最高值-9日内最低价最低值)*100
X_33的3日[1日权重]移动平均
X_34的3日[1日权重]移动平均
X_36:=X_31
X_37:=X_32
X_38:=X_34
X_39:=X_35
X_40:=1日前的最低价
X_41:=1日前的最高价
X_42:=SMA(最高价-X_41的绝对值,14,1)/SMA(最高价-X_41和0较大值,14,1)*100
X_43:=SMA(最低价-X_40的绝对值,14,1)/SMA(最低价-X_40和0较大值,14,1)*100
X_44:=1日前的收盘价
X_45:=X_43的13日简单移动平均
X_46:=34日内最低价最低值
X_47:=SMA(收盘价-X_44和0较大值,6,1)/SMA(收盘价-X_44的绝对值,6,1)*100
X_48:=93上穿X_47
如果最低价<=X_46返回X_45否则返回0
X_50:=最高价>0日内最低价最低值*7
X_51:=SMA(SMA((收盘价-54日内最低价最低值)/(54日内最高价最高值-54日内最低价最低值)*100,7,1),5,1)
X_52:=SMA((收盘价-54日内最低价最低值)/(54日内最高价最高值-54日内最低价最低值)*100,7,1)*16.18-X_51*10.9
X_53:=FILTER(IF(X_52<=X_51 AND X_49>1日前的X_49,X_49*8,0),20)
输出洗盘结束:IF(X_52<=X_51 AND X_49>1日前的X_49,100000,0),画洋红色, 线宽为2
输出T0:FILTER(IF(X_39上穿X_38 AND 3的X_36>1日前的X_36日累和>3,X_39上穿X_38 AND X_37上穿X_36,0),13),STICK,COLOR5E8262, 线宽为3
输出T1:FILTER(X_36上穿X_37 AND 成交量>REF(5的成交量日累和,1),3),STICK,画黄色, 线宽为3
输出T2:FILTER(X_48 AND 收盘价/(1日前的收盘价-1)*100!=5 AND X_50 AND 成交量>REF(3的成交量日累和,1),5),STICK,画青色, 线宽为3
输出T3:FILTER(X_50 AND X_39上穿X_38 AND 收盘价/(1日前的收盘价-1)*100!=5,24),STICK,画绿色, 线宽为3
当满足条件T0时,在T0和23位置书写文字
当满足条件T1时,在T1*0.9和25位置书写文字
当满足条件T2时,在T2*0.9和26位置书写文字
当满足条件T3时,在T3*0.9和27位置书写文字