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

//blp/mktbar enhancement #21

Closed
obronco opened this issue Jan 26, 2023 · 2 comments
Closed

//blp/mktbar enhancement #21

obronco opened this issue Jan 26, 2023 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@obronco
Copy link

obronco commented Jan 26, 2023

I managed to get the mktbar service working by changing a few lines in blp.py:

class EventHandler:

def marketdata_event(self, event):
    event_name = _EVENT_DICT[event.eventType()]
    for n, msg in enumerate(event):
        if msg.messageType() in _MARKET_DATA_EVENTS:  # replace == with in

and _MARKET_DATA_EVENTS becomes a list:

_MARKET_DATA_EVENTS = [
blpapi.Name("MarketDataEvents"),
blpapi.Name("MarketBarStart"),
blpapi.Name("MarketBarUpdate")
]

Now when calling blp.BlpStream, I use

with blp.BlpStream(setDefaultSubscriptionService="//blp/mktbar") as bs:
default_args = {
"fields": ["LAST_PRICE"],
"options" : "interval=1"
}
bs.subscribe({ "USDJPY Curncy": default_args})

@obronco obronco changed the title //blp/mktbar feature //blp/mktbar enhancement Jan 26, 2023
@matthewgilbert
Copy link
Owner

Ahh this is a good example and seems fairly easty to support. I haven't used this service before hence the lack of support. Happy to except a PR on this feature.

@matthewgilbert matthewgilbert added help wanted Extra attention is needed enhancement New feature or request labels Jan 29, 2023
@matthewgilbert
Copy link
Owner

Closed by #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants