Skip to content

按照封单跟流通股本比例排序,剔除6月上市新股,前50

来源:https://uqer.io/community/share/559e5315f9f06c6dd1e17ed6

import pandas as pd

today = Date.todaysDate()
cal = Calendar('China.SSE')
yesterday = cal.advanceDate(today, '-1B',  BizDayConvention.Following).strftime('%Y%m%d')
allSecList = DataAPI.EquGet(equTypeCD = 'A', field = ['secID'])['secID'].tolist()
precls = {}
uplimit, dnlimit = [], []


for i in range(0, len(allSecList), 200):
    sub = allSecList[i:min(len(allSecList), i+200)]
    df_precls = DataAPI.MktEqudGet(secID = sub, beginDate = yesterday, endDate = yesterday, field = 'secID,closePrice')
    df_lasprx = DataAPI.MktTickRTSnapshotGet(securityID = sub, field = 'shortNM,lastPrice,bidBook,askBook')
    for j in range(len(df_precls)):
        precls[df_precls.at[j,'secID']] = df_precls.at[j,'closePrice']
    for j in range(len(df_lasprx)):
        if df_lasprx.at[j,'lastPrice'] > 0:
            sec = df_lasprx.at[j,'ticker']+'.'+df_lasprx.at[j,'exchangeCD']
            if df_lasprx.at[j,'bidBook_volume1'] == 0 and df_lasprx.at[j,'askBook_volume1'] > 0:
                bang = df_lasprx.at[j,'askBook_volume1'] * df_lasprx.at[j,'askBook_price1']
                dnlimit.append([df_lasprx.at[j,'shortNM'], sec, precls[sec], df_lasprx.at[j,'lastPrice'],df_lasprx.at[j,'askBook_volume1'], bang/10000])
            if df_lasprx.at[j,'askBook_volume1'] == 0 and df_lasprx.at[j,'bidBook_volume1'] > 0:
                bang = df_lasprx.at[j,'bidBook_volume1'] * df_lasprx.at[j,'bidBook_price1']
                uplimit.append([df_lasprx.at[j,'shortNM'], sec, precls[sec], df_lasprx.at[j,'lastPrice'],df_lasprx.at[j,'bidBook_volume1'], bang/10000])
name, sec, precls, latprx, bangvol, bang = zip(*uplimit)
df_uplimit = pd.DataFrame({'简称': name, '代码': sec, '前收': precls, '最新价': latprx,'封单量': bangvol, '封单金额(万)': bang}).sort(columns='封单金额(万)').reset_index()
df_uplimit = df_uplimit.loc[:, ['简称', '代码','前收','最新价','封单量','封单金额(万)']]
print '涨停股票数量:', len(uplimit) , '个, 收盘封单总金额:', df_uplimit.sum()['封单金额(万)']/10000 , '亿'
df_uplimit

