今天我们学习获取财务报表。这个在量化中非常有用,因为有些策略是要分析基本面的,而读取财务报表是重要的基本面分析手段。在QMT中,读取财务报表分两步完成:一、下载财务报表;二、获取财务报表。举例如下:
from xtquant.xtdata import *
#我们要获取的是股票002049的利润表
download_financial_data(['002049.SZ'], table_list=['Income'])
#获取2023年各季度的利润表
get_financial_data(['002049.SZ'], table_list=['Income'], start_time='20230101', end_time='20231121', report_type='report_time')['002049.SZ']['Income']
结果如下:
m_timetag |
m_anntime |
revenue_inc |
earned_premium |
real_estate_sales_income |
total_operating_cost |
real_estate_sales_cost |
research_expenses |
surrender_value |
net_payments |
… |
net_inc_other_ops |
plus_net_gain_chg_fv |
plus_net_inc_other_bus |
oper_exp |
tot_compreh_inc |
tot_compreh_inc_min_shrhldr |
tot_compreh_inc_parent_comp |
actual_ann_dt |
operating_revenue |
cost_of_goods_sold |
|
0 |
20230331 |
20230425 |
1.540705e+09 |
NaN |
NaN |
9.840010e+08 |
NaN |
3.087735e+08 |
NaN |
NaN |
… |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
1 |
20230630 |
20230824 |
3.734540e+09 |
NaN |
NaN |
2.304427e+09 |
NaN |
6.733349e+08 |
NaN |
NaN |
… |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
2 |
20230930 |
20231028 |
5.642442e+09 |
NaN |
NaN |
3.558030e+09 |
NaN |
1.044664e+09 |
NaN |
NaN |
… |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
0.0 |
3 rows × 84 columns
返回了股票002049第一、二、三季度的利润表。
发布者:股市刺客,转载请注明出处:https://www.95sca.cn/archives/75059
站内所有文章皆来自网络转载或读者投稿,请勿用于商业用途。如有侵权、不妥之处,请联系站长并出示版权证明以便删除。敬请谅解!