- ago
I've set up a configurable parameter for my Optimizer, however, the value entered via the GUI does not appear to be transfering to/Updating the Parameters List.

When I access the Parameters List in the ProcessConfig sub the Parameter value is unchanged.

I've noted that the change does save to the Settings File. If I close the strategy (or WL7) and opened again the previously entered user value is loaded as the default setting and displayed in the GUI.

I've also tried accessing in the Optimze sub, but the result is the same

Is this a bug, or am I looking in the wrong place?



CODE:
Public Overrides ReadOnly Property IsConfigurable As Boolean    Get       If Not IsNothing(Parameters) And Parameters.Count = 0 Then          Dim pAutoSave As New Parameter("Autosave Interval (Minutes)", ParameterTypes.Int32, 10, 1, 60)          Parameters.Add(pAutoSave)       End If       Return True    End Get End Property Public Overrides Sub ProcessConfig()    If Not IsNothing(Parameters) Then       For i = 0 To Parameters.Count - 1           ' update with user input          If Parameters(i).Name = "Autosave Interval (Minutes)" Then QueueManager.AutosaveInterval = Parameters(i).Value       Next    End If End Sub
0
1,034
Solved
2 Replies

Reply

Bookmark

Sort
Glitch8
 ( 11.08% )
- ago
#1
The intent here is that you needn't worry about overriding either of these properties or methods. Just access the Optimizer parameters internally in your class and they should assume the values adopted in the GUI. I just put together this verification using ShrinkingWindow as a test, changed the parameters from 5 to 6 and verified that they are being picked up correctly.

Also, you should add the Parameters in the Optimizer's constructor.


0
Best Answer
- ago
#2
Done...

I've moved the parameters.add to the constructor New() in VB.net rather than initialize and I've removed the ProcessConfig Override.

Updated values now show in the Parameters Object in Optimize() Sub.

Thank you.

Side note: I think the issue was the ProcessConfig Override. I just noted in the API documentation that if using this you should always call base.processConfig() to process changes. Because I was overriding the user changes were not being processed.


0

Reply

Bookmark

Sort