领涨板块及个股排序-飞狐精品[其他软件公式]
相关标签: 领涨板块及个股排序 、 飞狐个股监测指标 、 飞狐交易师板块指数 、 飞狐最新板块文件下载 、 通达信板块转入飞狐 、 飞狐2012板块文件下载 、 飞狐板块及成份股 、 飞狐板块指标 、 飞狐快速建立板块指数 、
领涨板块及个股排序
领涨板块及个股排序---飞狐副图,引用网友bajatje(懒汉)及网友1949提供的指标,谢谢懒汉及1949网友
1.板块指数需盘中浏览、刷新之后,显示的结果才是正确的。
2.指标公式运行错误,最根本的原因可能是找不到板块名称、板块指数或自选股数量少于9个。
{先单独建立上面指标名为"涨幅引用xx"的指标,再建下列指标}
{//涨幅引用xx
HH:HIGH;LL:LOW;CC:CLOSE;
A0:DYNAINFO(14)*100;
DD:DATE;
ZDF:(CC/ref(CC,1)-1)*100;
HSH:VOL/IF(CAPITAL>0,CAPITAL,SUM(VOL,120))*100;
//}
///////////////////////////////////////////////////////////
{领涨板块及个股排序---飞狐副图,引用网友bajatje(懒汉)及网友1949提供的指标,谢谢懒汉及1949网友}
//////////////////////////////////////////////////////////
INPUT:X(1,1,3);
RQ:=DATE;//取日期
A:=BLKNAME;
HY:=IF(STRFIND(A,',',1)>0,STRLEFT(A,STRFIND(A,',',1)-1),A);//DRAWTEXT(BARPOS=SYSPARAM(2),2,HY);
HYs:=STKCOUNT(HY);
DYZB:=IF(X=1,'涨幅引用xx.ZDF',IF(X=2,'涨幅引用xx.HSH','涨幅引用xx.CC'));
DAS:=DATACOUNT;
D0:=RQ[DAS];//取最后日期
variable:DM[HYs]='',vcp[HYs]=0,vci[HYs]=0,TP=0;
for k=1 to HYs dobegin
DDD:=STKFROMBLK(HY,k);
DM[k]:=DDD;
TMP:=STKINDI(DDD,DYZB,0,6);
TMPD:=STKINDI(DDD,'涨幅引用xx.DD',0,6);
vcp[k]:=TMP[DAS];
vci[k]:=IF(TMPD[DAS]=D0,TMP[DAS],-1000);//去除当天停牌股
TP:=TP+IF(vci[k]=-1000,1,0);
end;
PX1:=SORTPOS(vci,1,1,HYs);
KHYS:=HYS-TP,LINETHICK;
BKXS:='当前股所属行业: '+HY+' 包含个股数:'+NUMTOSTR(HYs,0);
ZF:=IF(X=3,' 元',' %');
LBS:=IF(X=3,'收盘价',IF(X=1,'涨跌幅','换手率'));
DRAWTEXT(SYSPARAM(2)=BARPOS,h,BKXS),colorAFFF,ALIGN4;
WZ:=INTPART((SYSPARAM(3)-SYSPARAM(2))/10);
HST:=' \n\n';
kg:=' ';
//
IF KHYS<2 THEN EXIT; {本文来至程序化交易网 cxh99.com}
COL1:=HST+kg+' ①'+STKNAMEEX(DM[vci[1]])+' '+numtostr(vcp[vci[1]],2)+ZF+
' ②'+STKNAMEEX(DM[vci[2]])+' '+numtostr(vcp[vci[2]],2)+ZF+
IF(KHYS>3,' ③'+STKNAMEEX(DM[vci[3]])+' '+numtostr(vcp[vci[3]],2)+ZF,'')+
IF(KHYS>4,' ④'+STKNAMEEX(DM[vci[4]])+' '+numtostr(vcp[vci[4]],2)+ZF+' ⑤'+STKNAMEEX(DM[vci[5]])+' '+numtostr(vcp[vci[5]],2)+ZF+'\n'+kg
+' ⑥'+STKNAMEEX(DM[vci[6]])+' '+numtostr(vcp[vci[6]],2)+ZF+' ⑦'+STKNAMEEX(DM[vci[7]])+' '+numtostr(vcp[vci[7]],2)+ZF
+' ⑧'+STKNAMEEX(DM[vci[8]])+' '+numtostr(vcp[vci[8]],2)+ZF+' ⑨'+STKNAMEEX(DM[vci[9]])+' '+numtostr(vcp[vci[9]],2)+ZF
+' ⑩'+STKNAMEEX(DM[vci[10]])+' '+numtostr(vcp[vci[10]],2)+ZF,'');//领先股
COL2:=HST+HST+kg+IF(KHYS>6,' ①'+STKNAMEEX(DM[vci[KHYs]])+' '+numtostr(vcp[vci[KHYs]],2)+ZF+
' ②'+STKNAMEEX(DM[vci[KHYs-1]])+' '+numtostr(vcp[vci[KHYs-1]],2)+ZF+
' ③'+STKNAMEEX(DM[vci[KHYs-2]])+' '+numtostr(vcp[vci[KHYs-2]],2)+ZF+
' ④'+STKNAMEEX(DM[vci[KHYs-3]])+' '+numtostr(vcp[vci[KHYs-3]],2)+ZF+
' ⑤'+STKNAMEEX(DM[vci[KHYs-4]])+' '+numtostr(vcp[vci[KHYs-4]],2)+ZF+'\n'+kg+
' ⑥'+STKNAMEEX(DM[vci[KHYs-5]])+' '+numtostr(vcp[vci[KHYs-5]],2)+ZF+
' ⑦'+STKNAMEEX(DM[vci[KHYs-6]])+' '+numtostr(vcp[vci[KHYs-6]],2)+ZF+
' ⑧'+STKNAMEEX(DM[vci[KHYs-7]])+' '+numtostr(vcp[vci[KHYs-7]],2)+ZF+
' ⑨'+STKNAMEEX(DM[vci[KHYs-8]])+' '+numtostr(vcp[vci[KHYs-8]],2)+ZF+
' ⑩'+STKNAMEEX(DM[vci[KHYs-9]])+' '+numtostr(vcp[vci[KHYs-9]],2)+ZF,'');//滞后股
DRAWTEXT(BARPOS=SYSPARAM(2),h,HST+'领先股:'),COLORred,ALIGN4;
DRAWTEXT(BARPOS=SYSPARAM(2),h,COL1),Colorred,ALIGN4;
DRAWTEXT(BARPOS=SYSPARAM(2),h,HST+HST+HST+'滞后股:'),COLORFF00,ALIGN4; {本文来至CXH99.COM}
DRAWTEXT(BARPOS=SYSPARAM(2),h,HST+COL2
+'\n'+'*********************************************************************************************************************************'),COLORFFFF00,ALIGN4;
//////////////////////////////////////////////////////////////
{指定板块内个股排序,引用网友bajatje(懒汉)提供的指标,谢谢懒汉网友}
bk:='自选股'; //可任意指定版块,板块内个股数需大于9个
stkSUM:=STKCOUNT(bk);dCOUNT:=DATACOUNT;yygs4:='涨幅引用xx.A0';
variable:dmstr[stkSUM]='',var_px[stkSUM]=0,var_indi[stkSUM]=0;
for k=1 to stkSUM do
begin
dn:=stkfromblk(bk,k);
dmstr[k]:=dn;
temp1:=stkindi(dn,yygs4,0,-1);
var_px[k]:=temp1[dCOUNT];
var_indi[k]:=temp1[dCOUNT];
end;
Num1:=sortpos(var_indi,1,1,stkSUM);
dm_max1:=var_indi[1];dm_max2:=var_indi[2];dm_max3:=var_indi[3];dm_max4:=var_indi[4];
dm_max5:=var_indi[5];dm_max6:=var_indi[6];dm_max7:=var_indi[7];dm_max8:=var_indi[8]; {本文来至程序化交易网 cxh99.com}
max1:=var_px[dm_max1];max2:=var_px[dm_max2];max3:=var_px[dm_max3];
max4:=var_px[dm_max4];max5:=var_px[dm_max5];max6:=var_px[dm_max6];max7:=var_px[dm_max7];
max8:=var_px[dm_max8];
DRAWTEXT(BARPOS=SYSPARAM(2),100,hst+hst+hst+hst+hst+hst+'自选前排序%'+'['+STKNAMEEX(dmstr[dm_max1])+''+NUMTOSTR(max1,2)
+']['+STKNAMEEX(dmstr[dm_max2])+''+NUMTOSTR(max2,2)
+']['+STKNAMEEX(dmstr[dm_max3])+''+NUMTOSTR(max3,2)
+']['+STKNAMEEX(dmstr[dm_max4])+''+NUMTOSTR(max4,2)
+']['+STKNAMEEX(dmstr[dm_max5])+''+NUMTOSTR(max5,2)
+']['+STKNAMEEX(dmstr[dm_max6])+''+NUMTOSTR(max6,2)
+']['+STKNAMEEX(dmstr[dm_max7])+''+NUMTOSTR(max7,2)
+']['+STKNAMEEX(dmstr[dm_max8])+''+NUMTOSTR(max8,2)
+']'),ColorFF99ff,align4;
yygs5:='涨幅引用xx.A0';
variable:dmstr[stkSUM]='',var_px[stkSUM]=0,var_indi[stkSUM]=0;
for k=1 to stkSUM do
begin
dn:=stkfromblk(bk,k);
dmstr[k]:=dn;
temp1:=stkindi(dn,yygs5,0,-1);
var_px[k]:=temp1[dCOUNT];
var_indi[k]:=temp1[dCOUNT];
end;
Num1:=sortpos(var_indi,0,1,stkSUM);
dm_max1:=var_indi[1];dm_max2:=var_indi[2];dm_max3:=var_indi[3];dm_max4:=var_indi[4];
dm_max5:=var_indi[5];dm_max6:=var_indi[6];dm_max7:=var_indi[7];dm_max8:=var_indi[8];
max1:=var_px[dm_max1];max2:=var_px[dm_max2];max3:=var_px[dm_max3];
max4:=var_px[dm_max4];max5:=var_px[dm_max5];max6:=var_px[dm_max6];max7:=var_px[dm_max7];
max8:=var_px[dm_max8];
DRAWTEXT(BARPOS=SYSPARAM(2),h,hst+hst+hst+hst+hst+hst+hst+'自选后排序%'+'['+STKNAMEEX(dmstr[dm_max1])+''+NUMTOSTR(max1,2)
+']['+STKNAMEEX(dmstr[dm_max2])+''+NUMTOSTR(max2,2)
+']['+STKNAMEEX(dmstr[dm_max3])+''+NUMTOSTR(max3,2)
+']['+STKNAMEEX(dmstr[dm_max4])+''+NUMTOSTR(max4,2)
+']['+STKNAMEEX(dmstr[dm_max5])+''+NUMTOSTR(max5,2)
+']['+STKNAMEEX(dmstr[dm_max6])+''+NUMTOSTR(max6,2)
+']['+STKNAMEEX(dmstr[dm_max7])+''+NUMTOSTR(max7,2)
+']['+STKNAMEEX(dmstr[dm_max8])+''+NUMTOSTR(max8,2)
+']'
+'\n'+'===============================================================
=================================================================='),Colorffff,align4;
/////////////////////////////////////////////////////////////////////////
{板块指数个股前8,引用1949网友提供的指标,}
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 thens:=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;
DRAWTEXT(BARPOS=SYSPARAM(2),h,hst+hst+hst+hst+hst+hst+hst+hst+hst+ZFNAME[1]+'('+ numtostr(stkCOUNT(ZFNAME[1]),0)+ ')' + numtostr(ZFNumber[1],2) + ' %'
+'\n'+ZFNAME[2]+'('+ numtostr(stkCOUNT(ZFNAME[2]),0)+ ')' +numtostr(ZFNumber[2],2) + ' %'
+'\n'+ZFNAME[3]+'('+ numtostr(stkCOUNT(ZFNAME[3]),0)+ ')' +numtostr(ZFNumber[3],2) + ' %'
+'\n'+ZFNAME[4]+'('+ numtostr(stkCOUNT(ZFNAME[4]),0)+ ')' +numtostr(ZFNumber[4],2) + ' %'
+'\n'+ZFNAME[5]+'('+ numtostr(stkCOUNT(ZFNAME[5]),0)+ ')' + numtostr(ZFNumber[5],2) + ' %'
+'\n'+ZFNAME[6]+'('+ numtostr(stkCOUNT(ZFNAME[6]),0)+ ')' + numtostr(ZFNumber[6],2) + ' %'
+'\n'+ZFNAME[7]+'('+ numtostr(stkCOUNT(ZFNAME[7]),0)+ ')' + numtostr(ZFNumber[7],2) + ' %'
+'\n'+ZFNAME[8]+'('+ numtostr(stkCOUNT(ZFNAME[8]),0)+ ')' + numtostr(ZFNumber[8],2) + ' %'
+'\n'+ZFNAME[9]+'('+ numtostr(stkCOUNT(ZFNAME[9]),0)+ ')' + numtostr(ZFNumber[9],2) + ' %'
+'\n'+ZFNAME[10]+'('+ numtostr(stkCOUNT(ZFNAME[10]),0)+ ')' + numtostr(ZFNumber[10],2) + ' %'),color5050ff,align4;
variable:MinZFStr[10]='';
paa:=0;
WHILE Paa<10 do 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:=if(DYNAINFO2(8,ty1)>0,DYNAINFO2(14,ty1)*100,-10);
ZF[p2]:=Ty2;
end
NWY:=sortpos(ZF,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;
DRAWTEXT(BARPOS=SYSPARAM(2),h,hst+hst+hst+hst+hst+hst+hst+hst+hst+' '+MinZFStr[1]
+'\n'+' '+MinZFStr[2]
+'\n'+' '+MinZFStr[3]
+'\n'+' '+MinZFStr[4]
+'\n'+' '+MinZFStr[5]
+'\n'+' '+MinZFStr[6]
+'\n'+' '+MinZFStr[7]
+'\n'+' '+MinZFStr[8]
+'\n'+' '+MinZFStr[9]
+'\n'+' '+MinZFStr[10]),colorff00ff,align4;
如果以上指标公式不适用于您常用的行情软件
或者您想改编成选股公式,以便快速选出某种形态个股的话,
相关文章
-
没有相关内容