涨停股票数量: 1280 个, 收盘封单总金额: 644.57280353 亿
简称 代码 前收 最新价 封单量 封单金额(万)
0 科达股份 600986.XSHG 24.86 27.35 8095 22.139825
1 *ST夏利 000927.XSHE 7.11 7.47 61912 46.248264
2 宝诚股份 600892.XSHG 35.60 39.16 14200 55.607200
3 *ST古汉 000590.XSHE 17.97 18.87 35228 66.475236
4 永艺股份 603600.XSHG 96.55 106.21 7500 79.657500
5 法拉电子 600563.XSHG 27.52 30.27 27485 83.197095
6 天润乳业 600419.XSHG 37.46 41.21 30361 125.117681
7 光大证券 601788.XSHG 20.09 22.09 65049 143.758290
8 S佳通 600182.XSHG 19.59 20.57 80503 165.594671
9 *ST华锦 000059.XSHE 7.57 7.95 220596 175.373820
10 鄂尔多斯 600295.XSHG 8.40 9.24 248700 229.798800
11 富煌钢构 002743.XSHE 24.32 26.75 91387 244.460225
12 良信电器 002706.XSHE 52.81 58.09 47519 276.037871
13 洋河股份 002304.XSHE 64.26 70.69 41128 290.733832
14 *ST水井 600779.XSHG 9.76 10.25 284700 291.817500
15 滨海能源 000695.XSHE 14.06 15.47 189000 292.383000
16 中钢国际 000928.XSHE 18.03 19.83 167224 331.605192
17 金地集团 600383.XSHG 12.64 13.90 273600 380.304000
18 百花村 600721.XSHG 10.21 11.23 361831 406.336213
19 XD吉林森 600189.XSHG 9.85 10.73 392689 421.355297
20 兖州煤业 600188.XSHG 9.74 10.71 422093 452.061603
21 时代万恒 600241.XSHG 11.14 12.25 381174 466.938150
22 银座股份 600858.XSHG 9.19 10.11 480700 485.987700
23 金山开发 600679.XSHG 11.39 12.53 393526 493.088078
24 远程电缆 002692.XSHE 16.67 18.34 271064 497.131376
25 苏 泊 尔 002032.XSHE 21.88 24.07 206600 497.286200
26 万向德农 600371.XSHG 15.93 17.52 292926 513.206352
27 洛阳玻璃 600876.XSHG 10.60 11.66 448678 523.158548
28 东方证券 600958.XSHG 23.18 25.50 205700 524.535000
29 东兴证券 601198.XSHG 20.52 22.57 236032 532.724224
... ... ... ... ... ... ...
1250 金龙汽车 600686.XSHG 14.42 15.86 15154357 24034.810202
1251 浩物股份 000757.XSHE 7.43 8.17 30249462 24713.810454
1252 湖北能源 000883.XSHE 5.03 5.53 45428493 25121.956629
1253 上海莱士 002252.XSHE 70.82 77.90 3266870 25448.917300
1254 保利地产 600048.XSHG 9.38 10.32 24812739 25606.746648
1255 贵州百灵 002424.XSHE 46.51 51.16 5007138 25616.518008
1256 掌趣科技 300315.XSHE 9.70 10.67 25399058 27100.794886
1257 万向钱潮 000559.XSHE 11.65 12.82 21612652 27707.419864
1258 东软集团 600718.XSHG 12.09 13.30 21087016 28045.731280
1259 时代新材 600458.XSHG 16.97 18.67 15189697 28359.164299
1260 东方财富 300059.XSHE 45.99 50.59 5819640 29441.558760
1261 紫光股份 000938.XSHE 56.69 62.25 4756189 29607.276525
1262 泛海控股 000046.XSHE 11.00 12.10 24553068 29709.212280
1263 隆平高科 000998.XSHE 18.15 19.97 15137564 30229.715308
1264 五 粮 液 000858.XSHE 21.92 24.11 12672663 30553.790493
1265 洛阳钼业 603993.XSHG 10.21 11.23 28763738 32301.677774
1266 川投能源 600674.XSHG 8.91 9.80 34759105 34063.922900
1267 大族激光 002008.XSHE 20.09 22.10 16645752 36787.111920
1268 机器人 300024.XSHE 78.20 86.02 4285905 36867.354810
1269 上海电气 601727.XSHG 10.34 11.37 33204217 37753.194729
1270 大唐电信 600198.XSHG 19.88 21.87 17856149 39051.397863
1271 招商证券 600999.XSHG 22.07 24.28 17547853 42606.187084
1272 新 大 陆 000997.XSHE 17.52 19.27 22280471 42934.467617
1273 同方股份 600100.XSHG 11.48 12.63 37915652 47887.468476
1274 中航动力 600893.XSHG 28.34 31.17 17871582 55705.721094
1275 国泰君安 601211.XSHG 25.88 28.47 19942615 56776.624905
1276 中国重工 601989.XSHG 8.53 9.38 67338975 63163.958550
1277 格力电器 000651.XSHE 19.64 21.60 30817884 66566.629440
1278 中国核电 601985.XSHG 8.20 9.02 76664230 69151.135460
1279 兴业银行 601166.XSHG 15.53 17.08 45921158 78433.337864
1280 rows × 6 columns
nfList = DataAPI.EquGet(equTypeCD = 'A', field = ['secID','nonrestfloatA','listDate'])
nf = {}
nl = {}
for j in range(len(nfList)):
    nf[nfList.at[j,'secID']] = nfList.at[j,'nonrestfloatA']
    nl[nfList.at[j,'secID']] = nfList.at[j,'listDate']
