您现在的位置:好股网 >> 股票公式 >> 飞狐股票公式 >> 一键转帖:板块聚焦(源码+图)

板块聚焦(源码+图)


指标功能:[B]国产软件[/B]
指标类型:简体中文
所需积分:0
推荐星级:
授权方式:共享版
公式大小:2.00 KB
更新时间:2011-02-22 09:02:00
公式简介:

X1:=140;
Y1:=5;
Y2:=100;
BKNAME:='板块指数';
STKC:=STKCOUNT(BKNAME);
VARIABLE:S=0,ZFSZ[STKC]=0,ZFNAME[10]='',ZFNUMBER[10]=0;
FOR P=1 TO STKC DO BEGIN
TY1:=STKFROMBLK(BKNAME,P);
TY2:=DYNAINFO2(14,TY1)*100;
ZFSZ[P]:=TY2;
IF TY2>=0 THEN
S:=S+1;
END;
NWY:=SORTPOS(ZFSZ,0,1,STKC);
FOR P1=1 TO 10 DO BEGIN
ZFDM:=STKFROMBLK(BKNAME,ZFSZ[STKC-(P1-1)]);
TE:=STKNAMEEX(ZFDM);
ZFNAME[P1]:=STRLEFT(TE,STRLEN(TE)-4);
ZFNUMBER[P1]:=DYNAINFO2(14,ZFDM)*100;
END;
DRAWTEXTEX(1,1,X1,Y1,ZFNAME[1]+'('+NUMTOSTR(STKCOUNT(ZFNAME[1]),0)+') '+NUMTOSTR(ZFNUMBER[1],2)+' %'),ALIGN2,colorFF;
DRAWTEXTEX(1,1,X1,Y1+Y2,ZFNAME[2]+'('+NUMTOSTR(STKCOUNT(ZFNAME[2]),0)+') '+NUMTOSTR(ZFNUMBER[2],2)+' %'),ALIGN2,color80FF;
DRAWTEXTEX(1,1,X1,Y1+Y2*2,ZFNAME[3]+'('+NUMTOSTR(STKCOUNT(ZFNAME[3]),0)+') '+NUMTOSTR(ZFNUMBER[3],2)+' %'),ALIGN2,colorFFFF;
DRAWTEXTEX(1,1,X1,Y1+Y2*3,ZFNAME[4]+'('+NUMTOSTR(STKCOUNT(ZFNAME[4]),0)+') '+NUMTOSTR(ZFNUMBER[4],2)+' %'),ALIGN2,colorFF00;
DRAWTEXTEX(1,1,X1,Y1+Y2*4,ZFNAME[5]+'('+NUMTOSTR(STKCOUNT(ZFNAME[5]),0)+') '+NUMTOSTR(ZFNUMBER[5],2)+' %'),ALIGN2,colorFF0000;
DRAWTEXTEX(1,1,X1,Y1+Y2*5,ZFNAME[6]+'('+NUMTOSTR(STKCOUNT(ZFNAME[6]),0)+') '+NUMTOSTR(ZFNUMBER[6],2)+' %'),ALIGN2,colorFFFF00;
DRAWTEXTEX(1,1,X1,Y1+Y2*6,ZFNAME[7]+'('+NUMTOSTR(STKCOUNT(ZFNAME[7]),0)+') '+NUMTOSTR(ZFNUMBER[7],2)+' %'),ALIGN2,colorFF00FF;
DRAWTEXTEX(1,1,X1,Y1+Y2*7,ZFNAME[8]+'('+NUMTOSTR(STKCOUNT(ZFNAME[8]),0)+') '+NUMTOSTR(ZFNUMBER[8],2)+' %'),ALIGN2,colorFF8080;
DRAWTEXTEX(1,1,X1,Y1+Y2*8,ZFNAME[9]+'('+NUMTOSTR(STKCOUNT(ZFNAME[9]),0)+') '+NUMTOSTR(ZFNUMBER[9],2)+' %'),ALIGN2,color808040;
DRAWTEXTEX(1,1,X1,Y1+Y2*9,ZFNAME[10]+'('+NUMTOSTR(STKCOUNT(ZFNAME[10]),0)+') '+NUMTOSTR(ZFNUMBER[10],2)+' %'),ALIGN2,colorFFFFFF;
VARIABLE:MINZFSTR[10]='';
PAA:=0;BEGIN
PAA:=PAA+1;
MINSTKNAME:=ZFNAME[PAA];
STKNUM:=STKCOUNT(MINSTKNAME);
VARIABLE:ZF[STKNUM]=0;
FOR P2=1 TO STKNUM DO BEGIN
TY1:=STKFROMBLK(MINSTKNAME,P2);
TY2:=DYNAINFO2(14,TY1)*100;
ZF[P2]:=TY2;
END;
NWY:=SORTPOS(MINZFSTR,0,1,STKNUM);
UB:=IF(STKNUM>=8,8,STKNUM);
FOR P3=1 TO UB DO BEGIN
ZFDM:=STKFROMBLK(MINSTKNAME,ZF[STKNUM-(P3-1)]);
TE:=STKNAMEEX(ZFDM);
MINZFSTR[PAA]:=MINZFSTR[PAA]+'('+TE+NUMTOSTR(DYNAINFO2(14,ZFDM)*100,2)+'%'+')'+' ';
END;
END;
X4:=160;
DRAWTEXTEX(1,1,X4,Y1,MINZFSTR[1]),colorFF;
DRAWTEXTEX(1,1,X4,Y1+Y2,MINZFSTR[2]),color80FF;
DRAWTEXTEX(1,1,X4,Y1+Y2*2,MINZFSTR[3]),colorFFFF;
DRAWTEXTEX(1,1,X4,Y1+Y2*3,MINZFSTR[4]),colorFF00;
DRAWTEXTEX(1,1,X4,Y1+Y2*4,MINZFSTR[5]),colorFF0000;
DRAWTEXTEX(1,1,X4,Y1+Y2*5,MINZFSTR[6]),colorFFFF00;
DRAWTEXTEX(1,1,X4,Y1+Y2*6,MINZFSTR[7]),colorFF00FF;
DRAWTEXTEX(1,1,X4,Y1+Y2*7,MINZFSTR[8]),colorFF8080;
DRAWTEXTEX(1,1,X4,Y1+Y2*8,MINZFSTR[9]),color808040;
DRAWTEXTEX(1,1,X4,Y1+Y2*9,MINZFSTR[10]),colorFFFFFF;


 


[url=http://www.goodgupiao.com/gupiaogongshi/12400.html][B]板块聚焦(源码+图)[/B][/url]