alpha-xone / xbbg

An intuitive Bloomberg API
https://xbbg.readthedocs.io/
Apache License 2.0
246 stars 52 forks source link

BBG Tickers with whitespaces properly not working with blp.bdib #8

Closed choi300 closed 4 years ago

choi300 commented 4 years ago

There are some instruments whose BBG ticker has one or more white spaces within the name of tickers, such as Corn futures("C 1 Comdty") or Soybean Futures("S 1 Comdty"). If I add those kind of instrument's ticker into markets/assets.yml, simply blp.bdib function doesn't recognize them. I need to put trailing whitespace at the end of list items but when reading yml files, the function seem to ignores the trailing whitespace. In case of "S 1 Comdty", I tried putting "S " or S\ or S"\ " as below but any of those are not working. How can I insert tickers with whitespaces into markets/assets.yml?

Comdty:
  - tickers: [CL, "S ", XB, GC, PL, HO, NG, PA]
    exch: NYME
    freq: M
    is_fut: True

Error Messages are like this: 2019-11-25 15:44:24,982:xbbg.const.exch_info:ERROR:required exchange info cannot be found in S 1 Comdty ...

alpha-xone commented 4 years ago

This should be solved in https://github.com/alpha-xone/xbbg/pull/9/commits/677d78de0781220d2445d329d11b6d10321538c9

Can you try if following config works:

Comdty:
  - tickers: [CL, S, XB, GC, PL, HO, NG, PA]
    exch: NYME
    freq: M
    is_fut: True