You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于xbbg库bdib()函数获取彭博10秒间隔日内数据及解决“Cannot find exchange info for tickername”报错的咨询

Solution to Your xbbg bdib() Issues

Hey Leo, let's work through your two problems step by step:

1. Fixing "Cannot find exchange info for tickername" Error

This error almost always stems from an incomplete ticker format. The xbbg package requires full Bloomberg ticker strings that include both the exchange code and security type suffix. Using a short ticker like just AAPL won't work—you need to specify something like AAPL US Equity (Apple stock on the US exchange) or EURUSD Curncy (EUR/USD currency pair).

Here's how to resolve this:

  • Use the full ticker format: Replace tickername with a valid Bloomberg ticker that includes exchange and type. For example:
    from xbbg import blp
    blp.bdib(ticker='AAPL US Equity', dt='2021-02-22')
    
  • Verify ticker validity: If you're unsure about the correct ticker, use Bloomberg Terminal's FLDS function, or check with xbbg itself using blp.ref():
    # Confirm a ticker's validity and get its name
    blp.ref('AAPL US Equity', 'NAME')
    
  • Check Bloomberg connection: Ensure your Bloomberg Terminal is logged in, and that xbbg is properly configured (verify your bbg.cfg file has the correct path to Bloomberg's API installation).

2. Setting 10-Second Interval in bdib()

To pull intraday data at a 10-second frequency, use the interval parameter in bdib()—this accepts the interval length directly in seconds.

Here's the updated code:

from xbbg import blp
# Fetch 10-second interval intraday data for 2021-02-22
df = blp.bdib(ticker='AAPL US Equity', dt='2021-02-22', interval=10)

If you need to filter data type (e.g., only trades or bid/ask quotes), add the typ parameter—like typ='TRADE' for trade data, or typ='BID'/typ='ASK' for quote data.


内容的提问来源于stack exchange,提问作者Leo Li

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 01:32:28