Skip to content

Comments

Fix ws IndexValue parse#428

Merged
justinpolygon merged 2 commits intomasterfrom
jw-indices-ws-parse
May 17, 2023
Merged

Fix ws IndexValue parse#428
justinpolygon merged 2 commits intomasterfrom
jw-indices-ws-parse

Conversation

@justinpolygon
Copy link
Collaborator

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