Login Page - Create Account

DTC Protocol Discussion Forum


Date/Time: Fri, 29 Nov 2024 16:42:13 +0000



Post From: JSON ENCODING WITH PYTHON 3.5

[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'