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

Added support for the Bloomberg equity screening BEQS() function, wit… #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

creyl
Copy link

@creyl creyl commented May 11, 2017

…h the ability to request a screen as of today, as of a date in the past and for an arbitrary set of dates. See section 15.7 of https://data.bloomberglp.com/professional/sites/4/BLPAPI-Core-Developer-Guide.pdf.

Tried to follow your style as closely as possible.

Let me know!
Charles

…h the ability to request a screen as of today, as of a date in the past and for an arbitrary set of dates. See section 15.7 of https://data.bloomberglp.com/professional/sites/4/BLPAPI-Core-Developer-Guide.pdf.
Copy link
Owner

@matthewgilbert matthewgilbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, this looks like useful functionality, thanks Charles. Just a couple of
quick comments. Could you run flake8 on your branch to check PEP8
compatibility, e.g. flake8 ./pdblp

In addition, I don't know if the date column makes sense in the context of beqs()? If I run

df = con.beqs('Insider Buyers', 'GLOBAL', 'Popular')

df.head()

   ticker        field           value  date
0  JPM US       Ticker          JPM US     4
1  JPM US   Short Name  JPMORGAN CHASE     4
2  JPM US   Market Cap     3.09662e+11     4
3  JPM US  GICS Sector      Financials     4
4  JPM US        Cntry   United States     4

the date columns is just a randomly generated CorrelationID. I understand the use in the context of beqs_hist() but maybe it should be removed from beqs(), thoughts?

df = self.con.beqs('Insider Buyers', 'GLOBAL', 'Popular', asof_date=asof_date)
assert len(df) == 1145

def test_beqs_hist(self):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test is failing for me since I am getting a DataFrame of length 488. Bloombergs exact data returned is not always reliable, a test which just checks the known properties of the returned DataFrame would be better (e.g. a DataFrame with specific columns)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Matthew,

I have read your codes and also the codes from blpapi. I found it is impossible to get the data of backdates. Actually I want to realize the lookup function that use the market cap rank in 2019 to select stock. But I cannot find any api methods to do that. I have found yours codes is working, but it is now not accurate?

Beth

request.set('languageId', language_id)
return request

def beqs_hist(self, screen_name, screen_type='PRIVATE', group='General', language_id='ENGLISH',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

freq parameter here is unused and should be removed. longdata parameter should be documented.

ev_counter += 1
if ev_counter == len(asof_dates):
break
# if ev.eventType() == blpapi.Event.TIMEOUT:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commented out section should be removed

@creyl
Copy link
Author

creyl commented May 30, 2017 via email

@matthewgilbert matthewgilbert changed the base branch from master to beqs September 14, 2020 14:15
@matthewgilbert matthewgilbert changed the base branch from beqs to master September 14, 2020 14:20
@matthewgilbert matthewgilbert mentioned this pull request Sep 14, 2020
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

Successfully merging this pull request may close these issues.

None yet

5 participants