name, sec, precls, latprx, bangvol, bang = zip(*uplimit)
nflist = []
nllist = []
nfrate = []
for j in range(len(sec)):
   nflist.append(nf[sec[j]])
   nllist.append(nl[sec[j]])
   if nf[sec[j]] > 0:
       nfrate.append(bangvol[j]*1000/nf[sec[j]])
   else:
       nfrate.append(0)

print "按照封单跟流通股本比例排序,剔除6月上市新股,前50"
df_uplimit1 = pd.DataFrame({'简称': name, '代码': sec, '前收': precls, '最新价': latprx,'封单量': bangvol, '封单金额(万)': bang, '总流通股本': tuple(nflist), '封单总股本比(‰)': tuple(nfrate),'listDate': tuple(nllist)}).sort(columns='封单总股本比(‰)',ascending=False).reset_index()
df_uplimit1 = df_uplimit1.loc[:, ['简称', '代码','前收','最新价','封单量','封单金额(万)','总流通股本','封单总股本比(‰)','listDate']]
df_uplimit1[df_uplimit1.listDate < '2015-06'][:50]

按照封单跟流通股本比例排序,剔除6月上市新股,前50
简称 代码 前收 最新价 封单量 封单金额(万) 总流通股本 封单总股本比(‰) listDate
4 山河药辅 300452.XSHE 46.62 51.28 1231062 6312.885936 11600000 106 2015-05-15
5 浩物股份 000757.XSHE 7.43 8.17 30249462 24713.810454 312802683 96 1997-06-27
7 康斯特 300445.XSHE 58.53 64.38 899439 5790.588282 10200000 88 2015-04-24
14 三变科技 002112.XSHE 9.63 10.59 13039855 13809.206445 180956458 72 2007-02-08
17 石大胜华 603026.XSHG 15.09 16.60 3422222 5680.888520 50680000 67 2015-05-29
18 三毛派神 000779.XSHE 9.93 10.92 12593170 13751.741640 186441020 67 1997-05-28
22 威帝股份 603023.XSHG 31.06 34.17 1292499 4416.469083 20000000 64 2015-05-27
23 普丽盛 300442.XSHE 40.09 44.10 1587575 7001.205750 25000000 63 2015-04-24
27 立霸股份 603519.XSHG 45.17 49.69 1217375 6049.136375 20000000 60 2015-03-19
33 道氏技术 300409.XSHE 39.34 43.27 1348689 5835.777303 24375000 55 2014-12-03
35 金石东方 300434.XSHE 35.04 38.54 913700 3521.399800 17000000 53 2015-04-24
37 苏试试验 300416.XSHE 45.27 49.80 831929 4143.006420 15700000 52 2015-01-22
38 南华仪器 300417.XSHE 48.16 52.98 531826 2817.614148 10200000 52 2015-01-23
39 美尔雅 600107.XSHG 7.82 8.60 18644466 16034.240760 360000000 51 1997-11-06
40 海联讯 300277.XSHE 15.25 16.78 2678747 4494.937466 52903291 50 2011-11-23
41 华铁科技 603300.XSHG 16.81 18.49 2535770 4688.638730 50670000 50 2015-05-29
42 先导股份 300450.XSHE 84.45 92.90 835200 7759.008000 17000000 49 2015-05-18
45 亚星客车 600213.XSHG 7.13 7.84 10399809 8153.450256 220000000 47 1999-08-31
47 鲍斯股份 300441.XSHE 31.55 34.71 972250 3374.679750 21120000 46 2015-04-23
49 盛洋科技 603703.XSHG 30.03 33.03 1037229 3425.967387 23000000 45 2015-04-23
50 中光防雷 300414.XSHE 50.46 55.51 910413 5053.702563 21070000 43 2015-05-13
51 清水源 300437.XSHE 47.30 52.03 727611 3785.760033 16700000 43 2015-04-23
52 博通股份 600455.XSHG 26.21 28.83 2131135 6144.062205 49717768 42 2004-03-29
53 川仪股份 603100.XSHG 13.04 14.34 4233692 6071.114328 100000000 42 2014-08-05
54 永东股份 002753.XSHE 26.64 29.30 1018901 2985.379930 24700000 41 2015-05-19
55 华天酒店 000428.XSHE 5.95 6.55 29409137 19262.984735 718762425 40 1996-08-08
60 惠天热电 000692.XSHE 5.23 5.75 20215598 11623.968850 532788880 37 1997-02-27
61 全信股份 300447.XSHE 50.22 55.24 767600 4240.222400 20250000 37 2015-04-22
62 康跃科技 300391.XSHE 14.69 16.16 1497500 2419.960000 41675000 35 2014-08-01
63 莫高股份 600543.XSHG 8.19 9.01 11235969 10123.608069 321120000 34 2004-03-24
64 宝色股份 300402.XSHE 12.61 13.87 1762286 2444.290682 51000000 34 2014-10-10
65 金龙汽车 600686.XSHG 14.42 15.86 15154357 24034.810202 442597097 34 1993-11-08
66 大唐电信 600198.XSHG 19.88 21.87 17856149 39051.397863 532989392 33 1998-10-21
67 山东华鹏 603021.XSHG 26.64 29.30 882565 2585.915450 26400000 33 2015-04-23
68 高能环境 603588.XSHG 42.31 46.54 1296851 6035.544554 40400000 32 2014-12-29
69 三鑫医疗 300453.XSHE 35.23 38.75 649389 2516.382375 19860000 32 2015-05-15
70 中来股份 300393.XSHE 40.45 44.50 759245 3378.640250 23490000 32 2014-09-12
71 仙坛股份 002746.XSHE 15.21 16.73 1310986 2193.279578 39850000 32 2015-02-16
73 济民制药 603222.XSHG 17.89 19.68 1302174 2562.678432 40000000 32 2015-02-17
74 兰州黄河 000929.XSHE 14.69 16.16 6088560 9839.112960 185588036 32 1999-06-23
75 迅游科技 300467.XSHE 176.12 193.73 328574 6365.464102 10000000 32 2015-05-27
76 北京城乡 600861.XSHG 10.22 11.24 10072835 11321.866540 316804949 31 1994-05-20
77 中泰股份 300435.XSHE 34.94 38.43 621982 2390.276826 20000000 31 2015-03-26
78 轴研科技 002046.XSHE 7.85 8.64 10496924 9069.342336 340565970 30 2005-05-26
79 四通新材 300428.XSHE 34.41 37.85 609600 2307.336000 20200000 30 2015-03-19
80 田中精机 300461.XSHE 29.96 32.96 510040 1681.091840 16680000 30 2015-05-19
81 运达科技 300440.XSHE 42.54 46.79 847050 3963.346950 28000000 30 2015-04-23
83 迈克生物 300463.XSHE 57.51 63.26 1140788 7216.624888 37500000 30 2015-05-28
84 华通医药 002758.XSHE 38.64 42.50 429400 1824.950000 14000000 30 2015-05-27
86 鼎泰新材 002352.XSHE 27.66 30.43 1520600 4627.185800 49194459 30 2010-02-05


回到顶部