Frequently Asked Questions¶
This page contains frequently asked questions about the cTrader Open API and the answers to these questions.
In this page you will find frequently asked questions by API users
Why do I get the 429 error response?¶
The 429 error response means that the user has sent too many requests in a given amount of time.
You can review the current request rate limitations on the 'Getting Started' page.
Why does my application get disconnected frequently?¶
Applications are disconnected by the server after some time of inactivity. To avoid getting disconnected from the server, make sure that you send a heartbeat to the server at least once every 10 seconds.
Why cannot I connect to API during weekends?¶
Sometimes we do maintenance and upgrades during weekends, and the API is inacccessible down during the maintenance time.
Why do I get errors in messages serialization/deserialization with Google Protocol Buffers?¶
Please read the 'Sending/Receiving Protobuf Messages' tutorial.
Can I refresh my access token before its expiry?¶
Yes, you can refresh an access token before or after its expiry. To learn more, please consult the account authentication guide.
What is the expiration time of a refresh token?¶
The refresh token is valid forever until you use it to refresh an access token or if you re-authorize your cTrader ID and trading accounts.
What is the difference between a trading account's login number and ID?¶
The login number is used for UI purposes, it has no use case in the API. However, you may choose to display account login numbers in your application accounts list or equivalent control.
The trading account ID (
ctidTradingAccountId) is the parameter used for sending/receiving several important API messages.
If there were no incoming ticks, will the cTrader backend still return trend bars for the time period?¶
No, trend bars are only created if there are incoming ticks.
How do I get the latest bid/ask prices for a symbol?¶
To get the latest bid/ask prices, you can send the ProtoOASpotEvent. The response to this message is returned even if the market is currently closed.
How do I calculate profit/loss for a position?¶
Please read our profit/loss calculation tutorial.
Can I use Open API on a client-side Web environment like a Web assembly app?¶
Yes, you can use the WebSocket protocol to connect to the API when accessing it in such environments.
From where should I get notified when there is a change in the API?¶
Please follow the Open API Proto message files repository and its releases.
How can I contribute?¶
You are encouraged to fork our SDKs to create your own Open API packages. If you think you have something worthwhile, please contact us and we will add your improvements to our official documentation.