Hi Tradovate community,
I’m experiencing an issue with the WebSocket market data connection. I can successfully connect and subscribe to market data, but I’m not receiving any real-time bid/ask quotes.
What’s Working:
-
WebSocket connection to wss://demo.tradovateapi.com/v1/websocket
-
Authorization with mdAccessToken (returns “o” frame)
-
Market data subscription (returns {“s”:200,“i”:1})
-
Receiving heartbeat frames (“h”)
What’s Not Working:
-
No real-time bid/ask price updates
-
Only receiving heartbeat frames, no market data frames
My Setup:
-
Account: Demo environment
-
hasMarketData: false in account settings
-
WebSocket subscription to “MNQU5” (Micro E-mini NASDAQ-100)
Code Implementation:
python
# WebSocket Connection and Authorization
ws_url = "wss://demo.tradovateapi.com/v1/websocket"
md_access_token = "your_md_access_token"
# Connect and authorize
websocket = await websockets.connect(ws_url)
auth_frame = f"authorize\n1\n\n{md_access_token}"
await websocket.send(auth_frame)
# Subscribe to market data
sub_frame = f"marketData/subscribe\n2\n\n{json.dumps(['MNQU5'])}"
await websocket.send(sub_frame)
# Listen for updates (only getting "h" frames, no market data)
async for message in websocket:
if message.startswith('h'):
print("Heartbeat received") # This works
elif message.startswith('a'):
print("Market data received") # This never happens
Questions:
- Is hasMarketData: false preventing real-time quotes even with WebSocket subscription?
- Do I need to upgrade my account to receive live market data?
- Is there a different subscription method I should be using?
- Are there specific market data plans required for real-time quotes?
Any help would be greatly appreciated!