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.

Abort Historical Tester run from code
 Post subject: Abort Historical Tester run from code Post rating: 0   New post Posted: Mon 06 Dec, 2010, 03:55 

User rating: 1
Joined: Sun 05 Dec, 2010, 08:44
Posts: 21
I would like to have a Historical Tester run aborted from within the Strategy code if a specified condition is met. This would be useful during Optimization so that CPU cycles would be saved for other passes, ultimately saving a lot of time overall.

The option "Stop Strategies on Exception" is checked however even after I write code to throw a JFException in orderto try to halt the Tester, the Historical Tester continues to read new ticks and the Message log is flooded with the Exception message, so the Tester is not completely aborted after an exception.

Is there some function to completely abort an Historical Tester run (or equivalently, an Optimization pass)?


 
 Post subject: Re: Abort Historical Tester run from code Post rating: 0   New post Posted: Mon 06 Dec, 2010, 15:43 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
Please use IContext.stop() method to stop the Historical Tester run.
try {
    // Your code here               
} catch (Exception e) {
    context.stop();
}


 

Jump to:  

cron
  © 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