Deserialize Tick Data

Created at 14 Dec 2022, 12:58
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
KA

karol.bautrel

Joined 01.12.2022

Deserialize Tick Data
14 Dec 2022, 12:58


Hey Guys, I am trying to send and then decode data from ProtoOAGetTickDataReq. Can you tell me if I am doing it correctly, in docs there is no so much info about how deserialize data. 

 protoMsg = ProtoMessage(
                payload=message.payload,
                clientMsgId=message.clientMsgId,
                payloadType=message.payloadType,
            )

            data = protoMsg.SerializeToString()
            self.transport.write(data)

 

And after that I am trying to decode it 

 response = ProtoMessage()
                    response.ParseFromString(data)
                    deserialized_data = Protobuf.extract(response)

But I am getting 

google.protobuf.message.DecodeError: Truncated string.

Im not sure if problem is that for example ProtoMessage cant handle ProtoOAGetTickDataReq and maybe I should use different model, but is there any information which model should I use and how should I use it ? Or can you show me quick example please ? 


@karol.bautrel