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

Fix ws IndexValue parse #428

Merged
merged 2 commits into from
May 17, 2023
Merged

Fix ws IndexValue parse #428

merged 2 commits into from
May 17, 2023

Conversation

justinpolygon
Copy link
Contributor

When subscribed to the real-time value for a given index ticker symbol with python it was throwing an error saying unknown message type. So, updated the parse_single to recognize the event type and then updated the IndexValue class to return the correct message type.

Here's a test script:

from polygon import WebSocketClient
from polygon.websocket.models import WebSocketMessage, Market
from typing import List

client = WebSocketClient(market=Market.Indices)

client.subscribe("V.I:SPX") # Standard & Poor's 500

def handle_msg(msgs: List[WebSocketMessage]):
    for m in msgs:
        print(m)

client.run(handle_msg)

@justinpolygon justinpolygon merged commit d271e44 into master May 17, 2023
@justinpolygon justinpolygon deleted the jw-indices-ws-parse branch May 17, 2023 14:55
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.

2 participants