Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Running a strategy 24 hours a day
 Post subject: Running a strategy 24 hours a day Post rating: 0   Post Posted: Mon 07 Nov, 2011, 14:26 

User rating: 0
Joined: Wed 18 May, 2011, 08:40
Posts: 43
Location: RU
Hi, everybody

I plan to run my strategy 24 hours a day. The program shouldn't exit if an exception has been caught and can be handled or another common problem occurred. At the moment there are following exceptional situations in my list:
- Internet connection is lost
- The message "Your order has been rejected due to validation failure. Your session has expired, please relogin." comes from the server
- Exception in thread "FirstTickOnWeekends" java.lang.NullPointerException because trading on weekends isn't possible

It would be interesting to know if there are another common problems which should/can be handled programmatically. Perhaps somebody has already implementation for this. For example a class which implements ISystemListener and takes care for handling all these exceptions. Thanks in advance.


 
 Post subject: Re: Running a strategy 24 hours a day Post rating: 0   Post Posted: Tue 08 Nov, 2011, 09:19 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
trottel wrote:
- Internet connection is lost
See onDisconnect in the following example:
https://www.dukascopy.com/wiki/index.php ... m_listener
trottel wrote:
- The message "Your order has been rejected due to validation failure. Your session has expired, please relogin." comes from the server
If you need to reauthorize, then you need to stop the process within which the strategy runs and start a new one, since at the current implementation one can force disconnect only by stopping the process. Hence, you need an application which handles multiple processes.
trottel wrote:
- Exception in thread "FirstTickOnWeekends" java.lang.NullPointerException because trading on weekends isn't possible
See the last post here:
viewtopic.php?f=65&t=29913


 
 Post subject: Re: Running a strategy 24 hours a day Post rating: 0   Post Posted: Tue 08 Nov, 2011, 09:29 

User rating: 0
Joined: Wed 18 May, 2011, 08:40
Posts: 43
Location: RU
API Support wrote:
trottel wrote:
- Internet connection is lost
See onDisconnect in the following example:
https://www.dukascopy.com/wiki/index.php ... m_listener
trottel wrote:
- The message "Your order has been rejected due to validation failure. Your session has expired, please relogin." comes from the server
If you need to reauthorize, then you need to stop the process within which the strategy runs and start a new one, since at the current implementation one can force disconnect only by stopping the process. Hence, you need an application which handles multiple processes.
trottel wrote:
- Exception in thread "FirstTickOnWeekends" java.lang.NullPointerException because trading on weekends isn't possible
See the last post here:
viewtopic.php?f=65&t=29913


Thanks for info!


 

Jump to:  

  © 1998-2025 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