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.

Best method to stop or freeze strategy on remote server (on weekends)
 Post subject: Best method to stop or freeze strategy on remote server (on weekends) Post rating: 0   New post Posted: Fri 20 Mar, 2015, 14:29 
User avatar

User rating: 1
Joined: Sun 18 Dec, 2011, 04:05
Posts: 36
Location: Spain, Madrid
Hi,

Which is the best method to stop or freeze the strategy during the weekends?. The strategy is going to run by Remote servers (dukas).

Using calendar?
Using or detecting ticks on the market?

Thank you and good trading for everyone


 
 Post subject: Re: Best method to stop or freeze strategy on remote server (on weekends) Post rating: 0   New post Posted: Fri 20 Mar, 2015, 17:31 
User avatar

User rating: 1
Joined: Sun 18 Dec, 2011, 04:05
Posts: 36
Location: Spain, Madrid
Because using https://www.dukascopy.com/wiki/#Market_Hours only checks when the market is going to be offline by setting days ahead, so, can I put to check 3 months for example or one year?

I was trying to find a way to check it all the time without setting days ahead.

Another question, is there anyway to know when Remote Strategy Stops? something like email or sms message?

thank you


 
 Post subject: Re: Best method to stop or freeze strategy on remote server (on weekends) Post rating: 0   New post Posted: Mon 23 Mar, 2015, 15:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
During weekends the strategy will not receive ticks. There is no other specific signal that market is running.


 
 Post subject: Re: Best method to stop or freeze strategy on remote server (on weekends) Post rating: 0   New post Posted: Wed 25 Mar, 2015, 22:12 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Quote:
Which is the best method to stop or freeze the strategy during the weekends?. The strategy is going to run by Remote servers (dukas).

You could create a periodic day check function within the strategy, for example. It would be able to detect if it is a weekend, and than just don't allow any trading.
There are some nice threading examples in the wiki, where you can look around how to create such things.

Quote:
Another question, is there anyway to know when Remote Strategy Stops? something like email or sms message?

You can probably use onStop().
I am however not sure, how 'strict' is the rule to call onStop() on strategy termination. In case there is a strategy crash, will it be called always?


 
 Post subject: Re: Best method to stop or freeze strategy on remote server (on weekends) Post rating: 0   New post Posted: Thu 26 Mar, 2015, 14:52 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
In order to check if a remote strategy is running, one option could be to use SDK and check strategy status using the following
        Set<IRemoteStrategyDescriptor> strategySet = c1.getRemoteStrategyManager().getStartedStrategies().get(1, TimeUnit.MINUTES).getResult(;
        for(IRemoteStrategyDescriptor remoteStrategyDescriptor : strategySet) {
            remoteStrategyDescriptor.getName();
        }


 

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