我正在使用 pdblp 包来收集供应链数据。但我面临两个问题。首先,它只给了我当前日期的前五个供应商,甚至不是全部。此外,它没有提供任何历史数据。通过更改任何日期,仍然可以获得相同的结果。我搜索了所有网络,没有从彭博收集供应链数据的教程手册。所以,我想知道是否有人对此有任何经验或解决方案。非常感谢!
下面显示了我使用 con.bulkref_hist() 和 con.bulkref() 来收集 APPLE Inc. 的供应商的代码。如输出所示,我只得到了 5 个 Apple 供应商?不是全部,甚至我也无法更改日期。
import pdblp
con = pdblp.BCon(debug=True, port=8194, timeout=100000)
con.start()
con.bulkref('AAPL US Equity', 'SUPPLY_CHAIN_SUPPLIERS',ovrds=[('DZ414',"20100626")])
# Your code here, this should be a minimal reproducible example, see https://stackoverflow.com/help/mcve
pdblp.pdblp:INFO:Sending Request:
ReferenceDataRequest = {
securities[] = {
"AAPL US Equity"
}
fields[] = {
"SUPPLY_CHAIN_SUPPLIERS"
}
overrides[] = {
overrides = {
fieldId = "DZ414"
value = "20100626"
}
}
}
pdblp.pdblp:INFO:Event Type: 'RESPONSE'
pdblp.pdblp:INFO:Message Received:
ReferenceDataResponse = {
securityData[] = {
securityData = {
security = "AAPL US Equity"
eidData[] = {
}
fieldExceptions[] = {
}
sequenceNumber = 0
fieldData = {
SUPPLY_CHAIN_SUPPLIERS[] = {
SUPPLY_CHAIN_SUPPLIERS = {
Equity Ticker = "2317 TT Equity"
}
SUPPLY_CHAIN_SUPPLIERS = {
Equity Ticker = "4938 TT Equity"
}
SUPPLY_CHAIN_SUPPLIERS = {
Equity Ticker = "2382 TT Equity"
}
SUPPLY_CHAIN_SUPPLIERS = {
Equity Ticker = "601138 CH Equity"
}
SUPPLY_CHAIN_SUPPLIERS = {
Equity Ticker = "2330 TT Equity"
}
}
}
}
}
}
dates = ["20100626"]
con.bulkref_hist("AAPL US Equity", ["DZ405"],dates)
pdblp.pdblp:INFO:Sending Request:
ReferenceDataRequest = {
securities[] = {
"AAPL US Equity"
}
fields[] = {
"DZ405"
}
overrides[] = {
overrides = {
fieldId = "REFERENCE_DATE"
value = "20100626"
}
}
}
或以下内容:
pdblp.pdblp:INFO:Event Type: 'RESPONSE'
pdblp.pdblp:INFO:Message Received:
ReferenceDataResponse = {
securityData[] = {
securityData = {
security = "AAPL US Equity"
eidData[] = {
}
fieldExceptions[] = {
}
sequenceNumber = 0
fieldData = {
DZ405[] = {
DZ405 = {
Equity Ticker = "2317 TT Equity"
}
DZ405 = {
Equity Ticker = "4938 TT Equity"
}
DZ405 = {
Equity Ticker = "2382 TT Equity"
}
DZ405 = {
Equity Ticker = "601138 CH Equity"
}
DZ405 = {
Equity Ticker = "2330 TT Equity"
}
}
}
}
}
}
我在这两种方法中的输出如下。不是所有的供应商。
date | ticker | field | name | value | position
-- | -- | -- | -- | -- | --
20100626 | AAPL US Equity | DZ405 | Equity Ticker | 2317 TT Equity | 0
20100626 | AAPL US Equity | DZ405 | Equity Ticker | 4938 TT Equity | 1
20100626 | AAPL US Equity | DZ405 | Equity Ticker | 2382 TT Equity | 2
20100626 | AAPL US Equity | DZ405 | Equity Ticker | 601138 CH Equity | 3
20100626 | AAPL US Equity | DZ405 | Equity Ticker | 2330 TT Equity | 4