1

当使用带有 Blpapi 的 ignore_security_error=1 时,我得到“ref() got an unexpected keyword argument 'ignore_security_error'”。我的列表中有一些不好的代码,我想使用 ignore_security_error=1 忽略但得到一个错误。tc3 是从 .csv 文件生成的股票代码列表。

 M2= con.ref(tc3,["PX_LAST","CONTRACT_VALUE","CHG_PCT_1YR","CHG_PCT_6M","CHG_PCT_3M","CHG_PCT_1M","FO211","MARKET_SECTOR_DES","ID_BB_COMPANY"],ignore_security_error=1)

还有其他人有这个问题吗?

4

2 回答 2

0
In [1]: from xbbg import blp
In [2]: tc3 = ...
In [3]: flds = [...]
In [4]: m2 = blp.bdp(tickers=tc3, flds=flds).dropna(how='all')

参考:xbbg

于 2020-01-09T15:10:30.187 回答
0

看起来它正在请求覆盖的元组列表。尝试像这样传递它

 M2= con.ref(tc3,["PX_LAST","CONTRACT_VALUE","CHG_PCT_1YR","CHG_PCT_6M","CHG_PCT_3M","CHG_PCT_1M","FO211","MARKET_SECTOR_DES","ID_BB_COMPANY"],[('ignore_security_error', 1)])

https://github.com/matthewgilbert/pdblp/blob/master/pdblp/pdblp.py#L322

注意它可能取 True 而不是 1。如果此代码不起作用,请尝试替换它。

于 2020-01-07T22:17:45.977 回答