Open nickmik33 opened 2 years ago
The PortfolioDataRequest
request type is missing from the _SERVICES
dictionary of BlpQuery
. Adding it should allow you to make the call you want, although not through the bds()
method, which is configured to make calls of the ReferenceDataRequest
request type. You would have to use the query()
method.
If you're just looking to get the positions of a portfolio, then you can do it using the bql()
(no need to implement PortfolioDataRequest in this case)
with blp.BlpQuery() as bq:
data = bq.bql("get(id().weights) for(Members('PORTF-ID-HERE', type='PORT'))")
Replace 'PORTF-ID-HERE' with your actual portfolio ID. This code will give you the positions in your portfolio.
How difficult would it be to add in Portfolio Data (PortfolioDataRequest/PortfolioDataResponse)?
In excel, it’s a bds formula, but not with the api.
I’m fairly new to python, but was hopeful this could be a quick edit. Thank you for putting this package together.