WebSocket

Heartbeat and Subscription

Describes ping/pong, heartbeat, and subscription listing for FastConnect WebSocket.

Heartbeat

The server sends heartbeat periodically to verify the client is still online. The client must respond with the correct format to keep the session alive.

Channel used

HEARTBEAT

Ping from server

{
  "method": "PING",
  "channel": "HEARTBEAT",
  "time": "dd-mm-yyyy hh-mm-ss"
}

Pong from client

{
  "method": "PONG",
  "channel": "HEARTBEAT",
  "time": "dd-mm-yyyy hh-mm-ss"
}

LIST_SUBSCRIPTION

Request:

{
  "method": "LIST_SUBSCRIPTION"
}

Sample response (scope summary):

{
  "trading": "order.*;portfolio.123456",
  "data": "trade.*;quote.*;room.*"
}

Subscribe topic

{
  "method": "SUBSCRIBE",
  "channel": "DATA|TRADING",
  "topics": ["trade.SSI@tick", "quote.SSI@tick", "order.0901351"]
}

Unsubscribe topic

{
  "method": "UNSUBSCRIBE",
  "channel": "DATA|TRADING",
  "topics": ["trade.SSI@tick", "order.0901351"]
}

List current subscriptions

{
  "method": "LIST_SUBSCRIPTION"
}

Topic convention

  • order.<accountNo>
  • portfolio.<accountNo>
  • trade.<symbol>@tick|1m|5m
  • trade.index.<index_code>@tick|1m|5m
  • indexsummary.<index_code|*>
  • quote.<symbol>@tick
  • room.<symbol|*>
  • put.<symbol|*>
  • oddlot.<symbol>
  • market.<group|exchange>

On this page