DTC Protocol Discussion Forum
- DTC Protocol Discussion Forum |
- Search Board |
- Control Panel |
- View My Posts / Threads |
- Direct Messages
Date/Time: Mon, 28 Nov 2022 01:29:58 +0000
Google Protocol Buffers and Python example?
View Count: 2003
|User895355 - Posts: 30|
I'm trying to get started with DTC and GPB with Python. Can someone post some example code so I can get an idea? Even just a LOGON script, or calling some market data, etc. Anything would be greatly appreciated.
|vp_ftw - Posts: 12|
This isn't mine, but I used it as a starting point reference to fill in the blanks writing a client in `go` with protocol buffers.
So far, I've got login encoding/logon/and market data going. I've hit a roadblock with TRADE_ACCOUNTS_REQUEST and ACCOUNT_BALANCE_REQUEST where i do not receive a response... Searching for solutions let me to your post.
|vp_ftw - Posts: 12|
Worthy to note, the .proto spec used in that python project are outdated (v7?). The wire structure is a relatively easy read outside of the binary encoding portions for the initial encoding request.. There's some unused code present in some of the bin_encode and bin_decode functions before protobufs were implemented if i had to guess.
Here's my work in progress from go: https://github.com/RileyR387/sc-dtc-client/blob/master/dtc/connection.go
At this moment, the logon procedure is improperly located in dtc/accountData.go
|RoadKill - Posts: 38|
the .proto spec used in that python project are outdated (v7?)That's right, you need to compile using protobuf and replace it in the right location.
|User157497 - Posts: 1|
I have been trying to implement DTC protobuf under python. Greatly inspired by https://github.com/Queeq/pydtc.git. I managed to get connected, but when it comes to decoding logon_response, i am confronted to the pack/unpacking issue of the fields.
The solution of Queed is not standard to what we would expect.
Why does the function Message.FromString not work. Could Sierra team provide code for encoding/decoding all the messages under python?
To post a message in this thread, you need to log in with your Sierra Chart account: