Wind API 学习笔记八(其它)
页面跳转
8. 指标参数的说明
关于WSD/WSS中常见指标参数的举例说明
| element|description|value|Indicator examples|demo|
| :------------- :|:-------------:| :-----:|
|tradeDate|交易日期|自填|开盘价|'tradeDate=20180618'|
|startDate|开始日期|自填|区间开盘价|'startDate=20180618'|
|endDate|截止日期|自填|区间开盘价|'endDate=20180618'|
|adjDate|复权基期|自填|收盘价(支持定点复权)|'adjDate=20180618'|
|rptDate|报告期|自填|净利润|'rptDate=20171231'|
|priceAdj|复权方式|不复权/前复权/后复权/定点复权|收盘价|'priceAdj=U'|
|cycle|周期|日/月/……|成交量|'cycle=D'|
|bondPriceType|债券价格类型|全价/净价/收益率/市价|涨跌幅(债券)|'bondPriceType=2'|
|currencyType|币种|原始币种/人民币/美元……|未平仓卖空金额|'currencyType=Cur=CNY'|
|ndays|天数(用负号表示前推)|自填|N日涨跌幅|'ndays=-5'|
|rptType|报表类型|合并报表/母公司报表……|杠杆率|'rptType=1'|
|dataType|数据类型|本外币/本币/……|贷款利息收入-短期|'dataType=2'|
|traderType|类型|机构/大户/散户……|流入单数|'traderType=1'|
|exchangeType|交易所 |上海/深圳/银行间……|跨市场代码|'exchangeType=SSE'|
|index|所属指数|上证50指数/上证180指数/沪深300指数…… |是否属于重要指数成份|'index=1'|
|unit|单位|元、股、份、张、户|总市值、注册资本、持有人持有数量、单一投资者报告期末持有份额合计、股东户数……|'unit=1'|
|industryType/category/industryStandard|行业级别/行业标准 |一级行业/二级行业……全部明细、中信行业/申万行业……| 所属行业名称(支持历史)、所属恒生行业名称 |'industryType=1','category=1','industryStandard=3'|
|adminType| 行政区划级别 |省级/地级/县级 | 所属行政区划 |'adminType=1'|
|year|年度 |2018/2017/2016……| 管理层年度薪酬总额 |'year=2017'|
|month|月份|1月/2月/……|五星基金占比|'month=2'|
|order| 大股东排名、名次 |第一名/第二名/…… | 持有人持有数量、基金经理年限 |'order=1'|
|instituteType|机构类别|基金公司/证券公司/……|配售对象名称|'instituteType=1'|
|topNum|名次|第1名/第2名……|离职日期|'topNum=1'|
|shareType| 股本类型 | 流通股本/总股本|户均持股比例| 'shareType=1|
|reportDateType|报告期 |第一季度(1-3月)/第二季度(4-6月)……| 单一投资者报告期末持有份额合计 |'reportDateType=1'|
|Type|资产池资产级别 |次级/优先级/次优级| 各级发行总额 |'reportDateType=1'|
|type|选择权类型、评级对象类型 | 赎回/回售/……、主体信用评级/不限……| 行权资金到帐日| 'type=Pr'、'type=3'|
|serial| 第N次提前偿还 |手动输入数字| 提前还本比例| 'serial=1'|
|ratingAgency|评级机构 |标普/穆迪…… |债项评级|'ratingAgency=16'|
|bondTypeIndex |债券类型 |短期融资券/中期票据/…… |历史累计注册额度|'bondTypeIndex=2'|
|bondType|债券类型|金融债/同业存单……|存量债券余额|'bondType=1'|
|termType |期限类型 |1年期内/1-3年期内…… |存量债券余额(按期限)|termType=2|
|credibility|估值类型|推荐/不推荐/行权……|日终估价全价|'credibility=2'|
|fundType|基金分类|投资类型(一级分类)/投资类型(二级分类)|同类基金数量|'fundType=1'|
|fundRatingAgency|评级机构|1/2……|四星基金占比 |'fundRatingAgency=2'|
|chargesType|收费类型|前端/后端|认购费率|'chargesType=1'|
|returnType|收益率计算方法|普通收益率/对数收益率|几何平均年化收益率|'returnType=1'|
|annualized|是否年化|是/否|近1周回报|'annualized=0'|
|netType|报告期净值数据项|过去1个月/过去3个月/……|报告期净值增长率|'netType=1'|
例16 指标参数说明案例
w.wss("510010.SH", "fund_fullname,fund_similarfundno,fund_purchasefee,fund_redemptionfee,fund_dq_status,fund_pchredm_largepchmaxamt,fund_manager_totalnetasset,fund_manager_arithmeticannualizedyield,fund_manager_totalreturnoverbenchmark,fund_corp_fivestarfundsprop,fund_corp_fourstarfundsprop,fund_corp_teamstability,issue_etfdealshareonmarket,fund_etfpr_estcash,fund_etfpr_cashratio", "fundType=1;chargesType=0;tradeDate=20180619;unit=1;order=2;returnType=1;year=2018;month=1;fundRatingAgency=2;startDate=20180520;endDate=20180620")
9.财务数据的说明
Python 如图,
万矿的财务数据都是传入报告期,然后返回相应报告期的财务数据;在参数设置中可以直接设置报表类型为合并报表/母公司报表/合并报表(调整)/母公司报表(调整)。
万矿是取每个季度最后一天作为报告期,如取2017年的四个定期报告数据,那报告期设置分别为 :一季报:2017-03-31,半年报:2017-06-30,三季报:2017-09-30,年报:2017-12-31
如果要用wsd取多个报告期的公告数据,则需要将周期设置为季,日期类型设置为日历日(因为有的季度最后一天不是交易日)
财务数据回填说明:
1、比如说某公司A在2018年3月22日公布2017年年报,那在2018年3月22以前取2017年年报数据则为空,A公司公布年报数据后,我们会将公布的数据回填到2017-12-31,用户传入相应的报告期参数即可取出对应的年报数据;
2、如果用户直接取出年报数据做回测则会引入未来数据,所以如果要用财报数据做回测要先按照定期报告披露日期拉平至时间序列再做回测。
下面举例说明如何获取各个报告期的财务数据。
17 用wsd函数取000001.SZ[平安银行]近十年的利润表(合并报表)数据
error_code,finance_data=w.wsd("000001.SZ","tot_oper_rev,oper_rev,int_inc,insur_prem_unearned,handling_chrg_comm_inc,tot_prem_inc,reinsur_inc,prem_ceded,unearned_prem_rsrv_withdraw,net_inc_agencybusiness,net_inc_underwriting-business,net_inc_customerasset-managementbusiness,other_oper_inc,net_int_inc,net_fee_and_commission_inc,net_other_oper_inc,tot_oper_cost,oper_cost,int_exp,handling_chrg_comm_exp,oper_exp,taxes_surcharges_ops,selling_dist_exp,gerl_admin_exp,fin_exp_is,impair_loss_assets,prepay_surr,net_claim_exp,net_insur_cont_rsrv,dvd_exp_insured,reinsurance_exp,claim_exp_recoverable,Insur_rsrv_recoverable,reinsur_exp_recoverable,other_oper_exp,net_inc_other_ops,net_gain_chg_fv,net_invest_inc,inc_invest_assoc_jv_entp,net_gain_fx_trans,opprofit,non_oper_rev,non_oper_exp,net_loss_disp_noncur_asset,tot_profit,tax,unconfirmed_invest_loss_is", "2007-01-01", "2017-12-31", "unit=1;rptType=1;Period=Q;Days=Alldays",usedf=True) finance_data
TOT_OPER_REV | OPER_REV | INT_INC | INSUR_PREM_UNEARNED | HANDLING_CHRG_COMM_INC | ... | NON_OPER_EXP | NET_LOSS_DISP_NONCUR_ASSET | TOT_PROFIT | TAX | UNCONFIRMED_INVEST_LOSS_IS | |
---|---|---|---|---|---|---|---|---|---|---|---|
2007-03-31 00:00:00.005 | 2.352129e+09 | 2.352129e+09 | 3.576400e+09 | NaN | 1.043200e+08 | ... | 582457.0 | NaN | 8.212724e+08 | 2.861888e+08 | NaN |
2007-06-30 00:00:00.005 | 4.890715e+09 | 4.890715e+09 | 7.621216e+09 | NaN | 2.627510e+08 | ... | 18694000.0 | NaN | 1.689924e+09 | 5.659410e+08 | NaN |
2007-09-30 00:00:00.005 | 7.767194e+09 | 7.767194e+09 | 1.242802e+10 | NaN | 4.175020e+08 | ... | 21813000.0 | NaN | 2.782990e+09 | 9.093730e+08 | NaN |
2007-12-31 00:00:00.005 | 1.080750e+10 | 1.080750e+10 | 1.804390e+10 | NaN | 6.677510e+08 | ... | 39887000.0 | NaN | 3.771775e+09 | 1.121872e+09 | NaN |
2008-03-31 00:00:00.005 | 3.553270e+09 | 3.553270e+09 | 6.434254e+09 | NaN | 1.967040e+08 | ... | 1791000.0 | NaN | 1.379105e+09 | 3.749230e+08 | NaN |
2008-06-30 00:00:00.005 | 7.115253e+09 | 7.115253e+09 | 1.319546e+10 | NaN | 4.699970e+08 | ... | 28439000.0 | NaN | 2.825668e+09 | 6.818340e+08 | NaN |
2008-09-30 00:00:00.005 | 1.074141e+10 | 1.074141e+10 | 1.991913e+10 | NaN | 8.082770e+08 | ... | 78326000.0 | NaN | 4.314669e+09 | 9.976750e+08 | NaN |
2008-12-31 00:00:00.005 | 1.451312e+10 | 1.451312e+10 | 2.646526e+10 | NaN | 1.056647e+09 | ... | 63127000.0 | NaN | 7.926090e+08 | 1.785740e+08 | NaN |
2009-03-31 00:00:00.005 | 3.760604e+09 | 3.760604e+09 | 5.872666e+09 | NaN | 2.412900e+08 | ... | -2300000.0 | NaN | 1.517120e+09 | 3.950420e+08 | NaN |
2009-06-30 00:00:00.005 | 7.490850e+09 | 7.490850e+09 | 1.117129e+10 | NaN | 5.698120e+08 | ... | 10476000.0 | NaN | 2.929479e+09 | 6.180910e+08 | NaN |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
2015-09-30 00:00:00.005 | 7.115200e+10 | 7.115200e+10 | 9.922500e+10 | NaN | 2.214400e+10 | ... | 40000000.0 | NaN | 2.328600e+10 | 5.546000e+09 | NaN |
2015-12-31 00:00:00.005 | 9.616300e+10 | 9.616300e+10 | 1.316490e+11 | NaN | 2.918500e+10 | ... | 89000000.0 | NaN | 2.884600e+10 | 6.981000e+09 | NaN |
2016-03-31 00:00:00.005 | 2.753200e+10 | 2.753200e+10 | 3.235900e+10 | NaN | 8.896000e+09 | ... | 3000000.0 | NaN | 8.029000e+09 | 1.943000e+09 | NaN |
2016-06-30 00:00:00.005 | 5.476900e+10 | 5.476900e+10 | 6.356800e+10 | NaN | 1.810000e+10 | ... | 31000000.0 | NaN | 1.615400e+10 | 3.862000e+09 | NaN |
2016-09-30 00:00:00.005 | 8.196800e+10 | 8.196800e+10 | 9.557500e+10 | NaN | 2.668900e+10 | ... | 37000000.0 | NaN | 2.456000e+10 | 5.841000e+09 | NaN |
2016-12-31 00:00:00.005 | 1.077150e+11 | 1.077150e+11 | 1.311190e+11 | NaN | 3.130900e+10 | ... | 65000000.0 | NaN | 2.993500e+10 | 7.336000e+09 | NaN |
2017-03-31 00:00:00.005 | 2.771200e+10 | 2.771200e+10 | 3.504500e+10 | NaN | 9.125000e+09 | ... | 14000000.0 | NaN | 8.230000e+09 | 2.016000e+09 | NaN |
2017-06-30 00:00:00.005 | 5.407300e+10 | 5.407300e+10 | 7.164800e+10 | NaN | 1.786900e+10 | ... | 51000000.0 | NaN | 1.643200e+10 | 3.878000e+09 | NaN |
2017-09-30 00:00:00.005 | 7.983300e+10 | 7.983300e+10 | 1.088750e+11 | NaN | 2.664600e+10 | ... | 89000000.0 | NaN | 2.493900e+10 | 5.786000e+09 | NaN |
2017-12-31 00:00:00.005 | 1.057860e+11 | 1.057860e+11 | 1.480680e+11 | NaN | 3.572500e+10 | ... | 104000000.0 | NaN | 3.015700e+10 | 6.968000e+09 | NaN |
例18 用wss取上证50的常见财务指标的2017年年报数据
sh_50=w.wset("sectorconstituent","date=2018-06-20;sectorid=1000000087000000").Data[1] error_code,Y_finance_data=w.wss(sh_50, "tot_oper_rev,tot_oper_cost,opprofit,tot_profit,net_profit_is,np_belongto_parcomsh,extraordinary,wgsd_deductedprofit,researchanddevelopmentexpenses,ebit,ebitda,tot_cur_assets,fix_assets,long_term_eqy_invest,tot_assets,tot_cur_liab,tot_non_cur_liab,tot_liab,cap_rsrv,surplus_rsrv,undistributed_profit,cash_recp_sg_and_rs,cash_pay_acq_const_fiolta","unit=1;rptDate=20171231;rptType=1;currencyType=",usedf=True) Y_finance_data
TOT_OPER_REV | TOT_OPER_COST | OPPROFIT | TOT_PROFIT | NET_PROFIT_IS | ... | CAP_RSRV | SURPLUS_RSRV | UNDISTRIBUTED_PROFIT | CASH_RECP_SG_AND_RS | CASH_PAY_ACQ_CONST_FIOLTA | |
---|---|---|---|---|---|---|---|---|---|---|---|
600000.SH | 1.686190e+11 | 9.834400e+10 | 7.027500e+10 | 6.982800e+10 | 5.500200e+10 | ... | 8.176000e+10 | 9.419800e+10 | 1.198070e+11 | NaN | 8.430000e+09 |
600016.SH | 1.442810e+11 | 8.343200e+10 | 6.084900e+10 | 6.056200e+10 | 5.092200e+10 | ... | 6.475300e+10 | 3.491400e+10 | 1.634200e+11 | NaN | 1.024400e+10 |
600019.SH | 2.894978e+11 | 2.679779e+11 | 2.492417e+10 | 2.403513e+10 | 2.040314e+10 | ... | 4.871456e+10 | 2.977472e+10 | 6.456963e+10 | 3.191169e+11 | 1.327689e+10 |
600028.SH | 2.360193e+12 | 2.295113e+12 | 8.696500e+10 | 8.657300e+10 | 7.029400e+10 | ... | 1.195570e+11 | 1.996820e+11 | 2.904590e+11 | 2.644126e+12 | 7.094800e+10 |
600029.SH | 1.274890e+11 | 1.240330e+11 | 8.081000e+09 | 8.798000e+09 | 6.833000e+09 | ... | 1.511500e+10 | 2.449000e+09 | 2.166400e+10 | 1.392190e+11 | 1.384600e+10 |
600030.SH | 4.329163e+10 | 2.704330e+10 | 1.624833e+10 | 1.617378e+10 | 1.197747e+10 | ... | 5.444553e+10 | 8.164570e+09 | 5.200699e+10 | NaN | 4.430080e+08 |
600036.SH | 2.208970e+11 | 1.303570e+11 | 9.054000e+10 | 9.068000e+10 | 7.063800e+10 | ... | 6.752300e+10 | 4.615900e+10 | 2.410630e+11 | NaN | 1.633600e+10 |
600048.SH | 1.463418e+11 | 1.224980e+11 | 2.552692e+10 | 2.569945e+10 | 1.967720e+10 | ... | 1.546246e+10 | 3.132280e+09 | 7.126067e+10 | 2.084607e+11 | 4.945488e+08 |
600050.SH | 2.748289e+11 | 2.717170e+11 | 1.513207e+09 | 2.377867e+09 | 1.683958e+09 | ... | 7.634633e+10 | 1.338484e+09 | 2.977337e+10 | 2.931982e+11 | 6.562962e+10 |
600104.SH | 8.706394e+11 | 8.493992e+11 | 5.410999e+10 | 5.426101e+10 | 4.711610e+10 | ... | 5.486843e+10 | 3.774649e+10 | 1.046946e+11 | 9.600528e+11 | 2.541236e+10 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
601688.SH | 2.110853e+10 | 1.026027e+10 | 1.084827e+10 | 1.158464e+10 | 9.407857e+09 | ... | 4.582063e+10 | 3.919487e+09 | 1.897722e+10 | NaN | 3.776342e+08 |
601766.SH | 2.110126e+11 | 2.004230e+11 | 1.474316e+10 | 1.539932e+10 | 1.301155e+10 | ... | 4.063667e+10 | 2.821562e+09 | 4.903600e+10 | 2.273616e+11 | 8.696807e+09 |
601800.SH | 4.828043e+11 | 4.638578e+11 | 2.663763e+10 | 2.655328e+10 | 2.131878e+10 | ... | 2.548548e+10 | 4.713740e+09 | 9.728299e+10 | 4.525785e+11 | 4.073669e+10 |
601818.SH | 9.185000e+10 | 5.126900e+10 | 4.058100e+10 | 4.064600e+10 | 3.161100e+10 | ... | 5.353300e+10 | 2.105400e+10 | 9.216400e+10 | NaN | 4.489000e+09 |
601857.SH | 2.015890e+12 | 1.971674e+12 | 5.776900e+10 | 5.308300e+10 | 3.678800e+10 | ... | 1.286390e+11 | 1.887690e+11 | 7.074480e+11 | 2.335730e+12 | 2.370040e+11 |
601878.SH | 4.610612e+09 | 3.209905e+09 | 1.400707e+09 | 1.405308e+09 | 1.063508e+09 | ... | 3.980781e+09 | 3.989668e+08 | 4.039567e+09 | NaN | 1.077741e+08 |
601881.SH | 1.134419e+10 | 6.495595e+09 | 4.848598e+09 | 4.808655e+09 | 4.018974e+09 | ... | 2.502739e+10 | 5.318881e+09 | 1.587694e+10 | NaN | 2.772473e+08 |
601988.SH | 4.832780e+11 | 2.610490e+11 | 2.222290e+11 | 2.229030e+11 | 1.849860e+11 | ... | 1.418800e+11 | 1.413340e+11 | 6.465580e+11 | NaN | 4.601100e+10 |
601989.SH | 3.877577e+10 | 4.057557e+10 | 5.303990e+08 | 4.567537e+08 | -2.422998e+08 | ... | 2.905220e+10 | 1.753424e+09 | 1.399196e+10 | 3.764177e+10 | 1.455235e+09 |
603993.SH | 2.414756e+10 | 1.840378e+10 | 5.377079e+09 | 5.381817e+09 | 3.595615e+09 | ... | 2.758279e+10 | 9.681907e+08 | 5.517441e+09 | 2.459425e+10 | 1.066476e+09 |