Open API 2.0 C++ example

Created at 06 Apr 2019, 13:46
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!
VI

viniciusfre

Joined 28.12.2018

Open API 2.0 C++ example
06 Apr 2019, 13:46


Hi,

I would like to share my work with the community. This is a Open API 2.0 C++ template: https://github.com/vinifr/ctraderOpenAPI. It was designed for Linux systems and gcc compiler.

It was made for those dont want to use C# or Java examples. ;)


@viniciusfre
Replies

PanagiotisCharalampous
10 Apr 2019, 15:20

Ηι viniciusfre,

Thanks this is a very useful contribution to the community.

Best Regards,

Panagiotis


@PanagiotisCharalampous

viniciusfre
10 Apr 2019, 17:58

Hi Panagiotis,

The code is mostly based on C# sample. Everything is working fine: send messages and receive messages. Heart beat too.

But CreateAccountListRequest()-->ProtoOAGetAccountListByAccessTokenReq() is the only message is not working and I did not figure out yet.

ProtoMessage OpenApiMessagesFactory::CreateAccountListRequest(string token)
{
    ProtoOAGetAccountListByAccessTokenReq _msg;
    string msg_str;
    _msg.set_accesstoken(token);
    _msg.SerializeToString(&msg_str);

    return CreateMessage(_msg.payloadtype(), msg_str);
}

I am receiving only the token back from server. I was expecting the list of IDs: ctidTraderAccountIds. Any idea what is the issue?

Thanks.


@viniciusfre