pythonbloombergblpapipdblp

Field override for bdh() in pdblp


Bloomberg help isn't very helpful for their API. Can anyone please explain how to replace PX_LAST with the dividend adjusted price field. I have attempted the following but have been unsuccessful

import pdblp
con = pdblp.BCon()
con.start()

df2 = con.bdh(['NQ1 Index', 'DM1 Index'], ['PX_LAST'],
              '20061227', '20061231', elms=[("periodicityAdjustment", "ACTUAL")])

Solution

  • The best place to look for this information is in the BLOOMBERG OPEN API – REFERENCE SERVICES & SCHEMAS GUIDE. To access this, from a Bloomberg Terminal go WAPI <GO> -> API Developer's Guide.

    These are from page 20 BLOOMBERG OPEN API – REFERENCE SERVICES & SCHEMAS GUIDE

    adjustmentSplit {TRUE, FALSE}

    Adjust historical pricing and/or volume to reflect: Spin-Offs, Stock Splits/Consolidations, Stock Dividend/Bonus, Rights Offerings/ Entitlement.

    adjustmentFollowDPDF {TRUE, FALSE}

    Setting to true follows the DPDF BloombergProfessional service function. True is default setting for this option

    An example of this is showing Apple with and without the split adjustment incorporated is.

    import pdblp
    
    con = pdblp.BCon().start()
    
    con.bdh("AAPL US Equity", "PX_LAST", "20140604", "20140610",
            elms=[("adjustmentSplit", True)])
    
    ticker     AAPL US Equity
    field             PX_LAST
    date                     
    2014-06-04        92.1171
    2014-06-05        92.4786
    2014-06-06        92.2243
    2014-06-09        93.7000
    2014-06-10        94.2500
    
    con.bdh("AAPL US Equity", "PX_LAST", "20140604", "20140610",
            elms=[("adjustmentSplit", False)])
    
    ticker     AAPL US Equity
    field             PX_LAST
    date                     
    2014-06-04         644.82
    2014-06-05         647.35
    2014-06-06         645.57
    2014-06-09          93.70
    2014-06-10          94.25