The raw
BLP API Interface (page 85) doesn't use 'exchanges' as such. The interface just takes a start and end datetime (UTC), so it is up to the user to determine any timezone adjustment.
Looking in the python source, xbbg does the timezone adjustment for you, if it can. It first checks the ticker in assets.yml to see if it can perform some sort of match, to find an exchange code. The exchange codes are looked up in exch.yml, which gives the timezone (tz).
This section in my (default?) assets.yml has an entry:
- tickers: [
USGG2YR, USGG10YR, USYC2Y10, USYC1030, USGG30YR
]
exch: IndexUS
and this is the entry in exch.yml, which gives the hours for the trading day:
IndexUS:
tz: America/New_York
allday: [930, 1600]
The alternative to the asset lookup is to supply the exchange name yourself. As your ticker is a TIPS bond, it will likely have the same trading hours as USGG2YR (2yr generic Treasury), so we can use 'IndexUS' as the exchange. The 'ref' parameter can be used to specify the exchange.
blp.bdib(ticker='US912810SM18 Corp', dt='2021-04-16',ref='IndexUS').tail()
gives the result:
US912810SM18 Corp ...
open high ... num_trds value
2021-04-16 15:55:00-04:00 106.632812 106.671875 ... 34 0.0
2021-04-16 15:56:00-04:00 106.640625 106.656250 ... 34 0.0
2021-04-16 15:57:00-04:00 106.625000 106.625000 ... 31 0.0
2021-04-16 15:58:00-04:00 106.617188 106.757812 ... 33 0.0
2021-04-16 15:59:00-04:00 106.710938 106.757812 ... 32 0.0
[5 rows x 7 columns]
NB. 2020-10-17 was a Saturday (no data), and in any case the API says that Bloomi only stores the past 140 business days of tick-by-tick data (ie 6 months).
Of course, if you want bespoke trading hours, you can add your own entry into exch.yml, and then reference that name.
As an aside, there is also a blp.bdtick()
function which (I think) pulls back the raw tick data, rather than the bars if you don't need the OHLC data.
[EDIT] In answer to why it works with equities, the assets.yml file has a lot more of the equity possibilities listed. Govt bonds don't trade on exchanges in the same way, and the trading hours are more by convention. Foe end-of-day prices, BDH just uses whatever closing time is defined by Bloomberg for that asset.