Dukascopy
 
 
Wiki JStore Search Login

Reliability of connection state-change notifications (onMessage)
 Post subject: Reliability of connection state-change notifications (onMessage) Post rating: 0   New post Posted: Sat 21 Apr, 2012, 20:09 
User avatar

User rating: 21
Joined: Thu 19 May, 2011, 20:50
Posts: 413
Location: Germany, Munich
API Support wrote:
Hi,

If you need to monitor the platform connection in your strategy, you can use the CONNECTION_STATUS message. Please take a look at the following JForex Wiki page: https://www.dukascopy.com/wiki/index.php ... connecting.


It would be nicer to get the status itself: something like CONNECTED or DISCONNECTED


 
 Post subject: Re: Reliability of connection state-change notifications (onMessage) Post rating: 0   New post Posted: Fri 01 Apr, 2022, 00:18 
User avatar

User rating: 21
Joined: Thu 19 May, 2011, 20:50
Posts: 413
Location: Germany, Munich
It is possible to check by getContent()

          if (message.getType() == IMessage.Type.CONNECTION_STATUS){
             if (message.getContent().equals("Disconnected")) {             
             }
             if (message.getContent().equals("Connected")) {       
             }
          }


 

Jump to:  

cron
  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com