matthewgilbert / pdblp

pandas wrapper for Bloomberg Open API
MIT License
240 stars 69 forks source link

pdblp BDH Overrides with CDR #88

Open otpoon opened 3 years ago

otpoon commented 3 years ago

Hello! i am looking to try and do this with pdblp. In Excel, =bdh(ticker,field,start,end, "CDR = #A&#L") but im not sure what the equivalent should be for pdblp....

pdblp.bdh("SPX Index", "PX LAST", 20190101,2020101,elms = [("calendarCodeOverride","#A")])

So the above line works for just 1 override but if I want the Union of another code, thats where i'm sure how to do it, just like the one in Excel, return historical price with all trading days in exch code #A&#L

Thanks for any help given in adv!

otpoon commented 3 years ago

https://data.bloomberglp.com/labs/sites/2/2013/12/blpapi-developers-guide-1.38.pdf

seems like page 164 of pdf (166 actual guide) sheds some light...is there a way to incorporate this into the pdblp module? Or how to write the correct syntax if I want the same trading days for my example, say SPX Index on both US and EN trading days?

Thanks a lot!

matthewgilbert commented 3 years ago

I am unsure how the Excel backend works, but have been informed previously that the backend service for the python API and the Excel API are different. pdblp is just a wrapper around the Bloomberg libary blpapi, so any overrides supported through blpapi should be possible in pdblp. As you wrote in your example above, these can be passed to bdh either via elms or ovrds parameters. I would confirm with Bloomberg or possibly on StackOverflow with tag blpapi on how to structure the right blpapi request.

otpoon commented 3 years ago

I am unsure how the Excel backend works, but have been informed previously that the backend service for the python API and the Excel API are different. pdblp is just a wrapper around the Bloomberg libary blpapi, so any overrides supported through blpapi should be possible in pdblp. As you wrote in your example above, these can be passed to bdh either via elms or ovrds parameters. I would confirm with Bloomberg or possibly on StackOverflow with tag blpapi on how to structure the right blpapi request.

Understood thanks! will keep at it and see if I can come to a solution