Replies

depot051
09 Mar 2018, 17:17

RE:

Any progress or roadmap for Open API v2.0 ?

Panagiotis Charalampous said:

Hi BeardPower, 

We are currently designing Open API v2.0. Not all decisions have been made yet, therefore I reserve myself to answer your questions at a later stage. However the community's feedback will be taken into consideration seriously during design and development.

Best Regards,

Panagiotis

 


@depot051

depot051
20 Feb 2018, 15:00

Protocol buffer doesn't support Python properly, you have to modify it manually and install pure python protocol buffer implementation (because C++ scoping rules ruins Python) to get them work.

pip uninstall protobuf

pip install --no-binary protobuf protobuf

And compile those proto files seperately. I don't know why that's the case.

protoc --proto_path=ctrader/open-api-proto-lib --python_out=ctrader/proto_gen ctrader/open-api-proto-lib/OpenApiModelMessages.proto ctrader/open-api-proto-lib/OpenApiMessages.proto

protoc --proto_path=ctrader/open-api-proto-lib --python_out=ctrader/proto_gen ctrader/open-api-proto-lib/CommonModelMessages.proto ctrader/open-api-proto-lib/CommonMessages.proto

The last problem is how generated Python code import model modules isn't correct. Add relative path by hand to import code as belows

from . import ... as ...

That's how I get it work


@depot051

depot051
20 Mar 2017, 10:57

I got the answer from customer support. It's not that complex. The unit of swap is shown by pips, not quote currency.

The correct formula is:

swap * 10^(-pip_position) * quantity

1.1 * 10^(-2) * 20 = 0.22


@depot051