Help getting started with OpenAPI Python
28 May 2023, 03:14
I have two demo accounts in cTrader (IC Markets and ICM Capital). I would like to build a hello world that from Python on my computer sets an order to buy 0.01 lot of XAUUSD at market price, with a given target price and stop loss. I would like ot use Open API in Python. I read the documentation and I applied for an OpenAPI application a few days ago, but I do not have an answer yet. I did not set any Redirect URI, as I did not know how to choose one. I am not sure why an approval is needed, as the documentation says it is a free API to use, to build applications. I do ont want to build a full application, but just locally to build some signals and then place and close the trades automatically. Would you please be able to help me get started?
Thank you very much,
03 Jun 2023, 10:33
Hello, thank you. I know that page and I tried the code, but I am not sure what these credentials mean and how to get them.
request.clientId = "Your application Client ID" request.clientSecret = "Your application Client secret"
By my application does it mean my cTrader demo account for the FixAPI?
I guess not and OpenAPI I need to get a key from cTrader? I read here
That I need to
> After deciding the purpose of your application and its key functionality, you should be ready to register the service at the cTrader Open API Portal. You can read a detailed overview of this process in a separate guide.
I did that and I have an application for one week with no answer. Here is what I asked. I am not clear what they actually want. I do not build a formal app for others. Just for me to be able to place and close some trades. They ask for a redirect URI. What is a redirect URI and where it is needed? I could run my script from my computer, or from a VPS server, so the IP would change.
After we set this up, the webside does not show an example how to actually place a buy market trade with a target price and stop loss. It just has an example of how to connect to the server. A complete hello world example would be very useful to me how to get started. After that I can develop in Python further.
If there is a way I can have a short call with someone, or even a live chat, that would be very useful to me. Thank you,