Login Page - Create Account

DTC Protocol Discussion Forum


Date/Time: Fri, 29 Nov 2024 12:40:03 +0000



Google Protocol Buffers and Python example?

View Count: 3388

[2020-10-03 22:49:29]
User895355 - Posts: 55
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.
[2020-10-13 12:52:13]
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.

https://github.com/Queeq/pydtc.git

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.
[2020-10-13 13:44:18]
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
[2020-12-25 02:51:23]
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.
[2021-02-18 11:14:15]
User157497 - Posts: 3
Hi,
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?

Many thanks

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

Login

Login Page - Create Account