领涨板块及个股排序[其他软件公式]
相关标签:
涨幅引用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;
领涨板块及个股排序
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;
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;
DRAWTEXT(BARPOS=SYSPARAM(2),h,HST+COL2
+\n+*********************************************************************************************************************************),COLORFFFF00,ALIGN4;
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];
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)
+]
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容