We provide real-time data for stocks, indices and ETFs/ETNs through our TCP server. Follow the protocol below to connect your TCP client to the server, request and receive a real-time stock data feed.
You must be granted explicit permission (through your public Ip) in order to connect to the server.
Connect to the host:
Listen to the port:
A successfull connection will be greeted with the message "TallacOptions 6670\r\n".
After successfully connecting to the server, send the ticker of the instrument you want appended with the '\n' character. You'll then receive a stream of length-prefixed messages containing live data for the instrument.
Each message is prepended with its length. The length's format is "4-byte signed little-endian" (i.e., "int" in C#).
A message itself consists of data fields delimited by the '\0' character. The fields are sent in this order: Last, LastSize, Bid, BidSize, Ask, AskSize, Volume, Open, High and Low.
Each TCP client can only handle one ticker. Once a client is connected and set to fetch data for a ticker, it cannot be modified to fetch data for another ticker.
You can create multiple clients, each handling a different ticker.
The server will drop a connection when it fails to send data to the client. Check the client's connectivity by sending a keep-alive message to the server and take action when the sending fails.
After the live stream has started the client should only send keep-alive messages. The keep-alive message processing frequency is 30 seconds. The message should be maximum 10 characters long.
The keep-alive message will be echoed with an empty message (length=0) by the server. So zero-length messages should be discarded from the normal data stream.
A barebones sample for connecting to the server and streaming live data.
A more complex example featuring keep-alive and reconnecting.