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.

A trick to stop strategies
 Post subject: A trick to stop strategies Post rating: 0   New post Posted: Fri 09 Sep, 2016, 12:16 

User rating: 1
Joined: Tue 14 Jan, 2014, 16:13
Posts: 21
Location: United KingdomUnited Kingdom
I have a problem with testing a complex strategy that does a lot of calculation when started that any attempt to stop the strategy does not succeed until the calculation is completed. This is surprising to me, as I would have thought the system would be written in a way that permits a calculation to be interrupted. Since it is not, the question is how can code be written to specifically allow a strategy to be stopped during a calculation? The sort of thing I am imagining is a line of code to be executed at reasonably spaced intervals that will permit the strategy to be stopped even if there is more calculation to be done?

Any ideas? Should be of quite broad interest.


 
 Post subject: Re: A trick to stop strategies Post rating: 0   New post Posted: Fri 09 Sep, 2016, 15:59 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
In general this bigger workload needs to be split into several smaller pieces. Smaller work items could be iterated in a loop. On each iteration we would check if the work needs to be stopped and break out of the loop when needed.


 

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