请 [注册] 或 [登录]  | 返回主站

量化交易吧 /  量化平台 帖子:3364707 新帖:28

实时统计 股息率-净利增长率-市值 排名

螺罗丝发表于:5 月 9 日 23:49回复(1)

股息率的计算排除了 送股 配股的股票 。 包括了上一年的中期分红。抽查了几个数据,有几条数据业绩同比 是不正确的。。。。

from jqdata import finance
import pandas as pd
import datetime
#auth('***','**')
pd.options.display.max_rows = 4000
pd.options.display.max_columns = 50
pd.options.display.width = 1000


date_now = datetime.datetime.now()
current_year = datetime.datetime.now().year
oneDay = datetime.timedelta(days=1)
yesterday = (date_now - oneDay).strftime("%Y-%m-%d")
today_date = date_now.strftime("%Y-%m-%d")
security_list = get_index_stocks('000985.XSHG')

year = '2017-12-31'

q =  query(finance.STK_XR_XD.code,
    finance.STK_XR_XD.report_date,
    finance.STK_XR_XD.bonus_type,
    finance.STK_XR_XD.bonus_ratio_rmb/10  ,
    finance.STK_XR_XD.company_name,
          ).filter(
            finance.STK_XR_XD.report_date >= year,
            finance.STK_XR_XD.bonus_ratio_rmb >0,
            finance.STK_XR_XD.dividend_ratio == None,
            finance.STK_XR_XD.transfer_ratio  == None
        )
df = finance.run_query(q)

df = df.groupby('code')["anon_1"].sum().to_frame()

pd_price = get_price(security_list,  end_date=today_date, frequency='1d', fields=['close'],fq='pre', count=1)['close']

df_price = pd_price.T

stocks = get_all_securities(types=['stock'], date=None)['display_name']

df_funds = get_fundamentals(query(
                        indicator.code,                     
                        indicator.inc_net_profit_year_on_year,
                        valuation.market_cap
                             ).filter(
                            valuation.code.in_(security_list)),
                    date= today_date)

df_funds.index = df_funds.code

pd_all = pd.concat([df , df_price, stocks , df_funds], axis=1)
pd_all.columns = ['每股分红', '当前价', '股票名','代码','最新利润同比增长率','最新市值']

pd_all['当前股息率'] = pd_all['每股分红']/pd_all['当前价']

