通达信T0分时主图源码

[复制链接]
查看236 | 回复0 | 2022-7-24 04:37:54 | 显示全部楼层 |阅读模式

白线:DYNAINFO(3)*(1+0.02),NODRAW;

黄线:DYNAINFO(3)*1.04,NODRAW;
均价:SUM(V*C,0)/SUM(V,0),NODRAW;

日3线:"MMM.D#DAY" ,DOTLINE,COLORWHITE;
 {日3线1:"上三一.SE#DAY" ,DOTLINE,COLORYELLOW;CM:COST(95);DRAWBAND(黄线,RGB(128,128,128),白线,RGB(169,169,169));
 DRAWBAND(C,RGB(128,0,64),均价,RGB(0,0,255));}


 DRAWTEXT(ISLASTBAR,日3线,'UP31'),COLORRED;
日4线:"MMM.MTK#DAY" ,DOTLINE,COLORYELLOW;
 DRAWTEXT(ISLASTBAR,日4线,'阳胜'),COLORRED;
 {日5线:"MMM.CM#DAY" ,DOTLINE,COLORMAGENTA;
 DRAWTEXT(ISLASTBAR,日5线,'筹码'),COLORRED;}
 {日6线:"MMM.TOP#DAY" ,DOTLINE,COLORMAGENTA;
 DRAWTEXT(ISLASTBAR,日6线,'顶线'),COLORRED;
日7线:"MMM.DE2#DAY" ,COLORMAGENTA;
 DRAWTEXT(ISLASTBAR,日7线,'动线2'),COLORRED;日9线:"MMM.DE4#DAY" ,COLORMAGENTA;
 DRAWTEXT(ISLASTBAR,日9线,'动线4'),COLORRED;
日8线:"MMM.SE#DAY" ,COLORMAGENTA;
 DRAWTEXT(ISLASTBAR,日8线,'卖'),COLORRED;}


 {DRAWTEXT(ISLASTBAR,日3线1,'SELL'),COLORYELLOW;}

{绿线:IF(C<500,DYNAINFO(3)*(1-0.02),DYNAINFO(3)*(1-0.005)),DOTLINE,COLORLIGREEN;
零轴线:"上三一.E#DAY", DOTLINE,COLORBLACK;}


 {DRAWBAND(零轴线,RGB(128,128,128),绿线,RGB(169,169,169));}

{阻力1:BBB+CCC*7/8;
支撑1:BBB+CCC*0.8/8;上顶1:BBB+CCC*2/3,COLORGRAY,DOTLINE;
下底1:BBB+CCC/3,COLORGRAY,DOTLINE;
 AAA:=MAX(DYNAINFO(3),DYNAINFO(5));
 BBB:=MIN(DYNAINFO(3),DYNAINFO(6));
 CCC:=AAA-BBB;}


 H1:=MAX(DYNAINFO(3),DYNAINFO(5));
 L1:=MIN(DYNAINFO(3),DYNAINFO(6));
 P1:=H1-L1;
阻力:L1+P1*7/8,COLORRED,LINETHICK1;
支撑:L1+P1*0.78/8 ,COLORYELLOW,LINETHICK1;


现价:=CLOSE;

{DRAWTEXT(LONGCROSS(支撑,现价,2),支撑*1,'B'),COLORYELLOW;}{吸}

DRAWNUMBER(LONGCROSS(支撑,现价,2),支撑*1,支撑),COLORRED;
 DRAWTEXT(LONGCROSS(现价,阻力,2),现价,'S'),COLORRED;{抛};


分时顶:=HHV(H,480);
分时底:=LLV(L,480);
 IF( C>=REF(分时顶,1) ,C,DRAWNULL),LINETHICK1,COLORMAGENTA;
 IF( C<=REF(分时底,1) ,C,DRAWNULL),LINETHICK1,COLORGREEN;
 SJ:=IF(HOUR<12,(HOUR-9.5)*60+MINUTE,(HOUR-11)*60+MINUTE);
 F:=DYNAINFO(3)*(1+(C/REF(C,MIN(SJ,5))-1)*1.5);
 STICKLINE(F<DYNAINFO(3),DYNAINFO(3),F,0,0),COLORLIGREEN;
 STICKLINE(F>DYNAINFO(3),DYNAINFO(3),F,0,0),COLORLIRED;
