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:
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
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
Rename
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.
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.
Your Response
Post
Edit Post
Login is required