以下是通达信数据统计公式代码,随意插入个人的主副图公式中

通达信数据统计公式代码,随意插入个人的主副图公式中

以前来这里很少,只是索取没有贡献心有愧疚,这里发的两段代码段也不是我的作品,具体是那位老师的记不太清了,我只是整理了一下,希望大家喜欢。
主图代码段
超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;

{TESTSKIP(NOT(超B OR 大B OR 中B OR 小B OR 超S OR 大S OR 中S OR 小S)!=0);}

大宗进:=(超B)+(大B),NODRAW;
大宗出:=(超S)+(大S),NODRAW;
非大宗进:=(中B)+(小B),NODRAW;
非大宗出:=(中S)+(小S),NODRAW;

DAZHIV:=CONST(MAX(ABS(大宗进),MAX(ABS(大宗出),MAX(ABS(非大宗进),ABS(非大宗出))))),NODRAW;
DRAWRECTREL(0,CONST(950-(ABS(非大宗进+大宗进)*250/DAZHIV)),20,960,IF(CONST((非大宗进+大宗进)>0),RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(22,CONST(950-(ABS(非大宗出+大宗出)*250/DAZHIV)),42,960,IF(CONST((非大宗出+大宗出)>0),RGB(0,125,0),RGB(255,0,0)));

DRAWRECTREL(52,CONST(950-(ABS(大宗进)*250/DAZHIV)),72,960,IF(CONST(大宗进>0),RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(72,CONST(950-(ABS(大宗出)*250/DAZHIV)),92,960,IF(CONST(大宗出>0),RGB(23,125,255),RGB(255,0,0)));

DRAWRECTREL(102,CONST(950-(ABS(非大宗进)*250/DAZHIV)),122,960,IF(CONST(非大宗进>0),RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(122,CONST(950-(ABS(非大宗出)*250/DAZHIV)),142,960,IF(CONST(非大宗出>0),RGB(23,125,255),RGB(255,0,0)));
{XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
附图
QM0:=ZST1.净流入#DAY;
QM1:=ZST1.超大单#DAY;
QM2:=ZST1.大单#DAY;
QM3:=ZST1.中单#DAY;
QM4:=ZST1.小单#DAY;
QMAXV:=ZST1.DAZHI#DAY;
DRAWRECTREL(0,0,150,960,RGB(0,30,0));
DRAWRECTREL(0,CONST(748-(ABS(QM0)*200/QMAXV))/1.03,20,748,IF(CONST(QM0)>0,RGB(100,0,0),RGB(0,50,0)));
DRAWRECTREL(30,CONST(748-(ABS(QM1)*200/QMAXV))/1.03,50,748,IF(CONST(QM1)>0,RGB(100,0,0),RGB(0,50,0)));
DRAWRECTREL(60,CONST(748-(ABS(QM2)*200/QMAXV))/1.03,80,748,IF(CONST(QM2)>0,RGB(100,0,0),RGB(0,50,0)));
DRAWRECTREL(90,CONST(748-(ABS(QM3)*200/QMAXV))/1.03,110,748,IF(CONST(QM3)>0,RGB(100,0,0),RGB(0,50,0)));
DRAWRECTREL(120,CONST(748-(ABS(QM4)*200/QMAXV))/1.03,140,748,IF(CONST(QM4)>0,RGB(100,0,0),RGB(0,50,0)));
DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0.76,0,’净流’),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.033,0.76,0,’超大’),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.06,0.76,0,’大户’),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.091,0.76,0,’中户’),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.12,0.76,0,’散户‘),COLORYELLOW;
MM0:=0.53;
MM1:=0.105;
{MM0:=0.805;}
{MM1:=0.105;}
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.003,MM0-ABS(QM0)*MM1/QMAXV,0,CEILING(QM0)),COLORRED;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.033,MM0-ABS(QM1)*MM1/QMAXV,0,CEILING(QM1));
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.065,MM0-ABS(QM2)*MM1/QMAXV,0,CEILING(QM2)),COLORLIBLUE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.093,MM0-ABS(QM3)*MM1/QMAXV,0,CEILING(QM3));
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.123,MM0-ABS(QM4)*MM1/QMAXV,0,CEILING(QM4));
DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0,0,’单位(万元)’),COLORYELLOW;
 

 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。