|
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 |
liamroche
|
Post subject: A trick to stop strategies |
Post rating: 0
|
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.
|
|
|
|
 |
API Support
|
Post subject: Re: A trick to stop strategies |
Post rating: 0
|
Posted: Fri 09 Sep, 2016, 15:59
|
|
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.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|