WebSocket Connected but No Data
Troubleshoot silent WebSocket connections across five checkpoints: subscription payload, symbol format, endpoint URL, trading hours, and heartbeats.
Core Takeaway · 30-Second Brief
A successful WebSocket handshake only proves network reachability and token acceptance. When no market data arrives, check five causes in order: missing or malformed subscription payload, wrong symbol notation, mismatched endpoint URL for the asset class, market closure/lunch break, or missing heartbeats causing silent disconnects.
01
Five-Step Diagnostic Checklist
02
Quick Self-Test with a 24/5 Active Symbol
To isolate whether the issue lies in your WebSocket plumbing or the target stock’s trading session, temporarily subscribe to a highly liquid 24/5 FX pair such as EURUSD on quote-b-ws-api. Receiving ticks confirms your auth and subscription flow are healthy.
import asyncio, json, os, uuidimport websocketsasync def probe(): token = os.getenv("ALLTICK_API_TOKEN", "YOUR_API_TOKEN") url = f"wss://quote.alltick.co/quote-b-ws-api?token={token}" async with websockets.connect(url) as ws: await ws.send(json.dumps({ "cmd_id": 22004, "seq_id": 1, "trace": str(uuid.uuid4()), "data": {"symbol_list": [{"code": "EURUSD"}]}, })) for _ in range(5): print(await asyncio.wait_for(ws.recv(), timeout=30))if __name__ == "__main__": asyncio.run(probe())03
No Data After a Reconnect
WebSocket servers do not carry over subscriptions from dropped connections. If your client only sends the subscription message once at startup, any subsequent reconnect will result in an idle connection with zero push messages. Always place the subscribe call inside your connection handler.
04
Information to Prepare for Technical Support
- WebSocket endpoint URL (with token redacted) and exact JSON subscription payload.
- All raw frames received immediately after connecting and subscribing.
- UTC timestamp and duration of the incident.
- Programming language, WebSocket library name, and version.
Sources & Verification · 2026-10-13
Relevant endpoint, field, and exchange rules were checked against the primary specifications linked below.
Python examples passed ast.parse on Python 3.14.0. This checks syntax only; dependencies, runtime compatibility, and network responses were not tested.
Authenticated AllTick requests and production end-to-end tests were not run for this review. Record your token plan, library versions, market session, ret/trace, and observed results when reproducing these checks.
Primary specifications
Reproduce before deployment
- Monitor handshake, subscription acknowledgement, heartbeat reply, and last market timestamp separately. A healthy heartbeat during a closed session does not imply new trades.
- Test unsupported codes and over-quota subscriptions; compare requested and accepted symbol counts before diagnosing a network outage.