Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

con.bdh() does not return field values for subset of underlyings #81

Open
WladimirOstrovsky opened this issue May 13, 2020 · 0 comments

Comments

@WladimirOstrovsky
Copy link

Code Sample, a copy-pastable example if possible

def create_bbg_con():
    con = pdblp.BCon(debug=True, port=8194, timeout=5000)
    con.start()
    return con

ticker = ['BGAM0P 122.0 Curncy', 'BGAN0P 119.5 Curncy', 'DAX 05/15/20 P10000 Index']
field = 'PX_CLOSE_1D'
start_date_str = '20200430'
end_date_str = '20200430'

result_temp = con.bdh(ticker, field, start_date_str, end_date_str, longdata=True)

Problem description

For some reason con.bdh() does not return field values for all ticker supplied. I found out that these are only equity index options (see above). It works for FX Future options and Bond Future options.

my output:

        date               ticker        field  value
0 2020-04-30  BGAM0P 122.0 Curncy  PX_CLOSE_1D   0.67
1 2020-04-30  BGAN0P 119.5 Curncy  PX_CLOSE_1D   0.64

debugger:

pdblp.pdblp:INFO:Sending Request:
HistoricalDataRequest = {
    securities[] = {
        "BGAM0P 122.0 Curncy", "BGAN0P 119.5 Curncy", "DAX 05/15/20 P10000 Index"
    }
    fields[] = {
        "PX_CLOSE_1D"
    }
    startDate = "20200430"
    endDate = "20200430"
    overrides[] = {
    }
}
pdblp.pdblp:INFO:Event Type: 'PARTIAL_RESPONSE'
pdblp.pdblp:INFO:Message Received:
HistoricalDataResponse = {
    securityData = {
        security = "BGAM0P 122.0 Curncy"
        eidData[] = {
        }
        sequenceNumber = 0
        fieldExceptions[] = {
        }
        fieldData[] = {
            fieldData = {
                date = 2020-04-30
                PX_CLOSE_1D = 0.670000
            }
        }
    }
}
pdblp.pdblp:INFO:Event Type: 'PARTIAL_RESPONSE'
pdblp.pdblp:INFO:Message Received:
HistoricalDataResponse = {
    securityData = {
        security = "BGAN0P 119.5 Curncy"
        eidData[] = {
        }
        sequenceNumber = 1
        fieldExceptions[] = {
        }
        fieldData[] = {
            fieldData = {
                date = 2020-04-30
                PX_CLOSE_1D = 0.640000
            }
        }
    }
}
pdblp.pdblp:INFO:Event Type: 'RESPONSE'
pdblp.pdblp:INFO:Message Received:
HistoricalDataResponse = {
    securityData = {
        security = "DAX 05/15/20 P10000 Index"
        eidData[] = {
        }
        sequenceNumber = 2
        fieldExceptions[] = {
        }
        fieldData[] = {
        }
    }
}

Expected Output

        date               ticker        field  value
0 2020-04-30  BGAM0P 122.0 Curncy  PX_CLOSE_1D   0.67
1 2020-04-30  BGAN0P 119.5 Curncy  PX_CLOSE_1D   0.64
1 2020-04-30  DAX 05/15/20 P10000 Index  PX_CLOSE_1D   some number

Version Information

'0.1.8'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant