NRUNO Trading Automation Wiki · Question 66

How should reconnect logic work when cTrader disconnects?

Infrastructure, Cloud & PerformanceLast reviewed: 25 Aug 2026
Short answer

Reconnect logic should detect the disconnect, stop unsafe dispatch, restore authentication/session state, reconcile open orders and positions, and only then resume new commands. For Open API, cTrader recommends heartbeats at least every 10 seconds.

What this means in practice

Reconnect logic should detect the disconnect, stop unsafe dispatch, restore authentication/session state, reconcile open orders and positions, and only then resume new commands. For Open API, cTrader recommends heartbeats at least every 10 seconds. This page is specifically about “How should reconnect logic work when cTrader disconnects?”, so each scenario below is explained by its own mechanism instead of sharing one generic diagnosis.

Real-world scenarios

Scenario A — Short network drop

Reconnect is a reconciliation event. Re-read actual cTrader positions and pending orders first, then decide whether queued commands remain valid. Expire stale entries and make recovery idempotent. For Scenario A — Short network drop on question 66, use that evidence specifically to answer “How should reconnect logic work when cTrader disconnects?”; keep it separate from the evidence for the other scenarios on this page.

Scenario B — Server restart

Reconnect is a reconciliation event. Re-read actual cTrader positions and pending orders first, then decide whether queued commands remain valid. Expire stale entries and make recovery idempotent. For Scenario B — Server restart on question 66, use that evidence specifically to answer “How should reconnect logic work when cTrader disconnects?”; keep it separate from the evidence for the other scenarios on this page.

Scenario C — Open position exists during reconnect

Reconnect is a reconciliation event. Re-read actual cTrader positions and pending orders first, then decide whether queued commands remain valid. Expire stale entries and make recovery idempotent. For Scenario C — Open position exists during reconnect on question 66, use that evidence specifically to answer “How should reconnect logic work when cTrader disconnects?”; keep it separate from the evidence for the other scenarios on this page.

What to check

  • target connector/account identity
  • exact broker symbol
  • normalized order parameters
  • cTrader response and final position/order state

Practical rule

For “How should reconnect logic work when cTrader disconnects?”, change only the first layer whose evidence no longer matches the intended action. Preserve signal identity, timestamps and final cTrader state, and reproduce execution-affecting changes on demo before live use.

Decision summary

Direct answer: Reconnect logic should detect the disconnect, stop unsafe dispatch, restore authentication/session state, reconcile open orders and positions, and only then resume new commands. For Open API, cTrader recommends heartbeats at least every 10 seconds.

Next action: Match the observed evidence to one scenario above, test that mechanism independently on demo and keep the result traceable with one signal ID.

Primary sources

Need a TradingView → cTrader execution route?

NRUNO routes your TradingView instructions to cTrader. Your strategy and signal logic remain yours.