Regular disconnects in FIX protocol without notification
Regular disconnects in FIX protocol without notification
07 May 2024, 21:26
I am writing to inquire about the regular disconnects from the server without notifications in the FIX protocol.
Our client implementation is in Python, connecting to the demo server demo2.p.ctrader.com:5102 with the account demo.ctrader.4332407 for receiving market data (QUOTE). After a successful connection and passing the Logon process, we subscribe to receive market data, and updates are processed normally.
Heartbeats and test requests are also sent according to the protocol.
However, after some time (ranging from minutes to hours), there is a silent disconnect from the server.
The server stops sending data, heartbeats, and does not respond to test requests, leading to the TCP connection being dropped. The same behavior occurs when connecting to the server for order execution (SenderSubID = TRADE).
I have found several posts on the forum discussing similar issues, but none of them provide a clear solution. This problem has been reported on the forum since 2016, and it is critical for us to understand what the problem is, whether it can be resolved, and what methods can be used to do so.
Thank you in advance for your attention to this matter.
Additional details.
Client code executed on a different manner run on local PC, on VPS, in a docker container on two different hosting (in Amsterdam and in Germany).
cTrader client connected from local PC to server shows that the connection established via London-01 proxy with 49/1ms latency:
Below is an example log showing the end of the communication and the disconnect.
2024-05-07 12:30:06.052 | DEBUG | async_fix.infrastructure.fix_msg_worker:process:122 - RECV [Worker:FIX.4.4:demo.ctrader.4332407:QUOTE:cServer:QUOTE] <<<, MsgType: MARKETDATASNAPSHOTFULLREFRESH, Seq: 24059, 8=FIX.4.4|9=139|35=W|34=24059|49=cServer|50=QUOTE|52=20240507-12:30:06.015|56=demo.ctrader.4332407|57=QUOTE|55=2|268=2|269=0|270=1.25484|269=1|270=1.25487|10=015|
2024-05-07 12:30:06.556 | DEBUG | async_fix.infrastructure.fix_msg_worker:process:122 - RECV [Worker:FIX.4.4:demo.ctrader.4332407:QUOTE:cServer:QUOTE] <<<, MsgType: MARKETDATASNAPSHOTFULLREFRESH, Seq: 24060, 8=FIX.4.4|9=138|35=W|34=24060|49=cServer|50=QUOTE|52=20240507-12:30:06.528|56=demo.ctrader.4332407|57=QUOTE|55=1|268=2|269=0|270=1.0773|269=1|270=1.07732|10=209|
2024-05-07 12:30:10.317 | DEBUG | async_fix.infrastructure.fix_msg_worker:send_message:89 - SEND [Worker:FIX.4.4:demo.ctrader.4332407:QUOTE:cServer:QUOTE] >>>, MsgType: HEARTBEAT, Seq: 1761, 8=FIX.4.4|9=97|35=0|49=demo.ctrader.4332407|56=cServer|50=QUOTE|57=QUOTE|34=1761|52=20240507-12:30:10.317|112=1|10=003|
2024-05-07 12:30:18.557 | DEBUG | async_fix.infrastructure.fix_msg_worker:send_message:89 - SEND [Worker:FIX.4.4:demo.ctrader.4332407:QUOTE:cServer:QUOTE] >>>, MsgType: TESTREQUEST, Seq: 1762, 8=FIX.4.4|9=97|35=1|49=demo.ctrader.4332407|56=cServer|50=QUOTE|57=QUOTE|34=1762|52=20240507-12:30:18.556|112=1|10=018|
2024-05-07 13:00:22.152 | DEBUG | async_fix.infrastructure.fix_msg_worker:send_message:89 - SEND [Worker:FIX.4.4:demo.ctrader.4332407:QUOTE:cServer:QUOTE] >>>, MsgType: HEARTBEAT, Seq: 1763, 8=FIX.4.4|9=97|35=0|49=demo.ctrader.4332407|56=cServer|50=QUOTE|57=QUOTE|34=1763|52=20240507-13:00:22.152|112=2|10=004|
2024-05-07 13:00:32.153 | DEBUG | async_fix.infrastructure.fix_msg_worker:send_message:89 - SEND [Worker:FIX.4.4:demo.ctrader.4332407:QUOTE:cServer:QUOTE] >>>, MsgType: HEARTBEAT, Seq: 1764, 8=FIX.4.4|9=97|35=0|49=demo.ctrader.4332407|56=cServer|50=QUOTE|57=QUOTE|34=1764|52=20240507-13:00:32.153|112=2|10=007|
2024-05-07 13:00:37.271 | ERROR | async_fix.infrastructure.tcp_asyncio:receive_tcp_message:64 - [TCPConnection send_msg] Error receiving message from demo2.p.ctrader.com:5202: Connection closed by peer