- ago
Hello,
I want to skip some of parameter combinations in my optimization backtest process.
On forum there is a post regarding cancelling the strategy run - https://www.wealth-lab.com/Discussion/Cancel-strategy-run-programmatically-7205
So I wrote this code to skip some parameter values from optimizing:
CODE:
public override void BacktestBegin() { var a = Parameters[0].AsDouble; var b = Parameters[1].AsDouble; if (a > b) { throw new Exception("Canceled"); } }

And this code doesn't cancel the backtest strategy run... It continues.
Are there any other way to cancel an optimization of unwanted parameter combinations?
Thank you
0
327
1 Replies

Reply

Bookmark

Sort
- ago
#1
You could test for the condition in the very beginning of the Execute method and simply return.

Edit: By the way, don't throw exceptions, they're slow and cause performance issues. Its not really a good way to handle what you don't want to do.
0

Reply

Bookmark

Sort