- ago
Hello everyone - how to activate the optimization function and trade - these keys are not active for me

0
828
Solved
9 Replies

Reply

Bookmark

Sort
Cone8
 ( 6.32% )
- ago
#2
You need to set up Optimization Parameters first.

This video shows you how to do it for Building Block strategies: https://youtu.be/xaUJ9tZWUcY
0
- ago
#3
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?
0
- ago
#4
"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.
0
Cone8
 ( 6.32% )
- ago
#5
QUOTE:
is there a video on how to optimize
Not yet, but the first step is to define your Optimization Parameters. When you do, the Optimize button will be enabled.

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);       }
0
- ago
#6
0
- ago
#7
Click "Compile". And why do define them as read-only??
0
Cone8
 ( 6.32% )
- ago
#8
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);
1
Best Answer
- ago
#9
You are right - thanks earned!
0

Reply

Bookmark

Sort