通达信攻击起爆分时副图指标 源码分享 附图
{起爆时间}
委买:DYNAINFO(58)*C/100,LINETHICK0;
委卖:DYNAINFO(59)*C/100,LINETHICK0;
委差:DYNAINFO(58)-DYNAINFO(59)*C/100,LINETHICK0;
多空比:=DYNAINFO(58)/DYNAINFO(59)*C/100,LINETHICK0;
昨收:=DYNAINFO(3);
HH:=DYNAINFO(5);
LL:=DYNAINFO(6);
FK:=MAX(HH-昨收,昨收-LL)*0.1;
ZS:=昨收-FK*3.2;
Q1:=昨收-FK*3.22;
Q2:=昨收-1*FK*3.22;
Q3:=昨收-5*FK*3.2;
TJ:=FILTER(C,239)>0,NODRAW;
TJJ:=SUM(TJ,0),NODRAW;
TJA:=CONST(TJJ),NODRAW;
流通盘:=CAPITAL*100/100000000,NODRAW;
资金流入:=SUM(IF(C>REF(C,1),V,0),FROMOPEN),LINETHICK3,COLORRED;
资金流出:=-SUM(IF(C<REF(C,1),V,0),FROMOPEN),LINETHICK3,COLORWHITE;
资金出入:=资金流入+资金流出,LINETHICK3,COLORGREEN;
HD:=HHV(资金出入,2400);
LD:=LLV(资金出入,2400);
最高:=CONST(HD),NODRAW;
最低:=CONST(LD),NODRAW;
HLMAX:=最高;
HLMIN:=最低;
HLMN1:=(HLMAX+HLMIN)/2;
HLMN2:=HLMAX-HLMIN;
HLMN3:=(100-0)/2*1.3;
HLMN4:=(100-0)/1*1.3;
中间价轴:=(50-HLMN3)*HLMN2/HLMN4+HLMN1;
轴差:=最高-最低;
DRAWBAND(资金出入,RGB(150,0,150),0,RGB(0,100,0));
资金流量:=资金出入,COLORFFFFFF,LINETHICK1;
资金比:=资金出入/SUM(V,FROMOPEN)*100,COLOR00FFFF,LINETHICK1;
资金流量比:=IF(资金比>=0,(资金比+100)/2,100-ABS((资金比-100)/2));
攻击量:=((HSL*0.50+REF(HSL,1)*0.33)+(REF(HSL,2)*0.17))*SUM(C,FROMOPEN)/FROMOPEN;
攻击量A:=SUM(IF(C>REF(C,1),攻击量*V,0),FROMOPEN),COLOR0000FF,LINETHICK0;
攻击量B:=-SUM(IF(C<REF(C,1),攻击量*V,0),FROMOPEN),COLOR00FF00,LINETHICK0;
攻击流量:攻击量A+攻击量B,COLORSTICK;
NOTEXT攻击线:攻击流量,COLORYELLOW,LINETHICK1;
攻击比:攻击流量/SUM(V,FROMOPEN)*100,COLORRED,LINETHICK1;
资金攻击度:IF(攻击比>=0,(攻击比+50),100-ABS((攻击比-50))),COLORMAGENTA;
{STICKLINE(资金流量A>0,资金流量A,0,1,0),COLOR0000FF;
STICKLINE(资金流量B<0,资金流量B,0,1,0),COLORFF0000;}
DRAWRECTREL(110,10,400,90,RGB(0,75,200));
DRAWRECTREL(110,10,250,90,RGB(0,250,50));
DRAWRECTREL(110,10,100+CONST(资金流量比*300/100),90,RGB(200,50,0));
DRAWTEXT_FIX(1,0.000,0.00,0,STRCAT(STRCAT('【资金流量比】',CON2STR(资金流量比,2)),'%买')),COLORYELLOW;
DRAWRECTREL(610,10,900,90,RGB(0,75,200));
DRAWRECTREL(610,10,750,90,RGB(0,250,50));
DRAWRECTREL(610,10,600+CONST(资金攻击度*300/100),90,RGB(175,50,0));
DRAWTEXT_FIX(1,0.500,0.00,0,STRCAT(STRCAT('【资金攻击度】',CON2STR(资金攻击度,2)),' %买')),COLORYELLOW;
量:=VOL,VOLSTICK;
五日量:=MA(量,5),COLORWHITE;
TT:=BARSCOUNT(C);{取得有效收盘价}
均价黄:=SUM(C*V,TT)/SUM(V,TT);{分时均线的取值}
量两步:=MA(V,5)>REF(MA(V,5),1) AND REF(MA(V,5),1)>REF(MA(V,5),2);
价两步:= C>=REF(C,1) AND REF(C,1)>REF(C,2);
价上岗量破5:=C>均价黄 AND V>MA(V,5);
量起爆:=V>=REF(V,1)*1;
价创新高:=C>=HHV(C,0);
量创新高:=V>=HHV(V,0);
对昨日涨幅:=(C/DYNAINFO(3)-1)*100<=1.50;{涨幅控制2个点以内}
每日一点:=量两步 AND 价两步 AND 价上岗量破5 AND 量起爆 AND 价创新高 AND 量创新高 AND 对昨日涨幅;
{计算收益、已爆分钟}
VV:=BARSSINCE(每日一点)+1;
首次起爆价:=REF(C,VV-1),NODRAW;
起爆收益:(DYNAINFO(7)-首次起爆价)/首次起爆价*100,NODRAW;
起爆时间:=REF(TIME/10000,VV),NODRAW;
已爆分钟:=VV-1,NODRAW;
{画出底线和红球}
首次起爆量:=REF(VOL,VV-1);
MMA30:=EMA(CLOSE,30);
强弱界定:=IF(PERIOD=0 ,EMA(CLOSE,900),DRAWNULL);
分时均价线:=SUM(C*V,240)/SUM(V,240),COLORYELLOW,LINETHICK2;
GHYJKU:=BETWEEN(CLOSE/(SUM(AMOUNT,BARSCOUNT(CLOSE))/SUM(VOL*100,BARSCOUNT(CLOSE))),1.05,0.95);
VBNH:=IF(0,MA(CLOSE,BARSCOUNT(CLOSE)),(SUM(AMOUNT,BARSCOUNT(CLOSE))/SUM(VOL*100,BARSCOUNT(CLOSE))));
二十☆:=EXPMA((CLOSE/VBNH),20),COLORRED,LINETHICK1;
六十:=EXPMA((CLOSE/VBNH),60),COLORLIGREEN,LINETHICK1;
FAA:=BARSLAST(TIME=100000);
FCC:=REF(HHV(C,0),FAA+1);
FVV:=REF(HHV(V,0),FAA+1);
ZF:=FCC/DYNAINFO(3)<1.05;
XG1:=CROSS(C,FCC) AND V>FVV AND ZF,COLORWHITE;
FAA1:=BARSLAST(TIME=110000);
FCC1:=REF(HHV(C,0),FAA1+1);
FVV1:=REF(HHV(V,0),FAA1+1);
ZF1:=FCC1/DYNAINFO(3)<1.05;
XG2:=CROSS(C,FCC1) AND V>FVV1 AND ZF1,COLORYELLOW;
突破:=XG1 OR XG2,COLORRED;
VT:=BARSSINCE(突破)+1;
首次突破价:=REF(C,VT-1),NODRAW;
突破收益:=(DYNAINFO(7)-首次突破价)/首次突破价*100,NODRAW;
拉升量:=IF(C>REF(C,1),VOL,0);
昨拉升最高值:=CONST(FINDHIGH(拉升量,FROMOPEN,240,1)),LINETHICK1,COLORMAGENTA;
今拉升最高值:=CONST(REF(HHV(拉升量,FROMOPEN),0)),COLORYELLOW,NODRAW;
攻击力度:=今拉升最高值/昨拉升最高值,NODRAW;
STICKLINE(FILTER(CROSS(拉升量,昨拉升最高值),30),最低+轴差*0.80,最低,1,0),COLORCYAN;
STICKLINE(每日一点,最低+轴差*0.65,最低,1,0),COLORMAGENTA;
STICKLINE(突破,最低+轴差*0.50,最低,1,0),COLORWHITE;
STICKLINE(FILTER(BARSLAST(C<MIN(MMA30,强弱界定))<=20 AND CROSS(C,MAX(MMA30,强弱界定)),30),最低,最低+轴差*0.2,1,0),COLORGREEN;
DRAWICON(FILTER(CROSS(拉升量,昨拉升最高值),30),最低+轴差*0.80,1);
DRAWICON(每日一点,最低+轴差*0.65,1);
DRAWICON(突破,最低+轴差*0.50,17);
DRAWICON(FILTER(BARSLAST(C<MIN(MMA30,强弱界定))<=20 AND CROSS(C,MAX(MMA30,强弱界定)),30),最低+轴差*0.2,9);
打压量:=IF(C<REF(C,1),VOL,0);
今打压最高值:=CONST(REF(HHV(打压量,FROMOPEN),0)),NODRAW;
DRAWTEXT(FILTER(CROSS(拉升量,今打压最高值),30),最低+轴差*0.80,'攻'),COLORMAGENTA;
DRAWTEXT(FILTER(CROSS(拉升量,今打压最高值),30),最低+轴差*0.60,'击'),COLORMAGENTA;
DRAWTEXT(每日一点,最低+轴差*0.65,'起爆'),COLORGREEN;
DRAWNUMBER(每日一点,最低+轴差*0.55,首次起爆价),COLORGREEN;
DRAWTEXT(突破,最低+轴差*0.50,'分时突破'),COLORWHITE;
DRAWNUMBER(突破,最低+轴差*0.40,首次突破价),COLORWHITE;
DRAWTEXT(FILTER(BARSLAST(C<MIN(MMA30,强弱界定))<=20 AND CROSS(C,MAX(MMA30,强弱界定)),30),最低+轴差*0.2,'关注'),COLORMAGENTA;
大单买:(SUM(IF(C>REF(C,1) AND V>4000,V/1000,0),0))*1500,COLORRED,LINETHICK3;
大单卖:(SUM(IF(C<REF(C,1) AND V>4000,V/1000,0),0))*1500,COLORGREEN,LINETHICK3;
DRAWTEXT(突破,最低+轴差*0.50,'分时突破'),COLORWHITE;
股价趋势:3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100000,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100000,5,1),3,1),COLORYELLOW;
VAR51:=(C/REF(C,1)-1)*100;
冲涨停:IF(CROSS(TIME<=093000,VAR51<=2 AND VAR51>=-2),10000,0),STICK,LINETHICK3;
DRAWTEXT((冲涨停 > 0),10950,'冲'),LINETHICK5,COLORYELLOW;
DRAWTEXT((冲涨停 > 0),10900,'涨'),LINETHICK5,COLORYELLOW;
DRAWTEXT((冲涨停 > 0),10850,'停'),LINETHICK5,COLORYELLOW;
HYJKU:=BETWEEN(CLOSE/(SUM(AMOUNT,BARSCOUNT(CLOSE))/SUM(VOL*100,BARSCOUNT(CLOSE))),1.05,0.95);
AVBNH:=IF(HYJKU=0,MA(CLOSE,BARSCOUNT(CLOSE)),(SUM(AMOUNT,BARSCOUNT(CLOSE))/SUM(VOL*100,BARSCOUNT(CLOSE))));
DRAWICON(CROSS(EXPMA((CLOSE/AVBNH),20),1.02),1.02+0.005,18);
STICKLINE(CROSS(EXPMA((CLOSE/AVBNH),20),1.02),1.02,1.025,4,0), , COLORMAGENTA;
DRAWTEXT(CROSS(EXPMA((CLOSE/AVBNH),20),1.02),1.02,'拉升'),COLORWHITE;
DRAWTEXT(CROSS(EXPMA((CLOSE/AVBNH),20),1.04),1.04,'可能涨停'),COLORWHITE;
STICKLINE(EXPMA((CLOSE/AVBNH),120)>1.003 ,1.03,1.039,1.0,0),COLORMAGENTA;
DRAWTEXT(CROSS(EXPMA((CLOSE/AVBNH),120),1.0029),1.028,'买进'),COLORWHITE;
DRAWICON(CROSS(EXPMA((CLOSE/AVBNH),120),1.0029),1.0326*1,13);
DRAWTEXT(CROSS(EXPMA((CLOSE/AVBNH),120),1.0029),1.036,'观察分时量'),COLORWHITE;
DRAWICON(CROSS(EXPMA((CLOSE/VBNH),60),EXPMA((CLOSE/VBNH),120)),EXPMA((CLOSE/VBNH),60)*1,1);
DRAWICON(CROSS(EXPMA((CLOSE/VBNH),20),1.02),1,18);
未来函数检测结果如下:
该公式包含未来函数:CAPITAL
该公式包含未来函数:DYNAINFO
该公式包含未来函数:DHIGH
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
输出{起爆时间}
委买:DYNAINFO(58)*C/100,LINETHICK0
输出委卖:DYNAINFO(59)*C/100,LINETHICK0
输出委差:DYNAINFO(58)-DYNAINFO(59)*C/100,LINETHICK0
多空比赋值:DYNAINFO(58)/DYNAINFO(59)*C/100,LINETHICK0
昨收赋值:DYNAINFO(3)
HH赋值:DYNAINFO(5)
LL赋值:DYNAINFO(6)
FK赋值:HH-昨收和昨收-LL较大值*0.1
ZS赋值:昨收-FK*3.2
Q1赋值:昨收-FK*3.22
Q2赋值:昨收-1*FK*3.22
Q3赋值:昨收-5*FK*3.2
TJ赋值:C的239过滤>0,NODRAW
TJJ:=0的TJ日累和,NODRAW
TJA:=CONST(TJJ),NODRAW
流通盘赋值:当前流通股本*100/100000000,NODRAW
资金流入赋值:SUM(IF(C>1日前的C,V,0),FROM开盘价), 线宽为3,画红色
资金流出赋值:-SUM(IF(C<1日前的C,V,0),FROM开盘价), 线宽为3,画白色
资金出入赋值:资金流入+资金流出, 线宽为3,画绿色
HD赋值:2400日内资金出入最高值
LD赋值:2400日内资金出入最低值
最高赋值:CONST(HD),NODRAW
最低赋值:CONST(LD),NODRAW
HLMAX赋值:最高
HLMIN赋值:最低
HLMN1赋值:(HLMAX+HLMIN)/2
HLMN2赋值:HLMAX-HLMIN
HLMN3赋值:(100-0)/2*1.3
HLMN4赋值:(100-0)/1*1.3
中间价轴赋值:(50-HLMN3)*HLMN2/HLMN4+HLMN1
轴差赋值:最高-最低
DRAWBAND(资金出入,RGB(150,0,150),0,RGB(0,100,0))
资金流量赋值:资金出入,COLORFFFFFF,LINETHICK1
资金比赋值:资金出入/FROM开盘价的V日累和*100,COLOR00FFFF,LINETHICK1
资金流量比:=IF(资金比>=0,(资金比+100)/2,100-(资金比-100的绝对值/2))
攻击量赋值:((HSL*0.50+1日前的HSL*0.33)+(2日前的HSL*0.17))*FROM开盘价的C日累和/FROM开盘价
攻击量A:=SUM(IF(C>1日前的C,攻击量*V,0),FROM开盘价),COLOR0000FF,LINETHICK0
攻击量B:=-SUM(IF(C<1日前的C,攻击量*V,0),FROM开盘价),COLOR00FF00,LINETHICK0
输出攻击流量:攻击量A+攻击量B,COLORSTICK
输出NOTEXT攻击线:攻击流量,COLORYELLOW,LINETHICK1
输出攻击比:攻击流量/FROM开盘价的V日累和*100,画红色,LINETHICK1
输出资金攻击度:IF(攻击比>=0,(攻击比+50),100-(攻击比-50的绝对值)),画洋红色
当满足条件资金流量A>0时,在资金流量A和0之间画柱状线
当满足条件资金流量B<0时,在资金流量B和0之间画柱状线
}
DRAWRECTREL(110,10,400,90,RGB(0,75,200))
DRAWRECTREL(110,10,250,90,RGB(0,250,50))
DRAWRECTREL(110,10,100+CONST(资金流量比*300/100),90,RGB(200,50,0))
DRAWTEXT_FIX(1,0.000,0.00,0,STRCAT(STRCAT('【资金流量比】',CON2STR(资金流量比,2)),'%买')),COLORYELLOW
DRAWRECTREL(610,10,900,90,RGB(0,75,200))
DRAWRECTREL(610,10,750,90,RGB(0,250,50))
DRAWRECTREL(610,10,600+CONST(资金攻击度*300/100),90,RGB(175,50,0))
DRAWTEXT_FIX(1,0.500,0.00,0,STRCAT(STRCAT('【资金攻击度】',CON2STR(资金攻击度,2)),' %买')),COLORYELLOW
量赋值:成交量,成交量STICK
五日量赋值:量的5日简单移动平均,画白色
TT赋值:C的有效数据周期数
{取得有效收盘价}
均价黄赋值:TT的C*V日累和/TT的V日累和
{分时均线的取值}
量两步:=V的5日简单移动平均>REF(V的5日简单移动平均,1) AND REF(V的5日简单移动平均,1)>REF(V的5日简单移动平均,2)
价两步赋值: C>=1日前的C AND 1日前的C>2日前的C
价上岗量破5:=C>均价黄 AND V>V的5日简单移动平均
量起爆:=V>=1日前的V*1
价创新高赋值:C>=0日内C最高值
量创新高:=V>=0日内V最高值
对昨日涨幅赋值:(C/DYNAINFO(3)-1)*100<=1.50
{涨幅控制2个点以内}
每日一点赋值:量两步 AND 价两步 AND 价上岗量破5 AND 量起爆 AND 价创新高 AND 量创新高 AND 对昨日涨幅
{计算收益、已爆分钟}
VV赋值:BARSSINCE(每日一点)+1
首次起爆价赋值:VV-1日前的C,NODRAW
输出起爆收益:(现价-首次起爆价)/首次起爆价*100,NODRAW
起爆时间赋值:VV日前的TIME/10000,NODRAW
已爆分钟赋值:VV-1,NODRAW
{画出底线和红球}
首次起爆量赋值:VV-1日前的成交量
MMA30赋值:收盘价的30日指数移动平均
强弱界定赋值:IF(PERIOD=0 ,收盘价的900日指数移动平均,DRAWNULL)
分时均价线赋值:240的C*V日累和/240的V日累和,COLORYELLOW, 线宽为2
GHYJKU赋值:BETWEEN(收盘价/(SUM(成交额,收盘价的有效数据周期数)/SUM(成交量*100,收盘价的有效数据周期数)),1.05,0.95)
VBNH赋值:IF(0,MA(收盘价,收盘价的有效数据周期数),(SUM(成交额,收盘价的有效数据周期数)/SUM(成交量*100,收盘价的有效数据周期数)))
二十☆赋值:EXPMA((收盘价/VBNH),20),画红色,LINETHICK1
六十赋值:EXPMA((收盘价/VBNH),60),COLORLIGREEN,LINETHICK1
FAA赋值:上次TIME=100000距今天数
FCC赋值:REF(0日内C最高值,FAA+1)
FVV赋值:REF(0日内V最高值,FAA+1)
ZF赋值:FCC/DYNAINFO(3)<1.05
XG1赋值:C上穿FCC AND V>FVV AND ZF,画白色
FAA1:=上次TIME=110000距今天数
FCC1:=REF(0日内C最高值,FAA1+1)
FVV1:=REF(0日内V最高值,FAA1+1)
ZF1:=FCC1/DYNAINFO(3)<1.05
XG2赋值:C上穿FCC1 AND V>FVV1 AND ZF1,COLORYELLOW
突破赋值:XG1 OR XG2,画红色
VT赋值:BARSSINCE(突破)+1
首次突破价:=VT-1日前的C,NODRAW
突破收益:=(现价-首次突破价)/首次突破价*100,NODRAW
拉升量赋值:IF(C>1日前的C,成交量,0)
昨拉升最高值:=CONST(FIND最高价(拉升量,FROM开盘价,240,1)),LINETHICK1,画洋红色
今拉升最高值:=CONST(REF(FROM开盘价日内拉升量最高值,0)),COLORYELLOW,NODRAW
攻击力度赋值:今拉升最高值/昨拉升最高值,NODRAW
STICKLINE(FILTER(拉升量上穿昨拉升最高值,30),最低+轴差*0.80,最低,1,0),画青色
当满足条件每日一点时,在最低+轴差*0.65和最低之间画柱状线
当满足条件突破时,在最低+轴差*0.50和最低之间画柱状线
STICKLINE(FILTER(上次C
DRAWICON(FILTER(拉升量上穿昨拉升最高值,30),最低+轴差*0.80,1)
当满足条件每日一点时,在最低+轴差*0.65和1之间画图标
当满足条件突破时,在最低+轴差*0.50和17之间画图标
DRAWICON(FILTER(上次C
打压量赋值:IF(C<1日前的C,成交量,0)
今打压最高值:=CONST(REF(FROM开盘价日内打压量最高值,0)),NODRAW
DRAWTEXT(FILTER(拉升量上穿今打压最高值,30),最低+轴差*0.80,'攻'),画洋红色
DRAWTEXT(FILTER(拉升量上穿今打压最高值,30),最低+轴差*0.60,'击'),画洋红色
当满足条件每日一点时,在最低+轴差*0.65和'起爆'位置书写文字
DRAWNUMBER(每日一点,最低+轴差*0.55,首次起爆价),画绿色
当满足条件突破时,在最低+轴差*0.50和'分时突破'位置书写文字
DRAWNUMBER(突破,最低+轴差*0.40,首次突破价),画白色
DRAWTEXT(FILTER(上次C
输出大单买:(SUM(IF(C>1日前的C AND V>4000,V/1000,0),0))*1500,画红色, 线宽为3
输出大单卖:(SUM(IF(C<1日前的C AND V>4000,V/1000,0),0))*1500,画绿色, 线宽为3
当满足条件突破时,在最低+轴差*0.50和'分时突破'位置书写文字
输出股价趋势:3*SMA((收盘价-27日内最低价最低值)/(27日内最高价最高值-27日内最低价最低值)*100000,5,1)-2*SMA(SMA((收盘价-27日内最低价最低值)/(27日内最高价最高值-27日内最低价最低值)*100000,5,1),3,1),COLORYELLOW
VAR51赋值:(C/1日前的C-1)*100
输出冲涨停:IF(TIME<=093000上穿VAR51<=2 AND VAR51>=-2,10000,0),STICK, 线宽为3
DRAWTEXT((冲涨停 > 0),10950,'冲'),LINETHICK5,COLORYELLOW
DRAWTEXT((冲涨停 > 0),10900,'涨'),LINETHICK5,COLORYELLOW
DRAWTEXT((冲涨停 > 0),10850,'停'),LINETHICK5,COLORYELLOW
HYJKU赋值:BETWEEN(收盘价/(SUM(成交额,收盘价的有效数据周期数)/SUM(成交量*100,收盘价的有效数据周期数)),1.05,0.95)
AVBNH赋值:IF(HYJKU=0,MA(收盘价,收盘价的有效数据周期数),(SUM(成交额,收盘价的有效数据周期数)/SUM(成交量*100,收盘价的有效数据周期数)))
DRAWICON(CROSS(EXPMA((收盘价/AVBNH),20),1.02),1.02+0.005,18)
STICKLINE(CROSS(EXPMA((收盘价/AVBNH),20),1.02),1.02,1.025,4,0), , 画洋红色
DRAWTEXT(CROSS(EXPMA((收盘价/AVBNH),20),1.02),1.02,'拉升'),画白色
DRAWTEXT(CROSS(EXPMA((收盘价/AVBNH),20),1.04),1.04,'可能涨停'),画白色
STICKLINE(EXPMA((收盘价/AVBNH),120)>1.003 ,1.03,1.039,1.0,0),画洋红色
DRAWTEXT(CROSS(EXPMA((收盘价/AVBNH),120),1.0029),1.028,'买进'),画白色
DRAWICON(CROSS(EXPMA((收盘价/AVBNH),120),1.0029),1.0326*1,13)
DRAWTEXT(CROSS(EXPMA((收盘价/AVBNH),120),1.0029),1.036,'观察分时量'),画白色
DRAWICON(CROSS(EXPMA((收盘价/VBNH),60),EXPMA((收盘价/VBNH),120)),EXPMA((收盘价/VBNH),60)*1,1)
DRAWICON(CROSS(EXPMA((收盘价/VBNH),20),1.02),1,18)