pd_all = pd_all[ (pd_all['当前股息率'] >0.05) & (pd_all['最新利润同比增长率'] >5)].sort_values(by='当前股息率', ascending=False);
pd_all
.dataframe thead tr:only-child th { text-align: right; } .dataframe thead th { text-align: left; } .dataframe tbody tr th { vertical-align: top; }
每股分红 当前价 股票名 代码 最新利润同比增长率 最新市值 当前股息率
600507.XSHG 1.60000 10.72 方大特钢 600507.XSHG 19.9300 154.5563 0.149254
600028.XSHG 0.56000 5.31 中国石化 600028.XSHG 43.1900 6415.7031 0.105461
603355.XSHG 2.19000 22.76 莱克电气 603355.XSHG 170.7300 90.6661 0.096221
000036.XSHE 0.50000 5.67 华联控股 000036.XSHE 867.9400 64.6082 0.088183
603328.XSHG 0.86000 9.86 依顿电子 603328.XSHG 32.9800 99.7778 0.087221
002756.XSHE 1.00000 12.30 永兴特钢 002756.XSHE 13.4900 44.2800 0.081301
300403.XSHE 0.41500 5.13 汉宇集团 300403.XSHE 69.6600 30.6324 0.080897
600738.XSHG 0.50000 6.21 兰州民百 600738.XSHG 4056.5901 50.6663 0.080515
600873.XSHG 0.33000 4.20 梅花生物 600873.XSHG 233.5700 132.4083 0.078571
601636.XSHG 0.30000 3.90 旗滨集团 601636.XSHG 5.0500 104.8460 0.076923
601003.XSHG 0.50000 6.70 柳钢股份 601003.XSHG 41.2100 172.2197 0.074627
300041.XSHE 0.50000 6.75 回天新材 300041.XSHE 5.6700 28.7356 0.074074
600828.XSHG 0.35000 4.77 茂业商业 600828.XSHG 7.7600 82.4424 0.073375
002394.XSHE 0.75000 10.34 联发股份 002394.XSHE 47.4200 33.5353 0.072534
600162.XSHG 0.16000 2.25 香江控股 600162.XSHG 528.6500 75.8050 0.071111
002233.XSHE 0.72000 10.24 塔牌集团 002233.XSHE 99.3900 122.0890 0.070312
600395.XSHG 0.35000 5.02 盘江股份 600395.XSHG 8.8300 83.0836 0.069721
002713.XSHE 1.10000 16.21 东易日盛 002713.XSHE 41.8100 43.1034 0.067859
600641.XSHG 0.63300 9.43 万业企业 600641.XSHG 91.2500 75.8595 0.067126
600019.XSHG 0.45000 6.73 宝钢股份 600019.XSHG 8.6500 1487.4967 0.066865
600808.XSHG 0.21500 3.50 马钢股份 600808.XSHG 78.7700 260.2639 0.061429
000429.XSHE 0.50600 8.31 粤高速A 000429.XSHE 14.5100 164.8127 0.060890
002083.XSHE 0.30000 5.11 孚日股份 002083.XSHE 65.9600 46.2172 0.058708
002674.XSHE 0.50000 8.56 兴业科技 002674.XSHE 106.1300 25.8280 0.058411
601006.XSHG 0.47000 8.05 大秦铁路 601006.XSHG 9.9800 1192.3167 0.058385
000723.XSHE 0.20000 3.44 美锦能源 000723.XSHE 72.7300 134.6060 0.058140
603600.XSHG 0.43000 7.50 永艺股份 603600.XSHG 8.3700 22.2173 0.057333
002406.XSHE 0.32000 5.60 远东传动 002406.XSHE 57.3300 31.3599 0.057143
002088.XSHE 0.50000 8.75 鲁阳节能 002088.XSHE 5.8200 31.6351 0.057143
000157.XSHE 0.20000 3.59 中联重科 000157.XSHE 184.5200 267.6653 0.055710
601225.XSHG 0.41800 7.61 陕西煤业 601225.XSHG 10.2600 763.0000 0.054928
600177.XSHG 0.40000 7.30 雅戈尔 600177.XSHG 35.5400 260.3712 0.054795
600383.XSHG 0.53000 9.98 金地集团 600383.XSHG 206.7900 448.7496 0.053106
002146.XSHE 0.42000 7.97 荣盛发展 002146.XSHE 23.9600 346.1138 0.052698
601009.XSHG 0.34500 6.55 南京银行 601009.XSHG 11.3800 554.7364 0.052672
000726.XSHE 0.50000 9.54 鲁泰A 000726.XSHE 17.8900 83.1719 0.052411
601158.XSHG 0.30000 5.73 重庆水务 601158.XSHG 25.7500 275.0400 0.052356
000863.XSHE 0.20153 3.91 三湘印象 000863.XSHE 252.7700 53.8910 0.051542
600660.XSHG 1.15000 22.48 福耀玻璃 600660.XSHG 82.9900 560.5314 0.051157
601288.XSHG 0.17830 3.50 农业银行 601288.XSHG 8.4600 12135.6816 0.050943
601567.XSHG 0.30000 5.90 三星医疗 601567.XSHG 9.5700 83.2365 0.050847
002068.XSHE 0.30000 5.94 黑猫股份 002068.XSHE 23.0900 43.4057 0.050505
002206.XSHE 0.20000 3.99 海利得 002206.XSHE 21.2700 49.7773 0.050125
 
 
 

全部回复

0/140

量化课程

    移动端课程