WebSocket Spots Subscription Not Working

Created at 17 Dec 2023, 22:05
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
vasile.peste's avatar

vasile.peste

Joined 07.06.2021

WebSocket Spots Subscription Not Working
17 Dec 2023, 22:05


Hello, it seems that the spot subscription is not working on the WebSocket channel.

The following is a log of the server response after requesting a spot subscription

 

WebSocket | Sending Message {"clientMsgId":"77ded6da-639e-400b-b685-d9858745e568","payloadType":2127,"payload":{"ctidTraderAccountId":36624017,"symbolId":114,"subscribeToSpotTimestamp":true}}
Message


WebSocket | Received Message {"payloadType":2131,"payload":{"ctidTraderAccountId":36624017,"symbolId":114,"bid":4196895000,"ask":4198095000,"sessionClose":4252095000,"timestamp":1702850078162}}
 

 

After this exchange of messages, no further Spot events are sent, just the first one.

And as you can notice,

the Payload (2127 PROTO_OA_SUBSCRIBE_SPOTS_REQ) is not receiving a response (PROTO_OA_SUBSCRIBE_SPOTS_RES 2128)

 

Can you please investigate this issue?

Thank you


@vasile.peste
Replies

PanagiotisCharalampous
19 Dec 2023, 10:39

Hi Vasile,

Is it possible to provide us with a complete log of exchanged messages or at least a more expanded one?

Best regards,

Panagiotis


@PanagiotisCharalampous

vasile.peste
22 Dec 2023, 08:36

RE: WebSocket Spots Subscription Not Working

PanagiotisCharalampous said: 

Hi Vasile,

Is it possible to provide us with a complete log of exchanged messages or at least a more expanded one?

Best regards,

Panagiotis

 

It seems the issue doesn't affect only Spot events but also Execution events!

I can provide an easier way to reproduce:

  1. Connect to the WebSocket server
  2. Authenticate the application and the trading account
  3. Place a limit/stop order
  4. Cancel it from the Web terminal or any other client
  5. The Execution event is not sent to the WebSocket connection

 

If it's useful, we are using the FTMO broker. If you cannot reproduce, we will provide more detailed logs as requested

If you can reproduce it, it's clear that it becomes an urgent issue…

Thank you!


@vasile.peste

PanagiotisCharalampous
22 Dec 2023, 13:03

RE: RE: WebSocket Spots Subscription Not Working

vasile.peste said: 

PanagiotisCharalampous said: 

Hi Vasile,

Is it possible to provide us with a complete log of exchanged messages or at least a more expanded one?

Best regards,

Panagiotis

 

It seems the issue doesn't affect only Spot events but also Execution events!

I can provide an easier way to reproduce:

  1. Connect to the WebSocket server
  2. Authenticate the application and the trading account
  3. Place a limit/stop order
  4. Cancel it from the Web terminal or any other client
  5. The Execution event is not sent to the WebSocket connection

 

If it's useful, we are using the FTMO broker. If you cannot reproduce, we will provide more detailed logs as requested

If you can reproduce it, it's clear that it becomes an urgent issue…

Thank you!

Hi Vasile,

We would appreciate it if you could send us the logs.

Best regards,

Panagiotis


@PanagiotisCharalampous

vasile.peste
23 Dec 2023, 05:07 ( Updated at: 31 Dec 2023, 08:50 )

RE: RE: RE: WebSocket Spots Subscription Not Working

Redacted


@vasile.peste

vasile.peste
31 Dec 2023, 08:15 ( Updated at: 31 Dec 2023, 09:21 )

Redacted

 

It is working as expected now, for future devs, please make sure that keys exists before getting them with the native Json API of .NET

We were trying to always get “clientMsgId” which is not specified in Events, and leaded to exceptions being thrown!


@vasile.peste

jayjaye
21 Feb 2024, 20:46 ( Updated at: 22 Feb 2024, 07:46 )

RE: WebSocket Spots Subscription Not Working

vasile.peste said: 

Redacted

 

It is working as expected now, for future devs, please make sure that keys exists before getting them with the native Json API of .NET

We were trying to always get “clientMsgId” which is not specified in Events, and leaded to exceptions being thrown!

Would you mind providing more information on this? With no clientMsgId how did you go about getting the message, is it ignoring the clientMsgId and trying to see if it can be marshaled directly on the proto message type or?


@jayjaye

jayjaye
21 Feb 2024, 20:46 ( Updated at: 22 Feb 2024, 07:46 )

RE: WebSocket Spots Subscription Not Working

vasile.peste said: 

Redacted

 

It is working as expected now, for future devs, please make sure that keys exists before getting them with the native Json API of .NET

We were trying to always get “clientMsgId” which is not specified in Events, and leaded to exceptions being thrown!

Would you mind providing more information on this? With no clientMsgId how did you go about getting the message, is it ignoring the clientMsgId and trying to see if it can be marshaled directly on the proto message type or?


@jayjaye