Login Page - Create Account

DTC Protocol Discussion Forum


Date/Time: Fri, 29 Nov 2024 14:42:25 +0000



JSON ENCODING WITH PYTHON 3.5

View Count: 3769

[2018-04-13 06:29:59]
enemyspy - Posts: 306
Hi I understand that google protocol buffers are the prefered method. However Want to make JSON work as I don't have a lot of time and would need to research the google protocol buffers. Any One used python with json encoding?

Fails when Sc client tries to parse Json logon response. See log lines:

DTC Service | Sending encoding request to server: JSON | 2018-04-13 06:08:02
DTC Service | Setting DTC encoding to JSON | 2018-04-13 06:08:02
DTC Service | Sending logon request message. | 2018-04-13 06:08:02
DTC JSON message type was not parsable. | 2018-04-13 06:08:02

encoded response output below (yes null terminating):
b'{
"OrderCancelReplaceSupported": 0,
"BracketOrdersSupported": 0,
"UsesMultiplePositionsPerSymbolAndTradeAccount": 0,
"type": 2,
"MarketDataSupported": 1,
"HistoricalPriceDataSupported": 0,
"MarketDepthUpdatesBestBidAndAsk": 1,
"SymbolExchangeDelimiter": "-",
"OCOOrdersSupported": 0,
"ProtocolVersion": 8,
"OneHistoricalPriceDataRequestPerConnection": 1,
"UseIntegerPriceOrderMessages": 0,
"LogonStatusEnum": 1,
"ResubscribeWhenMarketDataFeedAvailable": 1 ,
"MarketDepthIsSupported": 1,
"TradingIsSupported": 0,
"SecurityDefinitionsSupported": 0}\x00'

[2018-04-13 07:33:18]
enemyspy - Posts: 306
NVM I can see why using the google protocol buffers is suggested will do that instead. Would still be curious to know if the above should work though.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account