Hello everyone - how to activate the optimization function and trade - these keys are not active for me
Rename
You need to set up Optimization Parameters first.
This video shows you how to do it for Building Block strategies: https://youtu.be/xaUJ9tZWUcY
This video shows you how to do it for Building Block strategies: https://youtu.be/xaUJ9tZWUcY
yes - this is a video about optimizing a strategy built from blocks - I have strategies written in code - is there a video on how to optimize?
"How to" doesn't matter, the approach is the same. If you're asking rather how to create optimization paramters in code, click 'Open C# strategy code' in a Blocks-based strategy with parameters to see how they are defined.
QUOTE:Not yet, but the first step is to define your Optimization Parameters. When you do, the Optimize button will be enabled.
is there a video on how to optimize
There's a pattern you can follow in the QuickRef. Select Class: UserStrategyBase; Properties/Methods: Parameters
And, if you're going to do Walk-Forward Optimization, you also need to add this method to your code (this is for the Parameters example) -
CODE:
public override void NewWFOInterval(BarHistory bars) { smaShort = new SMA(bars.Close, Parameters[0].AsInt); smaLong = new SMA(bars.Close, Parameters[1].AsInt); }
Click "Compile". And why do define them as read-only??
You didn't follow the pattern. But since you're not using AddParameter, you can do your way, but you still need to add each Parameter to the Parameters collection.
CODE:
//e.g. Parameters.Add(_period);
You are right - thanks earned!
Your Response
Post
Edit Post
Login is required