通达信《资金分析》优化版(主图公式)
《资金分析》优化版(主图公式),本人使用之后,感觉原图太过于粗糙,特优化了以下地方:
1.原版矩形图形体太宽大,在本版本已经得到细化,使图形更加美观;
2.原版矩形图内颜色重新优化,使之更加美观;
3.原版矩形图与下方文字不够协调,在本版本已经改进;
4.原版本资金量数额太大,已经由 元 改进为 万元 ,使之更加一目了然;
5.增加了表示趋势方向的射线;
6.在主图右上角增加了最后交易时间显示;
7.在右下角增加了外盘大于内盘多少倍的提示;
8.在顶栏增加了资金净流入的数据显示;
9.增加了涨停板、跌停板提示,并且涨停板为醒目的红色柱、跌停板为蓝色柱;
10.增加了主图背景显示颜色,使之更加美观。
注意:此公式通达信内核为5.83以下的低版本不能用,因为5.83以下的版本输出项目不能超过50个;不支持L2大单数据的通达信普通版本不能用,只能用于支持L2大单数据的通达信决策家、通达信金融终端等高端版本,如:通达信5.83普通版,由于不支持L2大单数据,在软件的左下角不能显示资金流向分布的横向柱形图,解决方法:在理想论坛的股票软件里面,随便下载一个软件都行,如:陈中老师5.84机构交易版,通达信金融终端各版本,即可搞定。
《资金分析优化版》源码如下:
DRAWGBK(C 0, RGB(0,10,10),RGB(88,0,0),0,'24',0);
DRAWNUMBER(ISLASTBAR,C,C),COLORMAGENTA;
MA5:MA(CLOSE,5),COLORFFFFFF;
MA17:MA(CLOSE,17),COLORYELLOW;
MA55:MA(CLOSE,55),COLORMAGENTA;
MA72:MA(CLOSE,72),COLORGREEN;
MA200:MA(CLOSE,200),COLORE67010;
DRAWKLINE(HIGH, OPEN,LOW, CLOSE);
射线3X: DRAWLINE(L=LLV(L,3),L,H=HHV(H,3),L,0),COLORLIGRAY;
射线5: DRAWLINE(H=HHV(H,5),H,L=LLV(L,5),L,0),COLORLIGRAY;
射线5X: DRAWLINE(L=LLV(L,5),L,H=HHV(H,5),L,0),COLORLIGRAY;
射线7: DRAWLINE(H=HHV(H,7),H,L=LLV(L,7),L,0),COLORE67010;
射线7X: DRAWLINE(L=LLV(L,7),L,H=HHV(H,7),L,0),COLORE67010;
射线10:DRAWLINE(H=HHV(H,10),H,L=LLV(L,10),L,0),COLOR0000FF;
射线10X:DRAWLINE(L=LLV(L,10),L,H=HHV(H,10),L,0),COLOR0000FF;
涨幅大于9.94:=C/REF(C,1) 1.09;
超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))/100,COLORCYAN,NODRAW;
中单:(中B+中S)/100,COLORLIGRAY,NODRAW;
大宗净入:=((超B+大B)+(超S+大S))/100;
超大单:=((超B)+(超S))/100;
大单:=((大B)+(大S))/100;
小单:=((小B)+(小S))/100;
大宗进:=((超B)+(大B))/100;
大宗出:=((超S)+(大S))/100;
非大宗进:=((中B)+(小B))/100;
非大宗出:=((中S)+(小S))/100;
资金净入:=((超B+大B+中B+小B)+(超S+大S+中S+小S))/100;
净入5日:=SUM(资金净入,5);
净入10日:=SUM(资金净入,10);
主力资金线:=(L2_AMO(0,0)+L2_AMO(1,0)-L2_AMO(0,1)-L2_AMO(1,1))/100.0,LINETHICK2;
主力买力度:=LARGEINTRDVOL*100/VOL;
主力卖力度:=LARGEOUTTRDVOL*100/VOL;
AA:=CONST(MAX(ABS(净流入亿),MAX(ABS(大宗净入),MAX(ABS(大宗进),MAX(ABS(大宗出),MAX(ABS(非大宗进),ABS(非大宗出)))))))*3,NODRAW;
DRAWRECTREL(0,CONST(830-(ABS(净流入亿)*500/AA)),30,945,IF(CONST(净流入亿) 0,RGB(250,150,10),RGB(0,100,100)));
DRAWRECTREL(35,CONST(830-(ABS(大宗净入)*500/AA)),65,945,IF(CONST(大宗净入) 0,RGB(250,150,10),RGB(0,100,100)));
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.000,0.88,0,INTPART(净流入亿)),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.034,0.88,0,INTPART(大宗净入)),COLORWHITE;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.000,1,0,'净流入'),COLORWHITE;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.034,1,0,'净大宗'),COLORWHITE;
DRAWRECTREL(77,CONST(830-(ABS(大宗进)*500/AA)),97,945,IF(CONST(大宗进) 0,RGB(255,0,0),RGB(0,0,255)));
DRAWRECTREL(99,CONST(830-(ABS(大宗出)*500/AA)),119,945,IF(CONST(大宗出) 0,RGB(0,0,255),RGB(0,0,255)));
DRAWRECTREL(127,CONST(830-(ABS(非大宗进)*500/AA)),147,945,IF(CONST(非大宗进) 0,RGB(139,0,139),RGB(23,155,255)));
DRAWRECTREL(149,CONST(830-(ABS(非大宗出)*500/AA)),169,945,IF(CONST(非大宗出) 0,RGB(23,155,255),RGB(139,0,139)));
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.077,1,0,'主力进出'),COLORWHITE;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.128,1,0,'散户进出'),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.077,0.88,0,INTPART(大宗进)),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.097,0.88,0,INTPART(大宗出)),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.126,0.88,0,INTPART(非大宗进)),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.149,0.88,0,INTPART(非大宗出)),COLORWHITE;
AAB:=CONST(MAX(ABS(超大单),MAX(ABS(大单),MAX(ABS(中单),ABS(小单))))),NODRAW;
DRAWRECTREL(0,CONST(830-(ABS(超大单)*500/AAB))/2,15,460,IF(CONST(超大单) 0,RGB(255,0,255),RGB(23,155,255)));
DRAWRECTREL(17,CONST(830-(ABS(大单)*500/AAB))/2,32,460,IF(CONST(大单) 0,RGB(255,0,255),RGB(23,155,255)));
DRAWRECTREL(34,CONST(830-(ABS(中单)*500/AAB))/2,49,460,IF(CONST(中单) 0,RGB(255,0,255),RGB(23,155,255)));
DRAWRECTREL(51,CONST(830-(ABS(小单)*500/AAB))/2,66,460,IF(CONST(小单) 0,RGB(255,0,255),RGB(23,155,255)));
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.000,0.460,0,'超 大 中 散'),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.000,0.400,0,INTPART(超大单)),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.017,0.400,0,INTPART(大单)),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.034,0.400,0,INTPART(中单)),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.051,0.400,0,INTPART(小单)),COLORWHITE;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0,0,'【资金分析¥百万元】'),COLORWHITE;
AAC:=CONST(MAX(ABS(净入5日),ABS(净入10日))),NODRAW;
DRAWRECTREL(78,CONST(830-(ABS(净入5日)*500/AAC))/2,110,460,IF(CONST(净入5日) 0,RGB(250,150,10),RGB(23,133,255)));
DRAWRECTREL(116,CONST(830-(ABS(净入10日)*500/AAC))/2,148,460,IF(CONST(净入10日) 0,RGB(250,150,10),RGB(23,133,255)));
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.078,0.400,0,INTPART(净入5日)),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.115,0.400,0,INTPART(净入10日)),COLORWHITE;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.075,0.460,0,'流入5日 流入10日'),COLORWHITE;
DDX:=(LARGEINTRDVOL-LARGEOUTTRDVOL)*1000/FINANCE(7);
DDY:=IF(TRADENUM 0,(TRADEOUTNUM-TRADEINNUM)*100/TRADENUM,0);
DDZ:=IF(TRADENUM 0,(LARGETRDINNUM-LARGETRDOUTNUM)/TRADENUM*100,0);
DRAWRECTREL(118,0,165,40,IF(CONST(DDX) 0,RGB(255,0,0),RGB(0,50,0)));
DRAWRECTREL(118,45,165,85,IF(CONST(DDY) 0,RGB(255,0,0),RGB(0,50,0)));
DRAWRECTREL(118,90,165,130,IF(CONST(DDZ) 0,RGB(255,0,0),RGB(0,50,0)));
DRAWTEXT_FIX(1,0.123,0.00,0,STRCAT('DDX:',CON2STR(DDX,0))),COLORYELLOW,COLORWHITE;
DRAWTEXT_FIX(1,0.123,0.04,0,STRCAT('DDY:',CON2STR(DDY,0))),COLORYELLOW,COLORWHITE;
DRAWTEXT_FIX(1,0.123,0.09,0,STRCAT('DDZ:',CON2STR(DDZ,0))),COLORYELLOW,COLORWHITE;
AAD:=CONST(MAX(ABS(主力买力度),ABS(主力卖力度)))*4,NODRAW;
DRAWRECTREL(0,515,CONST(ABS(主力买力度)*500/AAD),568,IF(CONST(主力买力度) 0,RGB(139,0,139),RGB(0,255,255)));
DRAWRECTREL(0,570,CONST(ABS(主力卖力度)*500/AAD),623,IF(CONST(主力卖力度) 0,RGB(23,125,255),RGB(0,255,255)));
DRAWTEXT_FIX(1,0,0.516,0,STRCAT('主力买力度:',CON2STR(主力买力度,0))),COLORRED,COLORWHITE;
DRAWTEXT_FIX(1,0,0.574,0,STRCAT('主力卖力度:',CON2STR(主力卖力度,0))),COLORRED,COLORWHITE;
涨幅:=(C-REF(C,1))/REF(C,1)*100,NODRAW;
STICKLINE(涨幅大于9.94,C,O,4,0),COLORRED;
STICKLINE(涨幅 -9.92,C,O,4,0),COLORBLUE;
DRAWTEXT(涨幅大于9.94,L-0.009,'涨停'),COLORRED;
DRAWTEXT_FIX((DYNAINFO(23)/DYNAINFO(22)) 1,0.86,0.95,0,'★外盘大1倍以上'),COLORWHITE;
DRAWTEXT_FIX((DYNAINFO(23)/DYNAINFO(22)) 2,0.86,0.95,0,'★外盘大2倍以上'),COLORWHITE;
DRAWTEXT_FIX((DYNAINFO(23)/DYNAINFO(22)) 3,0.86,0.95,0,'★外盘大3倍以上'),COLORWHITE;
{右上角显示时间}
N8:=STRCAT(CON2STR(YEAR,0),' 年 ');
Y8:=STRCAT(CON2STR(MONTH,0),' 月 ');
R8:=STRCAT(CON2STR(DAY,0),' 日 ');
SJ8:=STRCAT(STRCAT(N8,Y8), R8);
DRAWTEXT_FIX(C 0,0.88,0,0,SJ8),COLOR00FFFF;