Support Board
Date/Time: Tue, 21 Jan 2025 04:05:46 +0000
Post From: Connect to SierraChart real time data from Java program
[2018-07-18 03:19:20] |
Thomson - Posts: 3 |
Hi, I am developing a Java program to collect the real time data from SierraChart. I am able to Logon and send/receive the heartbeat message to/from the server by using JSON continuously. However, when I send the Market Data Request, the server has no response and does not send the SNAPSHOT/Data data as expected. Below is the Server log: ========================================================================================================================== DTC Protocol server | Incoming connection from 127.0.0.1. | 2018-07-18 10:56:18 DTCServer (11) | Creating socket. | 2018-07-18 10:56:18 DTC client #1. 127.0.0.1 | Requested heartbeat interval: 40 | 2018-07-18 10:56:18 DTC client #1. Sample Application. 127.0.0.1 | Received logon request. | 2018-07-18 10:56:18 DTC client #1. Sample Application. 127.0.0.1 | Low bandwidth mode has been requested. | 2018-07-18 10:56:18 DTC client #1. Sample Application. 127.0.0.1 | Sent successful Logon response message to client. Username: . Result text: Connected to SC DTC Protocol server. Service=scdataallservices | 2018-07-18 10:56:18 ========================================================================================================================== Below is my Java Console Log: ========================================================================================================================== Sending: {"Type":1,"Integer_1":1,"HeartbeatIntervalInSeconds":60,"ClientName":"Sample Application"} TCPLink is running Sending: {"Type":101,"RequestAction":"SUBSCRIBE","SymbolID":1,"Symbol":"HSN18"} Sending: {"Type":3} Receiving:{"Type":2,"ProtocolVersion":8,"Result":1,"Integer_1":0,"MarketDepthUpdatesBestBidAndAsk":0,"TradingIsSupported":0,"OCOOrdersSupported":0,"OrderCancelReplaceSupported":0,"SecurityDefinitionsSupported":1,"HistoricalPriceDataSupported":0,"ResubscribeWhenMarketDataFeedAvailable":0,"MarketDepthIsSupported":1,"OneHistoricalPriceDataRequestPerConnection":0,"BracketOrdersSupported":0,"UseIntegerPriceOrderMessages":0,"UsesMultiplePositionsPerSymbolAndTradeAccount":0,"MarketDataSupported":1,"ResultText":"Connected to SC DTC Protocol server. Service=scdataallservices","ReconnectAddress":"","ServerName":"SC DTC Server","SymbolExchangeDelimiter":""} END Sending: {"Type":3} Receiving: {"Type":3,"NumDroppedMessages":0,"CurrentDateTime":1531882618} END Sending: {"Type":3} Receiving: {"Type":3,"NumDroppedMessages":0,"CurrentDateTime":1531882658} END ========================================================================================================================== However, when I changed the SymbolID in the request message to zero, the server can send the reject message back. If I changed an invalid Symbol (e.g. ABC), The server will not response anything again. Below is the Server log: ========================================================================================================================== Sending: {"Type":101,"RequestAction":"SUBSCRIBE","SymbolID":0,"Symbol":"HSN18"} Receiving: {"Type":103,"SymbolID":0,"RejectText":"Symbol ID is zero."} ========================================================================================================================== Is there anything in the SierraChart I need to set or subscribe further? Thank you in advance. |