Skip to content
AllTick
Troubleshooting

WebSocket Connected but No Data

Troubleshoot silent WebSocket connections across five checkpoints: subscription payload, symbol format, endpoint URL, trading hours, and heartbeats.

Updated:
Maintained by:AllTick Technical Team
Audience:Developers whose WebSocket connection opens without receiving market ticks

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

1Verify the subscription message was sent: log the exact JSON sent and inspect the server acknowledgment frame.
2Verify symbol notation: e.g., 700.HK for HK equities, AAPL.US for US equities, EURUSD for FX.
3Verify endpoint alignment: use quote-stock-b-ws-api for stocks and quote-b-ws-api for FX, metals, and commodities.
4Verify trading hours: equities do not push new trade ticks during market close, weekends, or HKEX lunch breaks.
5Verify heartbeats: send application heartbeats (cmd_id 22000) every 10 seconds so the server keeps the stream alive.

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.

pythonpython
import asyncio, json, os, uuid
import websockets
async 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.

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.