alpha-xone / xbbg

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

Issue when calling "CRNCY_ADJ_PX_LAST" whilst using the "EQY_FUND_CRNCY" argument. #50

Closed DJW41023 closed 2 years ago

DJW41023 commented 2 years ago

Hi,

Thanks for creating and maintaining such a useful package. I noticed that when making the below call, an empty pd.DataFrame is returned. However, when making the call to "PX_LAST" and removing the kwargs, the data is returned as expected. Is it possible to return data within a specified currency as below, or is the workaround based on "PX_LAST" for the relevant currency pair?

Thanks

from xbbg import blp

for index, row in dataset.iterrows():
        if verbose:
            print("Ticker: {}".format(row[key]))
        value = blp.bdp(row[key] + " Equity", "CRNCY_ADJ_PX_LAST", kwargs="EQY_FUND_CRNCY=USD")
alpha-xone commented 2 years ago

Can you try:

blp.bdp([tickets], 'CRNCY_ADJ_PX_LAST', EQY_FUND_CRNCY='USD')

DJW41023 commented 2 years ago

Thanks, I resolved this using the flds=["CRNCY_ADJ_PX_LAST", "EQY_FUND_CRNCY=USD"] argument.