# 一致预期数据
可获取期一致预期数据,包含个股一致预期和盈利预测数据
# get_consensus_comp_indicators - 获取个股一致预期数据
get_consensus_comp_indicators(order_book_ids,start_date,end_date,fields=None)
指定查询年份,查询该年的个股一致预期数据,包含了个股一致预期的评级系数、目标价、财务数据等
# 参数
参数 | 类型 | 说明 |
---|---|---|
order_book_ids | str or str list | 合约代码,可传入 order_book_id, order_book_id list,必填 |
start_date | datetime.date or str | 传入日期,默认为当天 |
end_date | datetime.date or str | 传入日期,默认为当天 |
fields | str or str list | 字段名称,默认返回全部字段 |
# 返回
pandas DataFrame
返回 | 类型 | 说明 |
---|---|---|
order_book_ids | str | 合约代码 |
date | datetime.date | 发布日期,每个交易日都会有数据 |
report_year_t | str | 最近年报的年度 |
rice_create_tm | datetime | 米筐入库时间 |
create_tm | datetime | 数据商入库时间 |
fields | list | 字段中的 t 代表最近一期年报 字段详情见表 1 |
# 范例
- 获取一个股票在 2021-03-01~2021-04-01 的数据
[In]
rqdatac.get_consensus_comp_indicators('600000.XSHG','2021-03-01','2021-04-01',fields=['comp_con_eps_t1','comp_con_eps_ftm','ty_eps_t2'])
[Out]
report_year_t comp_con_eps_t1 comp_con_eps_ftm ty_eps_t2
order_book_id date
600000.XSHG 2021-03-01 2019 1.9871 2.1152 2.0649
2021-03-02 2019 1.9871 2.1152 2.0648
2021-03-03 2019 1.9871 2.1152 2.0648
2021-03-04 2019 1.9871 2.1152 2.0648
2021-03-05 2019 1.9871 2.1152 2.0648
2021-03-08 2019 1.9871 2.1152 2.0648
2021-03-09 2019 1.9871 2.1152 2.0647
2021-03-10 2019 1.9871 2.1152 2.0647
2021-03-11 2019 1.9871 2.1152 2.0647
2021-03-12 2019 1.9871 2.1152 2.0647
2021-03-15 2019 1.9871 2.1152 2.0634
2021-03-16 2019 1.9871 2.1152 2.0634
2021-03-17 2019 1.9871 2.1152 2.0633
2021-03-18 2019 1.9871 2.1152 2.0623
2021-03-19 2019 1.9871 2.1143 2.0632
2021-03-22 2019 1.9871 2.1229 2.0655
2021-03-23 2019 1.9871 2.1229 2.0654
2021-03-24 2019 1.9871 2.1229 2.0793
2021-03-25 2019 1.9871 2.1229 2.0794
2021-03-26 2019 1.9871 2.1229 2.0793
2021-03-29 2020 2.1021 2.1598 2.3390
2021-03-30 2020 2.1107 2.1660 2.3380
2021-03-31 2020 2.1095 2.1660 2.3430
2021-04-01 2020 2.1114 2.1882 2.3430
# get_consensus_indicator - 获取个股盈利预测综合指标
rqdatac.get_consensus_indicator(order_book_ids, fiscal_year,fields)
指定查询年份,查询该年的个股盈利预测综合指标
# 参数
参数 | 类型 | 说明 |
---|---|---|
order_book_ids | str or str list | 合约代码,可传入 order_book_id, order_book_id list |
fields | str or str list | 字段名称,默认返回全部字段 |
fiscal_year | str | 查询年份 |
# 返回
pandas DataFrame
返回 | 类型 | 说明 |
---|---|---|
order_book_ids | list | 合约代码 |
date | str, datetime.date, datetime.datetime, pandasTimestamp | 发布日期 |
institute | str | 研究机构名称(注 1) |
fiscal_year | str | 查询年份 |
rice_create_tm | datetime | 米筐入库时间 |
create_tm | datetime | 数据商入库时间(研报入库时间) |
fields | list | 字段中的 t 代表最近一期年报+1 字段详情见表 2 |
# 范例
- 获取一个股票在 2021 预测净利润(T+1 年)数据
[In]
rqdatac.get_consensus_indicator(order_book_ids='000002.XSHE', fiscal_year='2021',fields='net_profit_t1')
[Out]
institute fiscal_year net_profit_t1
order_book_id date
000002.XSHE 2021-03-31 光大证券 2021 5.249000e+10
2021-03-31 海通证券 2021 5.355775e+10
2021-03-31 西南证券 2021 5.339090e+10
2021-03-31 申万宏源 2021 4.949800e+10
... ... ... ...
2022-03-27 广发证券 2021 3.150479e+10
2022-03-27 华泰证券 2021 3.952630e+10
2022-03-30 平安证券 2021 3.801500e+10
2022-03-30 国金证券 2021 2.318200e+10
797 rows × 3 columns
# get_consensus_price - 获取个股预测股价数据
rqdatac.get_consensus_price(order_book_ids,start_date,end_date,fields,adjust_type)
指定个股预测股价数据,包含预测价格、评级系数等数据
# 参数
参数 | 类型 | 说明 |
---|---|---|
order_book_ids | str or str list | 合约代码,可传入 order_book_id, order_book_id list |
start_date | str, datetime.date, datetime.datetime, pandasTimestamp | 开始日期 (start_date,end_date 不传时,返回最近三个月的数据) |
end_date | str, datetime.date, datetime.datetime, pandasTimestamp | 结束日期 |
fields | str or str list | 字段名称,默认返回全部字段 |
adjust_type | str | 复权方式,默认为'none' ,不复权 - 'none',前复权 - 'pre',后复权 - 'post' |
# 返回
pandas DataFrame
返回 | 类型 | 说明 |
---|---|---|
order_book_ids | list | 合约代码 |
date | str, datetime.date, datetime.datetime, pandasTimestamp | 发布日期 |
institute | str | 研究机构名称 |
rice_create_tm | datetime | 米筐入库时间 |
create_tm | datetime | 数据商入库时间 |
fields | str | 字段中的 t 代表研报发布日期那个时间 部分需要返回的价格字段,字段详情见表 3 |
# 范例
- 获取一个股票在 2022-01-01~2022-02-01 的股价预测数据预测净利润(T+1 年)数据
[In]
rqdatac.get_consensus_price(order_book_ids='000001.XSHE',start_date='20220101',end_date='20220201')
[Out]
institute half_year_target_price one_year_target_price quarter_recommendation half_year_recommendation one_year_recommendation
order_book_id date
000001.XSHE 2022-01-02 东北证券 NaN NaN 1.0 NaN NaN
2022-01-03 浙商证券 33.03 NaN 1.0 NaN NaN
2022-01-03 华泰证券 NaN NaN 1.0 NaN NaN
2022-01-04 华安证券 NaN NaN 1.0 NaN NaN
2022-01-04 广发证券 NaN NaN 1.0 NaN NaN
... ... ... ... ... ... ...
2022-01-24 国泰君安 NaN NaN 1.0 NaN NaN
2022-01-25 中泰证券 NaN NaN 2.0 NaN NaN
2022-01-25 中金公司 NaN NaN 2.0 NaN NaN
2022-01-28 广发证券 NaN NaN 1.0 NaN NaN
2022-01-30 中泰证券 NaN NaN 2.0 NaN NaN
65 rows × 6 columns
# get_consensus_industry_rating - 获取行业投资评级数据
rqdatac.get_consensus_industry_rating(industries,start_date,end_date)
查询行业评级数据,包含评级系数、评级时段、行业代码、研究机构等数据
# 参数
参数 | 类型 | 说明 |
---|---|---|
industries | str or list | 行业 code 是今日投资行业分类代码,all_consensus_industries()获取支持传入的代码 |
start_date | datetime.date | 起始日期 |
end_date | datetime.date | 结束日期 |
# 返回
pandas DataFrame
返回 | 类型 | 说明 |
---|---|---|
grade_coef | int | 评级系数 1 强力买入 2 增持 3 观望 4 减持 5 卖出 |
grade_period | str | 评级时段 1 短期(3 个月); 2 中期(6 个月); 3 长期(12 个月) |
industry_name | str | 行业代码 |
institute | str | 研究机构 |
info_date | datetime.date | 报告日期 |
rice_create_tm | datetime | 米筐入库时间 |
create_tm | datetime | 数据商入库时间 |
# 范例
- 获取酒店、度假村与豪华游轮行业一致预期数据
[In]
rqdatac.get_consensus_industry_rating(industries='25301020',start_date='2022-01-01',end_date='2022-03-01')
[Out]
industry_code grade_coef grade_period institute
industry_name info_date
酒店、度假村与豪华游轮 2022-02-18 25301020 2 1 信达证券
2022-02-25 25301020 1 1 东莞证券
2022-02-16 25301020 2 1 国泰君安
2022-01-20 25301020 2 1 信达证券
2022-01-23 25301020 2 1 财通证券
2022-02-14 25301020 2 1 民生证券
2022-01-04 25301020 2 1 东兴证券
2022-01-04 25301020 2 1 民生证券
2022-01-30 25301020 2 1 国泰君安
2022-01-16 25301020 2 1 财通证券
2022-01-24 25301020 2 1 民生证券
2022-01-29 25301020 2 1 财通证券
2022-02-27 25301020 3 1 西南证券
2022-02-27 25301020 1 1 国金证券
2022-01-07 25301020 4 1 国泰君安
2022-02-12 25301020 1 1 国金证券
- 查询今日投资行业分类数据
[In]
rqdatac.all_consensus_industries()
[Out]
industry_name
industry_code
35202010 制药
45203010 电子设备和仪器
25401030 电影与娱乐
20102010 建筑产品
55101010 电力公用事业
... ...
6010 房地产
551020 燃气公用事业
40 金融
20201060 办公服务与用品
2520 耐用消费品与服装
161 rows × 1 columns
# get_consensus_market_estimate - 获取机构预测大势数据
rqdatac.get_consensus_market_estimate(indexes, fiscal_year)
查询机构大势预测数据,包含预测高点、预测地点、预测值、研究机构等数据
# 参数
参数 | 类型 | 说明 |
---|---|---|
fiscal_year | str or str list | 查询年份,必填,目前仅支持 2017、2018、2019、2020、2021、2022 |
indexes | str or str list | 预测指数代码,默认返回全部,主要数据量都是 000001.XSHG,支持传入下列指数 000001.XSHG 399006.XSHE 000016.XSHG 399005.XHSE 399300.XSHE 000905.XSHG 000300.XSHG |
# 返回
pandas DataFrame
返回 | 类型 | 说明 |
---|---|---|
indexes | str | 预测指数合约代码 |
info_date | datetime.date | 报告日期 |
rice_create_tm | datetime | 米筐入库时间 |
create_tm | datetime | 数据商入库时间 |
fiscal_year | str | 预测年份 |
institute | str | 研究机构 |
start_date | datetime.date | 预测开始时间 |
end_date | datetime.date | 预测结束时间 |
high | numpy.float64 | 预测高点 |
low | numpy.float64 | 预测低点 |
period | str | 预测时段 |
value | str | 预测值 |
# 范例
- 获取各机构关于 000001.XSHG 在 2021 的预测数据
[In]
rqdatac.get_consensus_market_estimate(indexes='000001.XSHG', fiscal_year='2021')
[Out]
fiscal_year institute start_date end_date high low period value
order_book_id info_date
000001.XSHG 2020-10-13 2021 财信证券 2021-01-01 2021-12-31 NaN NaN 策略年度报告 中性
2020-10-16 2021 华融证券 2021-01-01 2021-12-31 NaN NaN 策略年度报告 中性
2020-10-23 2021 东北证券 2021-01-01 2021-12-31 NaN NaN 策略年度报告 中性
2020-11-01 2021 方正证券 2021-01-01 2021-12-31 NaN NaN 策略年度报告 中性
2020-11-02 2021 西南证券 2021-01-01 2021-12-31 NaN NaN 策略年度报告 中性
... ... ... ... ... ... ... ... ...
2021-12-31 2021 山西证券 2022-01-01 2022-01-31 NaN NaN 策略月度报告 中性
2021-12-31 2021 方正证券 2021-12-31 2021-12-31 NaN NaN 策略日报等 中性
2021-12-31 2021 东亚前海证券 2022-01-01 2022-01-31 NaN NaN 策略月度报告 中性
2021-12-31 2021 粤开证券 2022-01-01 2022-01-31 NaN NaN 策略月度报告 乐观
2021-12-31 2021 渤海证券 2022-01-01 2022-01-31 NaN NaN 策略月度报告 中性
5893 rows × 8 columns
# 字段说明
# 表 1. 个股一致预期字段说明
字段名 | 字段说明 |
---|---|
comp_operating_revenue_t | 营业收入(T 年) |
comp_con_operating_revenue_t1 | 一致预期营业收入(T+1 年) |
comp_con_operating_revenue_t2 | 一致预期营业收入(T+2 年) |
comp_con_operating_revenue_t3 | 一致预期营业收入(T+3 年) |
comp_con_operating_revenue_ftm | 一致预期营业收入(未来 12 个月) |
comp_net_profit_t | 净利润(T 年) |
comp_con_net_profit_t1 | 一致预期净利润(T+1 年) |
comp_con_net_profit_t2 | 一致预期净利润(T+2 年) |
comp_con_net_profit_t3 | 一致预期净利润(T+3 年) |
comp_con_net_profit_ftm | 一致预期净利润(未来 12 个月) |
comp_eps_t | 每股收益(T 年) |
comp_con_eps_t1 | 一致预期每股收益(T+1 年) |
comp_con_eps_t2 | 一致预期每股收益(T+2 年) |
comp_con_eps_t3 | 一致预期每股收益(T+3 年) |
comp_con_eps_ftm | 一致预期每股收益(未来 12 个月) |
comp_net_asset_t | 净资产(T 年) |
comp_con_net_asset_t1 | 一致预期净资产(T+1 年) |
comp_con_net_asset_t2 | 一致预期净资产(T+2 年) |
comp_con_net_asset_t3 | 一致预期净资产(T+3 年) |
comp_con_net_asset_ftm | 一致预期净资产(未来 12 个月) |
comp_cash_flow_t | 经营性活动现金净流量(T 年) |
comp_con_cash_flow_t1 | 一致预期经营性活动现金净流量(T+1 年) |
comp_con_cash_flow_t2 | 一致预期经营性活动现金净流量(T+2 年) |
comp_con_cash_flow_t3 | 一致预期经营性活动现金净流量(T+3 年) |
comp_con_cash_flow_ftm | 一致预期经营性活动现金净流量(未来 12 个月) |
comp_roe_t | 净资产收益率(T 年) |
comp_con_roe_t1 | 一致预期净资产收益率(T+1 年) |
comp_con_roe_t2 | 一致预期净资产收益率(T+2 年) |
comp_con_roe_t3 | 一致预期净资产收益率(T+3 年) |
comp_con_roe_ftm | 一致预期净资产收益率(未来 12 个月) |
comp_pe_t | 市盈率(T 年) |
comp_con_pe_t1 | 一致预期市盈率(T+1 年) |
comp_con_pe_t2 | 一致预期市盈率(T+2 年) |
comp_con_pe_t3 | 一致预期市盈率(T+3 年) |
comp_con_pe_ftm | 一致预期市盈率(未来 12 个月) |
comp_ps_t | 市销率(T 年) |
comp_con_ps_t1 | 一致预期市销率(T+1 年) |
comp_con_ps_t2 | 一致预期市销率(T+2 年) |
comp_con_ps_t3 | 一致预期市销率(T+3 年) |
comp_con_ps_ftm | 一致预期市销率(未来 12 个月) |
comp_pb_t | 市净率(T 年) |
comp_con_pb_t1 | 一致预期市净率(T+1 年) |
comp_con_pb_t2 | 一致预期市净率(T+2 年) |
comp_con_pb_t3 | 一致预期市净率(T+3 年) |
comp_con_pb_ftm | 一致预期市净率(未来 12 个月) |
comp_peg | 一致预期 PEG |
comp_operating_revenue_growth_ratio_t | 营业收入同比增长率(T 年) |
comp_con_operating_revenue_growth_ratio_t1 | 一致预期营业收入同比增长率(T+1 年) |
comp_con_operating_revenue_growth_ratio_t2 | 一致预期营业收入同比增长率(T+2 年) |
comp_con_operating_revenue_growth_ratio_t3 | 一致预期营业收入同比增长率(T+3 年) |
comp_con_operating_revenue_growth_ratio_ftm | 一致预期营业收入同比增长率(未来 12 个月) |
comp_net_profit_growth_ratio_t | 净利润同比增长率(T 年) |
comp_con_net_profit_growth_ratio_t1 | 一致预期净利润同比增长率(T+1 年) |
comp_con_net_profit_growth_ratio_t2 | 一致预期净利润同比增长率(T+2 年) |
comp_con_net_profit_growth_ratio_t3 | 一致预期净利润同比增长率(T+3 年) |
comp_con_net_profit_growth_ratio_ftm | 一致预期净利润同比增长率(未来 12 个月) |
con_grd_coef | 一致预期评级系数(6 个月) |
con_targ_price | 一致预期目标价(6 个月) |
ty_profit_t1 | 天眼预期净利润(T+1 年) |
ty_profit_t2 | 天眼预期净利润(T+2 年) |
ty_profit_t3 | 天眼预期净利润(T+3 年) |
ty_profit_ftm | 天眼预期净利润(未来 12 个月) |
ty_eps_t1 | 天眼预期每股收益(T+1 年) |
ty_eps_t2 | 天眼预期每股收益(T+2 年) |
ty_eps_t3 | 天眼预期每股收益(T+3 年) |
ty_eps_ftm | 天眼预期每股收益(未来 12 个月) |
# 表 2. 个股盈利预测综合指标说明
字段名 | 字段说明 |
---|---|
report_title | 报告标题 |
data_source | 数据来源 0-公司报告数据 1-行业报告数据 |
author | 作者姓名 |
net_profit_t | 预测净利润(T 年) |
net_profit_t1 | 预测净利润(T+1 年) |
net_profit_t2 | 预测净利润(T+2 年) |
revenue_t | 预测营业收入(T 年) |
revenue_t1 | 预测营业收入(T+1 年) |
revenue_t2 | 预测营业收入(T+2 年) |
net_asset_t | 预测净资产(T 年) |
net_asset_t1 | 预测净资产(T+1 年) |
net_asset_t2 | 预测净资产(T+2 年) |
cash_from_operating_activities_t | 预测经营性活动现金净流量(T 年) |
cash_from_operating_activities_t1 | 预测经营性活动现金净流量(T+1 年) |
cash_from_operating_activities_t2 | 预测经营性活动现金净流量(T+2 年) |
profit_from_operation_t | 预测营业利润(T 年) |
profit_from_operation_t1 | 预测营业利润(T+1 年) |
profit_from_operation_t2 | 预测营业利润(T+2 年) |
cost_of_goods_sold_t | 预测营业成本(T 年) |
cost_of_goods_sold_t1 | 预测营业成本(T+1 年) |
cost_of_goods_sold_t2 | 预测营业成本(T+2 年) |
profit_before_tax_t | 预测税前利润(T 年) |
profit_before_tax_t1 | 预测税前利润(T+1 年) |
profit_before_tax_t2 | 预测税前利润(T+2 年) |
ebit_t | 预测息税前利润(EBIT)(T 年) |
ebit_t1 | 预测息税前利润(EBIT)(T+1 年) |
ebit_t2 | 预测息税前利润(EBIT)(T+2 年) |
operating_revenue_per_share_t | 预测每股营业收入(T 年) |
operating_revenue_per_share_t1 | 预测每股营业收入(T+1 年) |
operating_revenue_per_share_t2 | 预测每股营业收入(T+2 年) |
eps_t | 预测每股收益(T 年) |
eps_t1 | 预测每股收益(T+1 年) |
eps_t2 | 预测每股收益(T+2 年) |
bps_t | 预测每股净资产(T 年) |
bps_t1 | 预测每股净资产(T+1 年) |
bps_t2 | 预测每股净资产(T+2 年) |
share_cap_chg_date | 摊薄股本变动日 |
report_main_id | 报告主要股票代码或行业代码 |
grade_coef | 评级系数 |
targ_price | 目标价位 |
ebitda_t | 预测税息折旧及摊销前利润(EBITDA)(T 年) |
ebitda_t1 | 预测税息折旧及摊销前利润(EBITDA)(T+1 年) |
ebitda_t2 | 预测税息折旧及摊销前利润(EBITDA)(T+2 年) |
profit_res_t | 预测净利润(备考)(T 年) |
profit_res_t1 | 预测净利润(备考)(T+1 年) |
profit_res_t2 | 预测净利润(备考)(T+2 年) |
operate_cash_flow_per_share_t | 预测每股经营性活动现金净流量(T 年) |
operate_cash_flow_per_share_t1 | 预测每股经营性活动现金净流量(T+1 年) |
operate_cash_flow_per_share_t2 | 预测每股经营性活动现金净流量(T+2 年) |
profit_chg_t | 盈利预测变动(T 年) |
profit_chg_t1 | 盈利预测变动(T+1 年) |
profit_chg_t2 | 盈利预测变动(T+2 年) |
grade_chg_t | 投资评级变动(T 年) |
grade_chg_t1 | 投资评级变动(T+1 年) |
grade_chg_t2 | 投资评级变动(T+2 年) |
targ_price_chg_t | 目标价变动(T 年) |
targ_price_chg_t1 | 目标价变动(T+1 年) |
targ_price_chg_t2 | 目标价变动(T+2 年) |
chg_reason_t | 变动原因(T 年) |
chg_reason_t1 | 变动原因(T+1 年) |
chg_reason_t2 | 变动原因(T+2 年) |
# 表 3. 个股一致预期股价预测字段说明
字段名 | 字段说明 |
---|---|
half_year_target_price | 预测价格(T+0.5 年) |
one_year_target_price | 预测价格(T+1 年) |
quarter_recommendation | 评级系数(T+0.25 年) |
half_year_recommendation | 评级系数(T+0.5 年) |
one_year_recommendation | 评级系数 ( T+1 年) |
price_raw | 目标价位(原始值) |
price_prd | 价位时段 M06 6个月,Y01 1年 |
grd_coef | 评级系数 强力买入1.00、 买入2.00 、 观望3.00、适度减持4.00、卖出5.00 |
grd_prd | 评级时段 1 短期(3个月);2 中期(6个月);3 长期(12个月) |