攻击资金通达信分时公式和谐源码分享 分时图
X_1:=2400;
X_2:=HHV(VOL,X_1);
X_3:=LLV(VOL,X_1);
X_4:=CONST(X_2);
X_5:=CONST(X_3);
X_6:=X_4;
X_7:=X_5;
X_8:=(X_6+X_7)/2;
X_9:=X_6-X_7;
X_10:=(100-0)/2*1.3;
X_11:=(100-0)/1*1.3;
X_12:=(50-X_10)*X_9/X_11+X_8;
X_13:=X_4-X_5;
X_14:=IF(CLOSE>REF(CLOSE,1),VOL,0);
X_15:=IF(CLOSE<REF(CLOSE,1),VOL,0);
X_16:=CONST(FINDHIGH(X_14,FROMOPEN,240,1));
X_17:=CONST(FINDHIGH(X_15,FROMOPEN,240,1));
X_18:=CONST(REF(HHV(X_14,FROMOPEN),0));
X_19:=CONST(REF(HHV(X_15,FROMOPEN),0));
X_20:=X_18/X_16;
X_21:=SUM(VOL,FROMOPEN)/FROMOPEN;
X_22:=VOL;
X_23:=MA(X_22,5);
X_24:=BARSCOUNT(CLOSE);
X_25:=SUM(CLOSE*VOL,X_24)/SUM(VOL,X_24);
X_26:=MA(VOL,5)>REF(MA(VOL,5),1) AND REF(MA(VOL,5),1)>REF(MA(VOL,5),2);
X_27:=CLOSE>=REF(CLOSE,1) AND REF(CLOSE,1)>REF(CLOSE,2);
X_28:=CLOSE>X_25 AND VOL>MA(VOL,5);
X_29:=VOL>=REF(VOL,1)*1;
X_30:=CLOSE>=HHV(CLOSE,0);
X_31:=VOL>=HHV(VOL,0);
X_32:=(CLOSE/DYNAINFO(3)-1)*100<=2.5;
X_33:=X_26 AND X_27 AND X_28 AND X_29 AND X_30 AND X_31 AND X_32;
X_34:=BARSSINCE(X_33)+1;
X_35:=REF(CLOSE,X_34-1);
X_36:=(DYNAINFO(7)-X_35)/X_35*100;
X_37:=CAPITAL*100/100000000;
X_38:=REF(TIME/10000,X_34);
X_39:=X_34-1;
STICKLINE(CLOSE>REF(CLOSE,1) AND VOL>=X_19,0,VOL,0,0),COLORRED;
STICKLINE(CLOSE<REF(CLOSE,1) AND VOL>=X_18,0,VOL,0,0),COLORGREEN;
DRAWICON(CLOSE<REF(CLOSE,1) AND VOL>=X_18,VOL,2);
STICKLINE(CLOSE>REF(CLOSE,1) AND (VOL>X_16 OR VOL>X_17),0,VOL,0,0),COLORRED;
STICKLINE(CLOSE>REF(CLOSE,1) AND VOL>=2*X_16 AND VOL<5*X_16,X_16,VOL,0,0),COLORMAGENTA;
STICKLINE(CLOSE>REF(CLOSE,1) AND VOL>=5*X_16,0,VOL,0,0),COLORMAGENTA;
STICKLINE(X_33,X_5+X_13*0.8,0,1,0),COLORMAGENTA;
DRAWICON(X_33,VOL,1),COLORRED;
DRAWTEXT(X_33,X_5+X_13*0.8,1),COLORMAGENTA;
X_40:=BARSLAST(TIME=100000);
X_41:=REF(HHV(CLOSE,0),X_40+1);
X_42:=REF(HHV(VOL,0),X_40+1);
X_43:=X_41/DYNAINFO(3)<1.05;
X_44:=CROSS(CLOSE,X_41) AND VOL>X_42 AND X_43;
X_45:=BARSLAST(TIME=110000);
X_46:=REF(HHV(CLOSE,0),X_45+1);
X_47:=REF(HHV(VOL,0),X_45+1);
X_48:=X_46/DYNAINFO(3)<1.05;
X_49:=CROSS(CLOSE,X_46) AND VOL>X_47 AND X_48;
X_50:=X_44 OR X_49;
X_51:=BARSSINCE(X_50)+1;
X_52:=REF(CLOSE,X_51-1);
X_53:=(DYNAINFO(7)-X_52)/X_52*100;
STICKLINE(X_50,VOL,0,1,0),COLORRED;
DRAWICON(X_50=1,VOL,17);
DRAWTEXT(X_50=1,X_5+X_13*0.65,2),COLORRED;
DRAWICON(FILTER(CROSS(X_14,X_16),30),VOL,1);
DRAWTEXT(FILTER(CROSS(X_14,X_16),30),X_5+X_13*0.5,3),COLORYELLOW;
DRAWICON(FILTER(CROSS(X_14,X_19),30),VOL,1);
DRAWTEXT(FILTER(CROSS(X_14,X_19),30),X_5+X_13*0.35,3),COLORMAGENTA;
攻击资金:SUM(IF(CLOSE>REF(CLOSE,1) AND VOL>4000,VOL/5,0),0),COLORRED,LINETHICK3;
出逃资金:SUM(IF(CLOSE<REF(CLOSE,1) AND VOL>4000,VOL/5,0),0),COLORGREEN,LINETHICK3;
X_54:=SUM(IF(CLOSE>REF(CLOSE,1),VOL/5,0),0);
X_55:=SUM(IF(CLOSE<REF(CLOSE,1),VOL/5,0),0);
X_56:=X_54-攻击资金;
X_57:=X_55-出逃资金;
X_58:=CONST(VOL);
X_59:=SUM(IF(CLOSE>REF(CLOSE,1) AND VOL>4000,VOL/1000,0),0);
X_60:=SUM(IF(CLOSE<REF(CLOSE,1) AND VOL>4000,VOL/1000,0),0);
X_61:=SUM(IF(CLOSE>REF(CLOSE,1),VOL/1000,0),0);
X_62:=SUM(IF(CLOSE<REF(CLOSE,1),VOL/1000,0),0);
X_63:=X_61-X_59;
X_64:=X_62-X_60;
X_65:=X_59;
X_66:=X_60;
X_67:=X_63;
X_68:=X_64;
X_69:=X_59-X_60;
X_70:=X_63-X_64;
X_71:=X_61-X_62;
X_72:=SUM(VOL*CLOSE,0)/SUM(VOL,0);
DRAWTEXT_FIX(1,0,0,0,STRCAT(STRCAT(4,CON2STR(X_69,0)),5)),COLORMAGENTA;
DRAWTEXT_FIX(1,0,0.2,0,STRCAT(STRCAT(6,CON2STR(X_70,0)),5)),COLORCYAN;
DRAWTEXT_FIX(1,0.185,0,0,STRCAT(STRCAT(7,CON2STR(X_71,0)),5)),COLORYELLOW;
X_73:=EMA(X_72,50)/0.97;
X_74:=COUNT(VOL>4000 AND CLOSE>REF(CLOSE,1),0);
X_75:=COUNT(VOL>DYNAINFO(16)*10 AND CLOSE>REF(CLOSE,1),0);
DRAWICON(X_74>REF(X_74,1) AND X_75>REF(X_75,1) AND CROSS(CLOSE,X_73),攻击资金,7);
DRAWICON(X_63>X_64 AND X_59>X_63 AND X_64>X_60,攻击资金,41);
X_76:=IF(DATE>=1130107,1,0);
X_77:=BETWEEN(DCLOSE*X_76/(SUM(AMOUNT,BARSCOUNT(DCLOSE*X_76))/SUM(VOL*100,BARSCOUNT(DCLOSE*X_76))),1.05,0.95);
X_78:=IF(X_77=0,MA(DCLOSE*X_76,BARSCOUNT(DCLOSE*X_76)),SUM(AMOUNT,BARSCOUNT(DCLOSE*X_76))/SUM(VOL*100,BARSCOUNT(DCLOSE*X_76)));
DRAWTEXT(CROSS(EXPMA(DCLOSE/X_78,120),1.0029),X_56,8),COLORWHITE;
DRAWICON(CROSS(EXPMA(DCLOSE/X_78,120),1.0029),X_56,25);
DRAWTEXT(CROSS(EXPMA(DCLOSE/X_78,120),1.004),X_57,9),COLORMAGENTA;
DRAWICON(CROSS(EXPMA(DCLOSE/X_78,120),1.004),X_57,13);
DRAWICON(CROSS(EXPMA(DCLOSE/X_78,20),1.02),X_56,1);
X_79:=(EXPMA(CLOSE,500)-REF(EXPMA(CLOSE,500),1))/REF(EXPMA(CLOSE,500),1)*100;
X_80:=EXPMA((EXPMA(CLOSE,500)-REF(EXPMA(CLOSE,500),1))/REF(EXPMA(CLOSE,500),1)*100,120)-0.0004;
X_81:=EXPMA((EXPMA(CLOSE,500)-REF(EXPMA(CLOSE,500),1))/REF(EXPMA(CLOSE,500),1)*100,200);
DRAWICON(CROSS(EXPMA(X_79,120)-0.0004,EXPMA(X_79,200)),X_56,13);
DRAWTEXT(CROSS(EXPMA(X_79,120)-0.0004,EXPMA(X_79,200)),X_56,10),COLORRED;
DRAWICON(CROSS(EXPMA(X_79,120)-0.0004,EXPMA(X_79,200)),X_56,13);
X_82:=BETWEEN(CLOSE/(SUM(AMOUNT,BARSCOUNT(CLOSE))/SUM(VOL*100,BARSCOUNT(CLOSE))),1.05,0.95);
X_83:=IF(X_82=0,MA(CLOSE,BARSCOUNT(CLOSE)),SUM(AMOUNT,BARSCOUNT(CLOSE))/SUM(VOL*100,BARSCOUNT(CLOSE)));
STICKLINE(CROSS(CLOSE/X_83,1.03),1.01,1.02,1,0),COLORYELLOW;
DRAWICON(CROSS(CLOSE/X_83,1.03),X_56,1);
STICKLINE(X_33,0,0.006,1,0),COLORMAGENTA;
DRAWTEXT(X_33,0.008,1),COLORMAGENTA;
X_84:=COUNT(VOL>0,0);
X_85:=X_84=1 AND DYNAINFO(3)<DYNAINFO(4);
X_86:=X_84=1 AND DYNAINFO(3)>DYNAINFO(4);
X_87:=BARSLAST(CLOSE>REF(CLOSE,1) OR X_84=1)+X_86;
X_88:=BARSLAST(CLOSE<REF(CLOSE,1) OR X_84=1)+X_85;
X_89:=IF(X_87<X_88,AMOUNT/100000000,0);
X_90:=IF(X_87>X_88,AMOUNT/100000000,0);
X_91:=SUM(X_89,0)-SUM(X_90,0);
X_92:=MIN(TOTALBARSCOUNT,5);
X_93:=SUM(X_89,X_92)-SUM(X_90,X_92);
X_94:=BARSLASTCOUNT(X_91>0 AND X_91>REF(X_91,1));
X_95:=BARSLASTCOUNT(X_91>0 AND X_93>REF(X_93,1));
DRAWTEXT_FIX(1,0.18,0.2,0,STRCAT(STRCAT(11,CON2STR(X_94,2)),12)),COLORYELLOW;
DRAWTEXT_FIX(1,0.56,0.2,0,STRCAT(STRCAT(13,CON2STR(X_95,2)),14)),COLORYELLOW;
(-10000),POINTDOT,COLORBLUE;
未来函数检测结果如下:
该公式包含未来函数:CAPITAL
该公式包含未来函数:DYNAINFO
该公式包含未来函数:DHIGH
该公式包含未来函数:DCLOSE
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
X_1赋值:2400
X_2赋值:X_1日内成交量最高值
X_3赋值:X_1日内成交量最低值
X_4赋值:CONST(X_2)
X_5赋值:CONST(X_3)
X_6赋值:X_4
X_7赋值:X_5
X_8赋值:(X_6+X_7)/2
X_9赋值:X_6-X_7
X_10:=(100-0)/2*1.3
X_11:=(100-0)/1*1.3
X_12:=(50-X_10)*X_9/X_11+X_8
X_13:=X_4-X_5
X_14:=IF(收盘价>1日前的收盘价,成交量,0)
X_15:=IF(收盘价<1日前的收盘价,成交量,0)
X_16:=CONST(FIND最高价(X_14,FROM开盘价,240,1))
X_17:=CONST(FIND最高价(X_15,FROM开盘价,240,1))
X_18:=CONST(REF(FROM开盘价日内X_14最高值,0))
X_19:=CONST(REF(FROM开盘价日内X_15最高值,0))
X_20:=X_18/X_16
X_21:=FROM开盘价的成交量日累和/FROM开盘价
X_22:=成交量
X_23:=X_22的5日简单移动平均
X_24:=收盘价的有效数据周期数
X_25:=X_24的收盘价*成交量日累和/X_24的成交量日累和
X_26:=成交量的5日简单移动平均>REF(成交量的5日简单移动平均,1) AND REF(成交量的5日简单移动平均,1)>REF(成交量的5日简单移动平均,2)
X_27:=收盘价>=1日前的收盘价 AND 1日前的收盘价>2日前的收盘价
X_28:=收盘价>X_25 AND 成交量>成交量的5日简单移动平均
X_29:=成交量>=1日前的成交量*1
X_30:=收盘价>=0日内收盘价最高值
X_31:=成交量>=0日内成交量最高值
X_32:=(收盘价/DYNAINFO(3)-1)*100<=2.5
X_33:=X_26 AND X_27 AND X_28 AND X_29 AND X_30 AND X_31 AND X_32
X_34:=BARSSINCE(X_33)+1
X_35:=X_34-1日前的收盘价
X_36:=(现价-X_35)/X_35*100
X_37:=当前流通股本*100/100000000
X_38:=X_34日前的TIME/10000
X_39:=X_34-1
STICKLINE(收盘价>1日前的收盘价 AND 成交量>=X_19,0,成交量,0,0),画红色
STICKLINE(收盘价<1日前的收盘价 AND 成交量>=X_18,0,成交量,0,0),画绿色
DRAWICON(收盘价<1日前的收盘价 AND 成交量>=X_18,成交量,2)
STICKLINE(收盘价>1日前的收盘价 AND (成交量>X_16 OR 成交量>X_17),0,成交量,0,0),画红色
STICKLINE(收盘价>1日前的收盘价 AND 成交量>=2*X_16 AND 成交量<5*X_16,X_16,成交量,0,0),画洋红色
STICKLINE(收盘价>1日前的收盘价 AND 成交量>=5*X_16,0,成交量,0,0),画洋红色
当满足条件X_33时,在X_5+X_13*0.8和0之间画柱状线
当满足条件X_33时,在成交量和1之间画图标
当满足条件X_33时,在X_5+X_13*0.8和1位置书写文字
X_40:=上次TIME=100000距今天数
X_41:=REF(0日内收盘价最高值,X_40+1)
X_42:=REF(0日内成交量最高值,X_40+1)
X_43:=X_41/DYNAINFO(3)<1.05
X_44:=收盘价上穿X_41 AND 成交量>X_42 AND X_43
X_45:=上次TIME=110000距今天数
X_46:=REF(0日内收盘价最高值,X_45+1)
X_47:=REF(0日内成交量最高值,X_45+1)
X_48:=X_46/DYNAINFO(3)<1.05
X_49:=收盘价上穿X_46 AND 成交量>X_47 AND X_48
X_50:=X_44 OR X_49
X_51:=BARSSINCE(X_50)+1
X_52:=X_51-1日前的收盘价
X_53:=(现价-X_52)/X_52*100
当满足条件X_50时,在成交量和0之间画柱状线
当满足条件X_50=1时,在成交量和17之间画图标
当满足条件X_50=1时,在X_5+X_13*0.65和2位置书写文字
DRAWICON(FILTER(X_14上穿X_16,30),成交量,1)
DRAWTEXT(FILTER(X_14上穿X_16,30),X_5+X_13*0.5,3),画黄色
DRAWICON(FILTER(X_14上穿X_19,30),成交量,1)
DRAWTEXT(FILTER(X_14上穿X_19,30),X_5+X_13*0.35,3),画洋红色
输出攻击资金:SUM(IF(收盘价>1日前的收盘价 AND 成交量>4000,成交量/5,0),0),画红色, 线宽为3
输出出逃资金:SUM(IF(收盘价<1日前的收盘价 AND 成交量>4000,成交量/5,0),0),画绿色, 线宽为3
X_54:=SUM(IF(收盘价>1日前的收盘价,成交量/5,0),0)
X_55:=SUM(IF(收盘价<1日前的收盘价,成交量/5,0),0)
X_56:=X_54-攻击资金
X_57:=X_55-出逃资金
X_58:=CONST(成交量)
X_59:=SUM(IF(收盘价>1日前的收盘价 AND 成交量>4000,成交量/1000,0),0)
X_60:=SUM(IF(收盘价<1日前的收盘价 AND 成交量>4000,成交量/1000,0),0)
X_61:=SUM(IF(收盘价>1日前的收盘价,成交量/1000,0),0)
X_62:=SUM(IF(收盘价<1日前的收盘价,成交量/1000,0),0)
X_63:=X_61-X_59
X_64:=X_62-X_60
X_65:=X_59
X_66:=X_60
X_67:=X_63
X_68:=X_64
X_69:=X_59-X_60
X_70:=X_63-X_64
X_71:=X_61-X_62
X_72:=0的成交量*收盘价日累和/0的成交量日累和
DRAWTEXT_FIX(1,0,0,0,STRCAT(STRCAT(4,CON2STR(X_69,0)),5)),画洋红色
DRAWTEXT_FIX(1,0,0.2,0,STRCAT(STRCAT(6,CON2STR(X_70,0)),5)),画青色
DRAWTEXT_FIX(1,0.185,0,0,STRCAT(STRCAT(7,CON2STR(X_71,0)),5)),画黄色
X_73:=X_72的50日指数移动平均/0.97
X_74:=COUNT(成交量>4000 AND 收盘价>1日前的收盘价,0)
X_75:=COUNT(成交量>DYNAINFO(16)*10 AND 收盘价>1日前的收盘价,0)
DRAWICON(X_74>1日前的X_74 AND X_75>1日前的X_75 AND 收盘价上穿X_73,攻击资金,7)
当满足条件X_63>X_64 AND X_59>X_63 AND X_64>X_60时,在攻击资金和41之间画图标
如果DATE>=1130107返回1否则返回0
X_77:=BETWEEN(D收盘价*X_76/(SUM(成交额,D收盘价*X_76的有效数据周期数)/SUM(成交量*100,D收盘价*X_76的有效数据周期数)),1.05,0.95)
X_78:=IF(X_77=0,MA(D收盘价*X_76,D收盘价*X_76的有效数据周期数),SUM(成交额,D收盘价*X_76的有效数据周期数)/SUM(成交量*100,D收盘价*X_76的有效数据周期数))
DRAWTEXT(D收盘价/X_78的120日指数移动平均上穿1.0029,X_56,8),画白色
DRAWICON(D收盘价/X_78的120日指数移动平均上穿1.0029,X_56,25)
DRAWTEXT(D收盘价/X_78的120日指数移动平均上穿1.004,X_57,9),画洋红色
DRAWICON(D收盘价/X_78的120日指数移动平均上穿1.004,X_57,13)
DRAWICON(D收盘价/X_78的20日指数移动平均上穿1.02,X_56,1)
X_79:=(收盘价的500日指数移动平均-1日前的收盘价的500日指数移动平均)/1日前的收盘价的500日指数移动平均*100
X_80:=EXPMA((EXPMA(收盘价,500)-REF(EXPMA(收盘价,500),1))/REF(EXPMA(收盘价,500),1)*100,120)-0.0004
X_81:=EXPMA((EXPMA(收盘价,500)-REF(EXPMA(收盘价,500),1))/REF(EXPMA(收盘价,500),1)*100,200)
DRAWICON(X_79的120日指数移动平均-0.0004上穿X_79的200日指数移动平均,X_56,13)
DRAWTEXT(X_79的120日指数移动平均-0.0004上穿X_79的200日指数移动平均,X_56,10),画红色
DRAWICON(X_79的120日指数移动平均-0.0004上穿X_79的200日指数移动平均,X_56,13)
X_82:=BETWEEN(收盘价/(SUM(成交额,收盘价的有效数据周期数)/SUM(成交量*100,收盘价的有效数据周期数)),1.05,0.95)
X_83:=IF(X_82=0,MA(收盘价,收盘价的有效数据周期数),SUM(成交额,收盘价的有效数据周期数)/SUM(成交量*100,收盘价的有效数据周期数))
STICKLINE(收盘价/X_83上穿1.03,1.01,1.02,1,0),画黄色
DRAWICON(收盘价/X_83上穿1.03,X_56,1)
当满足条件X_33时,在0和0.006之间画柱状线
当满足条件X_33时,在0.008和1位置书写文字
X_84:=统计0日满足成交量>0的天数
X_85:=X_84=1 AND DYNAINFO(3)<开盘价
X_86:=X_84=1 AND DYNAINFO(3)>开盘价
X_87:=上次收盘价>1日前的收盘价 OR X_84=1距今天数+X_86
X_88:=上次收盘价<1日前的收盘价 OR X_84=1距今天数+X_85
如果X_87如果X_87>X_88返回成交额/100000000否则返回0
X_91:=0的X_89日累和-0的X_90日累和
X_92:=TOTALBARSCOUNT和5的较小值
X_93:=X_92的X_89日累和-X_92的X_90日累和
X_94:=BARSLASTCOUNT(X_91>0 AND X_91>1日前的X_91)
X_95:=BARSLASTCOUNT(X_91>0 AND X_93>1日前的X_93)
DRAWTEXT_FIX(1,0.18,0.2,0,STRCAT(STRCAT(11,CON2STR(X_94,2)),12)),画黄色
DRAWTEXT_FIX(1,0.56,0.2,0,STRCAT(STRCAT(13,CON2STR(X_95,2)),14)),画黄色
(-10000),POINTDOT, 画蓝色