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.

Programmatical strategy close
 Post subject: Programmatical strategy close Post rating: 0   New post Posted: Tue 05 Jan, 2010, 13:58 

User rating: 0
Joined: Mon 12 Oct, 2009, 10:03
Posts: 4
Hi.

My q is following:
how can I programmatically close strategy?
(- , strategy done it's task and need to be closed.) what code should I use?
thx,


 
 Post subject: Re: Programmatical strategy close Post rating: 0   New post Posted: Wed 06 Jan, 2010, 13:57 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
There is a method in IContext to stop your strategy. Try this:
context.stop();


 
 Post subject: Re: Programmatical strategy close Post rating: 0   New post Posted: Thu 07 Jan, 2010, 16:40 

User rating: 0
Joined: Mon 12 Oct, 2009, 10:03
Posts: 4
after doing context.stop it seams that it does not closes completely - strategy context menu still says stop (start is disabled), but pressing stop does do nothing - so after that there is no way to stop/start strategy any more. Only way - restart Marketplace app.

Any ideas why?


 
 Post subject: Re: Programmatical strategy close Post rating: 0   New post Posted: Fri 08 Jan, 2010, 17:12 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
make sure you are not holding strategy thread, it should be free to be able to call onStop method. Also make sure you close all resources (like running threads, timers) in onStop method


 

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