成交额:=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;
 AAA1:=STRCAT(STRCAT('机构买 = ',CON2STR((100*A2)/A6,0)),'%');
 AAA2:=STRCAT(STRCAT('机构卖 = ',CON2STR((100*A3)/A6,0)),'%');
 AAA3:=STRCAT(STRCAT('机构总买 = ',CON2STR((100*(A2-A3))/A6,0)),'%');
 AAA4:=STRCAT('基因总数 = ',"JYJY.ZSZS#DAY");

DRAWTEXT_FIX(DD1=1,0,0.83,0,AAA1),COLOR00FFFF;
 DRAWTEXT_FIX(DD1=1,0,0.89,0,AAA2),COLOR00FF00;
 DRAWTEXT_FIX(DD1=1,0,0.99,0,AAA4),COLOR0000FF;
 {DRAWTEXT_FIX(DD1=1,0,1.1,0,AAA4),COLOR0000FF;}
 {总类:XA_167+XA_168+XA_169+XA_170+XA_171,COLORRED;
 XA_172:=涨板+地量+矮将+金柱+元帅;
XA_173:=过左+伸缩+阴短+阳矮+直憋;
XA_174:=踩精+双剑+假阴+背反+零号;
XA_175:=十字+峰谷+次阳+三元+悬阴;
XA_176:=梯四+咬峰+三绝+双休+双阳;
D1:=IF(NAMELIKE('S'),0,1);
 D2:=IF(NAMELIKE('*'),0,1);
 DD:=D1 AND D2 AND DYNAINFO(17)>0 AND BARSCOUNT(C)>20;
总数:IF(DD,XA_172+XA_173+XA_174+XA_175+XA_176,0),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(640,1000,940,940,RGB(190,190,190));
 DRAWRECTREL(640,995,940,945,RGB(200,200,200));
 DRAWRECTREL(640,990,940,950,RGB(210,210,210));
 DRAWRECTREL(640,985,940,955,RGB(220,220,220));
 DRAWRECTREL(640,980,940,960,RGB(230,230,230));
 DRAWRECTREL(640,975,940,965,RGB(240,240,240));
 DRAWRECTREL(640,970,940,970,RGB(250,250,250));
 DRAWRECTREL(790-现手卖*210/合,1000,790,940,RGB(0,128,0));
 DRAWRECTREL(790-现手卖*210/合,995,790,945,RGB(0,148,0));
 DRAWRECTREL(790-现手卖*210/合,990,790,950,RGB(0,168,0));
 DRAWRECTREL(790-现手卖*210/合,985,790,955,RGB(0,188,0));
 DRAWRECTREL(790-现手卖*210/合,980,790,960,RGB(0,208,0));
 DRAWRECTREL(790-现手卖*210/合,975,790,965,RGB(0,228,0));
 DRAWRECTREL(790-现手卖*210/合,970,790,970,RGB(0,248,0));
 DRAWRECTREL(790-现手卖*210/合,940,790-现手卖*210/合,1000,RGB(0,128,0));
 DRAWRECTREL(790,1000,790+现手买*210/合,940,RGB(128,0,0));
 DRAWRECTREL(790,995,790+现手买*210/合,945,RGB(148,0,0));
 DRAWRECTREL(790,990,790+现手买*210/合,950,RGB(168,0,0));
 DRAWRECTREL(790,985,790+现手买*210/合,955,RGB(188,0,0));
 DRAWRECTREL(790,980,790+现手买*210/合,960,RGB(208,0,0));
 DRAWRECTREL(790,975,790+现手买*210/合,965,RGB(228,0,0));
 DRAWRECTREL(790,970,790+现手买*210/合,970,RGB(248,0,0));
 DRAWRECTREL(790+现手买*210/合,940,790+现手买*210/合,1000,RGB(128,0,0));
 DRAWRECTREL(789.8,940,790.2,1000,RGB(0,0.0,10));
 DRAWRECTREL(639.8,940,640.2,1000,RGB(0,0,10));
 DRAWRECTREL(939.8,940,940.2,1000,RGB(0,0,10));
 DRAWRECTREL(0,940,1000,940.2,RGB(0,0,10));
 DRAWTEXT_FIX(1,0.8,0.88,0,STRCAT(STRCAT('',CON2STR(现手买,1)),'万')),COLOR0000FF;
 DRAWTEXT_FIX(1,0.68,0.88,0,STRCAT(STRCAT('',CON2STR(现手卖,1)),'万')),COLOR00FF00;
 DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)>0,0.755,1.88,0,STRCAT('  ',STRCAT(CON2STR(差,1),'万'))) COLOR00FFFF;
 DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)<0,0.755,1.88,0,STRCAT('  ',STRCAT(CON2STR(差,1),'万'))) COLOR00FF00;
 DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(差)=0,0.755,1.88,0,STRCAT('  ',STRCAT(CON2STR(差,1),'万'))) COLOR80FFFF;
 DRAWTEXT_FIX(1,1.68,0.97,0,STRCAT(STRCAT(' ',CON2STR(MPB2,1)),'%%')),COLOR00FF00;
 DRAWTEXT_FIX(1,1.94,0.97,0,STRCAT(STRCAT('',CON2STR(MPB1,1)),'%%')),COLOR0000FF;

