A timeout message can mean two different things: the API rejected execution, or your client stopped hearing back. Treating both as “send it again” is how one trading intention can become two orders.
For cTrader Open API, first identify which timeout you actually received. The documented TIMEOUT_ERROR is an execution timeout that is rejected; a client-side socket timeout or disconnected connection is not automatically that same API response. When the outcome is unknown, reconcile account state before you consider another submission.
Read the response, not just the word “timeout”
The cTrader Open API common-message reference defines TIMEOUT_ERROR as a deal-execution timeout that is rejected. It separately defines CANT_ROUTE_REQUEST as a lost or unsupported server connection. Those codes describe API responses. A timeout raised by your own HTTP, WebSocket, or application layer may only tell you that the client did not receive a reply in time; it does not prove what reached the server. cTrader Open API common model messages
Keep these cases separate in logs:
| What your client observed | What it establishes | Next step |
|---|---|---|
Documented TIMEOUT_ERROR response | The API returned its documented rejected-execution error | Record the rejection and inspect current account state before creating a new intent |
| Clear validation or authorization rejection | The request was rejected for the reported reason | Fix the cause; do not retry an unchanged request |
| Local timeout, dropped connection, or process restart before a response | Your client lacks a confirmed outcome | Mark the intent unknown and reconcile; do not blindly resubmit |
| Confirmed order identifier and status | The platform acknowledged an order object | Follow its current status and fills rather than creating a second order |
A response code is evidence about that response. A missing response is not a response code.
Use an intent record to make recovery boring
Before sending, persist a record for the logical order: account, symbol, side, requested volume, order type, creation time, and a unique internal intent ID. If the API supports a client-supplied correlation field, keep it stable for that intent and verify what the field actually guarantees. An identifier that helps you find an order is not necessarily a server-enforced idempotency key.
That distinction is visible in other broker APIs too. tastytrade documents an external identifier that can be queried after an uncertain submission, while warning that repeating the identifier does not itself prevent a duplicate. Alpaca documents client_order_id for tracking and retrieving an order. The field names and guarantees are API-specific; neither source establishes cTrader Open API behavior. tastytrade: Idempotency & retries · Alpaca: Working with orders
Use a small recovery state machine:
- Persist intent before sending, so a restart does not erase what the client meant to do.
- Submit once and store any response, order ID, execution event, or error against that intent.
- If the client gets no definitive result, mark it unknown, not rejected or filled.
- Query the supported order history and current positions using the strongest available identifiers and account context. Compare the result with the intended symbol, side, size, and timing.
- If you find an order, track its actual state—including partial execution—before taking another action.
- If you cannot reliably establish whether the first request exists, stop automated retries and surface the ambiguity for review.
The final step is deliberately conservative. A duplicate position is not repaired by a tidy retry counter.
Hypothetical example: the reply disappears
A cBot-facing service records an intent to open a position and sends its request. The network connection drops before the response arrives. The service cannot infer “rejected” from that silence. It records the intent as unknown, reconnects, and checks the account's available order and position records. If the records show the matching order, it follows that order's state. If they do not provide enough information to distinguish “not received” from “not yet visible,” it pauses rather than issuing a second order.
This is a workflow example, not a claim that every cTrader integration exposes the same lookup fields or history window. Confirm the exact messages and query methods supported by the API version and account connection you use.
Test the failure path before relying on it
In a demo environment, exercise the client logic with simulated lost replies, restarts, rejected requests, and delayed status updates. Check that the same intent is not submitted again simply because a timer expired. Keep the original request, response/error, order events, and reconciliation result in one trace; that makes an incident auditable rather than guesswork.
For adjacent cBot safeguards, see how to handle partial fills, why cTrader rejects an order, and how to audit a cBot decision log. realbacktesting builds cTrader trading software around results a trader can inspect and verify; that principle starts with preserving what the system actually observed.
Frequently asked
Does cTrader TIMEOUT_ERROR mean the order was rejected?
The cTrader Open API reference describes that specific error code as a deal-execution timeout that is rejected. It does not make every timeout in your client application the same response.
Should a bot retry if the network request times out?
Not until it has checked whether the original intent produced an order or position. If the API offers no reliable way to resolve the state, pause the automated path rather than assume the request failed.
Does reusing a client order ID prevent duplicates?
Not universally. An API may use an identifier for lookup without enforcing deduplication. Check the exact platform contract; do not infer idempotency from the field's name.