Is it possible to check if ctrader is connected or not, or have action on reconnect trough c#?

Created at 23 Jul 2023, 03:25
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!
LA

lagostada

Joined 20.02.2023

Is it possible to check if ctrader is connected or not, or have action on reconnect trough c#?
23 Jul 2023, 03:25


Dear,

 

Is it possible to check if ctrader is connected or not, or have action on reconnect trough c#?

 

Edit: This is because the timer actions repeat indefinitely, since, in such as the below example, _interval1 doesn't get updated. I'm trying to avoid this situation if for some reason the network is not connected.

private void Timer_TimerTick() 

{

   if (_interval1.AddSeconds(Interval1) < Server.Time) 

   { Print("Interval 1 Triggered"); _interval1 = Server.Time; } 

}

source: cTrader Forum - use multiple timers and events OnTimer ()

 

Kind regards,


@lagostada
Replies