Server.IsConnected value and it was set to true and not false

Created at 22 Jan 2022, 21:12
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!
EY

eynt

Joined 08.05.2020

Server.IsConnected value and it was set to true and not false
22 Jan 2022, 21:12


While calling the ModifyStopLossPrice method I recived an error:

Request to amend position PID66035739 (SL: 4.6188) is REJECTED with error "DISCONNECTED" (with a timeout on the tradeResult.Error property).

It seems that the server was disconnected however I checked for the Server.IsConnected value and it was set to true and not false

 

Thanks


@eynt
Replies

amusleh
24 Jan 2022, 09:25

Hi,

The Server may got disconnected after your check, it can happen and it's normal.

You should not check Server.IsConnected, just execute your trading action and check it's TradeResult, if something went wrong take appropriate action.


@amusleh