DRAWTEXT_FIX(1,0.05,0.1,0,HYBLOCK)COLOR0080FF;
 DRAWTEXT_FIX(1,0.12,0.1,0,DYBLOCK)COLORRED;
 DRAWTEXT_FIX(1,0.05,0.14,0,GNBLOCK)COLOR0000FF;
 DRAWTEXT_FIX(1,0.05,0.18,0,FGBLOCK)COLORFF00FF;


 {分时操作线}

{均价:SUM(V*C,0)/SUM(V,0),COLOR00F7F7,DOTLINE;Y:="MK.明Y#DAY";
 D:="MK.明D#DAY";}


 {Z:="MK.明Z#DAY";
 K:="MK.明K#DAY";}

{KJ1:REFDATE(Y,DATE),COLOR00AEAE;KJ2:REFDATE(D,DATE),COLORRED,DOTLINE;KJ6:REFDATE(Y,DATE),COLOR00FF00 ,DOTLINE ;}

{KJ4:REFDATE(Z,DATE),COLOR000000;
 KJ5:REFDATE(K,DATE),COLORBD0000;}

{DRAWNUMBER(ISLASTBAR,KJ1,KJ1),COLOR00AEAE;DRAWNUMBER(ISLASTBAR,KJ2,KJ2);
 DRAWNUMBER(ISLASTBAR,KJ6,KJ6);}

{DRAWNUMBER(ISLASTBAR,KJ4,KJ4);
 DRAWNUMBER(ISLASTBAR,KJ5,KJ5),COLOR9B9B00;}

{均:SUM(CLOSE*VOL,FROMOPEN)/SUM(VOL,FROMOPEN),COLOR000080,DOTLINE;};

超B:=L2_AMO(0,2)/10000.0;
大B:=L2_AMO(1,2)/10000.0;
中B:=L2_AMO(2,2)/10000.0;
小B:=L2_AMO(3,2)/10000.0;
超S:=-L2_AMO(0,3)/10000.0;
大S:=-L2_AMO(1,3)/10000.0;
中S:=-L2_AMO(2,3)/10000.0;
小S:=-L2_AMO(3,3)/10000.0;
净流入:(超B+大B+中B+小B)+(超S+大S+中S+小S),NODRAW;
超大单:(超B)+(超S);
大单:(大B)+(大S);
中单:(中B)+(中S);
小单:(小B)+(小S);

 

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则