Python Bloomberg API pdblp intraday request

前端 未结 2 2094
醉话见心
醉话见心 2020-12-11 07:04

pdblp allows daily historical Bloomberg requests via:

con = pdblp.BCon(debug=False)
con = start()
df = con.bdh([\'SPY Equity\'], \'PX_LAST\', \'20150103\', \         


        
2条回答
  •  猫巷女王i
    2020-12-11 07:32

    Start time and end time must be in UTC timezone. So a bit of conversions should be made - and need to account for daylight savings as well.

    Using xbbg instead is much easier:

    In [1]: from xbbg import blp
    
    In [2]: blp.bdib(ticker='SPY US Equity', dt='2018-11-20').tail()
    Out[2]:
    ticker                    SPY US Equity
    field                              open   high    low  close   volume num_trds
    2018-11-20 15:57:00-05:00        264.42 264.49 264.35 264.41   590775     2590
    2018-11-20 15:58:00-05:00        264.42 264.42 264.26 264.27  1005241     3688
    2018-11-20 15:59:00-05:00        264.26 264.48 264.12 264.15  4227150     7886
    2018-11-20 16:09:00-05:00        264.12 264.12 264.12 264.12        0        1
    2018-11-20 16:15:00-05:00        264.12 264.12 264.12 264.12        0        1
    

    Need the full equity ticker here to find the timezone of exchange.

提交回复
热议问题