通达信【超级抓板分时】分时主图指标 做T神器 源码附图
MA30:=EMA(CLOSE,30); 强弱:=EMA(CLOSE,900);
STICKLINE((MA30>强弱),MA30,强弱,0,-1),COLORLIGRAY;
STICKLINE((MA30<强弱),MA30,强弱,0,-1),COLORLICYAN;
H1:=MAX(DYNAINFO(3),DYNAINFO(5));
L1:=MIN(DYNAINFO(3),DYNAINFO(6));
P1:=H1-L1;
阻力:L1+P1*7/8,COLORLIMAGENTA,DOTLINE;
支撑:L1+P1*0.5/8,COLORCYAN,DOTLINE;
中:(支撑+阻力)/2,COLORLIGRAY,POINTDOT;
均价:SUM(V*C,0)/SUM(V,0),COLORYELLOW,DOTLINE;
现价:CLOSE,COLORWHITE,LINETHICK3;
DRAWTEXT(ISLASTBAR AND 现价,现价,STRCAT('←',CON2STR(现价,2))),COLORYELLOW;
STICKLINE(CROSS(支撑,现价),支撑,中,0,-1),COLORYELLOW;
STICKLINE(CROSS(现价,阻力),阻力,中,0,-1),COLORGREEN;
DRAWTEXT(LONGCROSS(支撑,现价,2),C*0.9982,' 买'),COLORYELLOW;
DRAWTEXT(LONGCROSS(现价,阻力,2),C*1.0018,' 卖'),COLORCYAN;
STICKLINE(C<支撑,支撑,C,1,0),COLORYELLOW;DRAWICON(CROSS(支撑,现价),(支撑-中)/5+支撑,26);
STICKLINE(C>阻力,阻力,C,1,0),COLORLIGREEN;DRAWICON(CROSS(现价,阻力),阻力-(支撑-中)/5,15);
成交额:=V*C/100,NODRAW;
A2:=SUM((IF(((成交额/8>20) AND (CLOSE>(REF(CLOSE,1)))),成交额,0)),0);
A3:=SUM((IF(((成交额/8>20) AND (CLOSE<(REF(CLOSE,1)))),成交额,0)),0);A6:=(A2+A3);
A7:=IF((ISLASTBAR),((100*A2)/A6),0);
A8:=IF((ISLASTBAR),((100*A3)/A6),0);
DD1:=1;
CTA1:=STRCAT(STRCAT('机构买',CON2STR((100*A2)/A6,0)),'%');
CTA2:=STRCAT(STRCAT('机构卖',CON2STR((100*A3)/A6,0)),'%');
CTA3:=STRCAT(STRCAT('机构总买入',CON2STR((100*(A2-A3))/A6,0)),'%');
A000:=DRAWTEXT_FIX(DD1=1,0,0.02,0,CTA1);
A001:=DRAWTEXT_FIX(DD1=1,0,0.13,0,CTA2);
DRAWTEXT_FIX(DD1=1,0.842,1,0,CTA3),COLORYELLOW;
现手买:BUYVOL*DYNAINFO(7)*100/10000 COLOR0000FF,NODRAW;
现手卖:SELLVOL*DYNAINFO(7)*100/10000 COLOR00FF00,NODRAW;
合:=ABS(现手买)+ABS(现手卖)COLOR80FFFF,NODRAW;
差:=ABS(现手买)-ABS(现手卖)COLOR80FFFF,NODRAW;
MPB1:=ABS(现手买)/合*100;
MPB2:=ABS(现手卖)/合*100;
TESTSKIP(NOT(现手买 OR 现手卖 OR 合 OR 差 OR MPB1 OR MPB2)!=0);
DRAWRECTREL(595,1000,795,940,RGB(0,128,0));
DRAWRECTREL(595,995,795,945,RGB(0,148,0));
DRAWRECTREL(595,990,795,950,RGB(0,168,0));
DRAWRECTREL(595,985,795,955,RGB(0,188,0));
DRAWRECTREL(595,980,795,960,RGB(0,208,0));
DRAWRECTREL(595,975,795,965,RGB(0,228,0));
DRAWRECTREL(595,970,795,970,RGB(0,248,0));
DRAWRECTREL(595,1000,595+现手买*210/合,940,RGB(128,0,0));DRAWRECTREL(595,995,595+现手买*210/合,945,RGB(148,0,0));
DRAWRECTREL(595,990,595+现手买*210/合,950,RGB(168,0,0));DRAWRECTREL(595,985,595+现手买*210/合,955,RGB(188,0,0));
DRAWRECTREL(595,980,595+现手买*210/合,960,RGB(208,0,0));DRAWRECTREL(595,975,595+现手买*210/合,965,RGB(228,0,0));
DRAWRECTREL(595,970,595+现手买*210/合,970,RGB(248,0,0));
DRAWRECTREL(595+现手买*210/合,940,595+现手买*210/合,1000,RGB(128,0,0));DRAWRECTREL(795,940,795,1000,RGB(0,0.0,10));
DRAWRECTREL(594.8,939.8,594.8,1000,RGB(0,0,10));
DRAWRECTREL(594.8,939.8,594.8,939.8,RGB(0,0,10));
DRAWRECTREL(594.8,1000,594.8,1000,RGB(0,0,10));
DRAWTEXT_FIX(1,0.560,0.89,0,STRCAT(STRCAT('',CON2STR(现手买,1)),'万')),COLORRED;
DRAWTEXT_FIX(1,0.800,0.89,0,STRCAT(STRCAT('',CON2STR(现手卖,1)),'万')),COLORGREEN;
DRAWTEXT_FIX(1,0.800,0.98,0,STRCAT(STRCAT(' ',CON2STR(MPB2,1)),'%')),COLORGREEN;
DRAWTEXT_FIX(1,0.560,0.98,0,STRCAT(STRCAT('',CON2STR(MPB1,1)),'%')),COLORRED;
MZ0:=(BARSLAST(((HOUR=9) AND (MINUTE=31)))+1);
上穿分时:IF(((SETCODE<2) AND (CONST(MZ0)<241)),CONST(IF((TIME<1000),HHV(CLOSE,0),SUM((IF((TIME=1000),1,0)*HHV(CLOSE,0)),0))),DRAWNULL),LINETHICK1,COLORLIRED;
底支:IF(((SETCODE<2) AND (CONST(MZ0)<241)),CONST(IF((TIME<1000),HHV(CLOSE,0),SUM((IF((TIME=1000),1,0)*LLV(CLOSE,0)),0))),DRAWNULL),LINETHICK1,COLORLIGREEN;
STICKLINE(TIME=931 OR TIME=1000,上穿分时,底支,0,-1),COLORLIBLUE;
分时上突:=CROSS(C,上穿分时);上突:=C<上穿分时 AND 上穿分时>底支;
DRAWICON(分时上突,C,5);股价支撑线:=MA(CLOSE,20);
底价线:股价支撑线-2*STD(CLOSE,20),COLORMAGENTA,LINETHICK2;
DRAWTEXT_FIX(1,0.0001,0.0,0,STRCAT(STRCAT('【今日强势有效突破】',CON2STR(上穿分时,2)),' 元 买入稳赚')),COLORYELLOW;
DRAWTEXT_FIX(1,0.0001,0.9,0,STRCAT(STRCAT('【底部得到有效支撑】',CON2STR(底支,2)),' 元 可以参考')),COLORLIRED;
未来函数检测结果如下:
该公式包含未来函数:DYNAINFO
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
MA30赋值:收盘价的30日指数移动平均
强弱赋值:收盘价的900日指数移动平均
STICKLINE((MA30>强弱),MA30,强弱,0,-1),COLORLIGRAY
STICKLINE((MA30<强弱),MA30,强弱,0,-1),COLORLICYAN
H1赋值:MAX(DYNAINFO(3),DYNAINFO(5))
L1赋值:MIN(DYNAINFO(3),DYNAINFO(6))
P1赋值:H1-L1
输出阻力:L1+P1*7/8,COLORLIMAGENTA,DOTLINE
输出支撑:L1+P1*0.5/8,画青色,DOTLINE
输出中:(支撑+阻力)/2,COLORLIGRAY,POINTDOT
输出均价:0的V*C日累和/0的V日累和,画黄色,DOTLINE
输出现价:收盘价,画白色, 线宽为3
DRAWTEXT(ISLASTBAR AND 现价,现价,STRCAT('←',CON2STR(现价,2))),画黄色
STICKLINE(支撑上穿现价,支撑,中,0,-1),画黄色
STICKLINE(现价上穿阻力,阻力,中,0,-1),画绿色
DRAWTEXT(LONGCROSS(支撑,现价,2),C*0.9982,' 买'),画黄色
DRAWTEXT(LONGCROSS(现价,阻力,2),C*1.0018,' 卖'),画青色
当满足条件C<支撑时,在支撑和C之间画柱状线
DRAWICON(支撑上穿现价,(支撑-中)/5+支撑,26)
当满足条件C>阻力时,在阻力和C之间画柱状线
DRAWICON(现价上穿阻力,阻力-(支撑-中)/5,15)
成交额赋值:V*C/100,NODRAW
A2赋值:SUM((IF(((成交额/8>20) AND (收盘价>(1日前的收盘价))),成交额,0)),0)
A3赋值:SUM((IF(((成交额/8>20) AND (收盘价<(1日前的收盘价))),成交额,0)),0)
A6赋值:(A2+A3)
A7赋值:IF((ISLASTBAR),((100*A2)/A6),0)
A8赋值:IF((ISLASTBAR),((100*A3)/A6),0)
DD1赋值:1
CTA1赋值:STRCAT(STRCAT('机构买',CON2STR((100*A2)/A6,0)),'%')
CTA2赋值:STRCAT(STRCAT('机构卖',CON2STR((100*A3)/A6,0)),'%')
CTA3赋值:STRCAT(STRCAT('机构总买入',CON2STR((100*(A2-A3))/A6,0)),'%')
当满足条件DD1=1时,在横轴0纵轴0.02位置书写文字
当满足条件DD1=1时,在横轴0纵轴0.13位置书写文字
当满足条件DD1=1时,在横轴0.842纵轴1位置书写文字
输出现手买:BUY成交量*现价*100/10000 COLOR0000FF,NODRAW
输出现手卖:SELL成交量*现价*100/10000 COLOR00FF00,NODRAW
合赋值:现手买的绝对值+ABS(现手卖)COLOR80FFFF,NODRAW
差赋值:现手买的绝对值-ABS(现手卖)COLOR80FFFF,NODRAW
MPB1赋值:现手买的绝对值/合*100
MPB2赋值:现手卖的绝对值/合*100
TESTSKIP(NOT(现手买 OR 现手卖 OR 合 OR 差 OR MPB1 OR MPB2)!=0)
DRAWRECTREL(595,1000,795,940,RGB(0,128,0))
DRAWRECTREL(595,995,795,945,RGB(0,148,0))
DRAWRECTREL(595,990,795,950,RGB(0,168,0))
DRAWRECTREL(595,985,795,955,RGB(0,188,0))
DRAWRECTREL(595,980,795,960,RGB(0,208,0))
DRAWRECTREL(595,975,795,965,RGB(0,228,0))
DRAWRECTREL(595,970,795,970,RGB(0,248,0))
DRAWRECTREL(595,1000,595+现手买*210/合,940,RGB(128,0,0))
DRAWRECTREL(595,995,595+现手买*210/合,945,RGB(148,0,0))
DRAWRECTREL(595,990,595+现手买*210/合,950,RGB(168,0,0))
DRAWRECTREL(595,985,595+现手买*210/合,955,RGB(188,0,0))
DRAWRECTREL(595,980,595+现手买*210/合,960,RGB(208,0,0))
DRAWRECTREL(595,975,595+现手买*210/合,965,RGB(228,0,0))
DRAWRECTREL(595,970,595+现手买*210/合,970,RGB(248,0,0))
DRAWRECTREL(595+现手买*210/合,940,595+现手买*210/合,1000,RGB(128,0,0))
DRAWRECTREL(795,940,795,1000,RGB(0,0.0,10))
DRAWRECTREL(594.8,939.8,594.8,1000,RGB(0,0,10))
DRAWRECTREL(594.8,939.8,594.8,939.8,RGB(0,0,10))
DRAWRECTREL(594.8,1000,594.8,1000,RGB(0,0,10))
DRAWTEXT_FIX(1,0.560,0.89,0,STRCAT(STRCAT('',CON2STR(现手买,1)),'万')),画红色
DRAWTEXT_FIX(1,0.800,0.89,0,STRCAT(STRCAT('',CON2STR(现手卖,1)),'万')),画绿色
DRAWTEXT_FIX(1,0.800,0.98,0,STRCAT(STRCAT(' ',CON2STR(MPB2,1)),'%')),画绿色
DRAWTEXT_FIX(1,0.560,0.98,0,STRCAT(STRCAT('',CON2STR(MPB1,1)),'%')),画红色
MZ0赋值:(上次((HOUR=9距今天数 AND (MINUTE=31)))+1)
输出上穿分时:IF(((SETCODE<2) AND (CONST(MZ0)<241)),CONST(IF((TIME<1000),0日内收盘价最高值,SUM((IF((TIME=1000),1,0)*0日内收盘价最高值),0))),DRAWNULL),LINETHICK1,COLORLIRED
输出底支:IF(((SETCODE<2) AND (CONST(MZ0)<241)),CONST(IF((TIME<1000),0日内收盘价最高值,SUM((IF((TIME=1000),1,0)*0日内收盘价最低值),0))),DRAWNULL),LINETHICK1,COLORLIGREEN
当满足条件TIME=931 OR TIME=1000时,在上穿分时和底支之间画柱状线
分时上突赋值:C上穿上穿分时
上突赋值:C<上穿分时 AND 上穿分时>底支
当满足条件分时上突时,在C和5之间画图标
股价支撑线:=收盘价的20日简单移动平均
输出底价线:股价支撑线-2*收盘价的20估算标准差,画洋红色, 线宽为2
DRAWTEXT_FIX(1,0.0001,0.0,0,STRCAT(STRCAT('【今日强势有效突破】',CON2STR(上穿分时,2)),' 元 买入稳赚')),画黄色
DRAWTEXT_FIX(1,0.0001,0.9,0,STRCAT(STRCAT('【底部得到有效支撑】',CON2STR(底支,2)),' 元 可以参考')),COLORLIRED