- ago
I'd like to duplicate the User Select/Choice for Metric that apears in the shrinking window optimizer

Is there example code?

0
741
Solved
2 Replies

Reply

Bookmark

Sort
- ago
#1
You want a ComboBox for your own Optimizer?

Or a ComboBox with all "Selected Metrics"?

Please elaborate....
0
- ago
#2
@DrKoch, yes this is for my own optimizer.

I've made a little progress since my original post.

I now understand how to create a parameter of ParameterType.StringChoice which apears as a dropbox/combobox on the config window.

I am also able to access a list of basic scorecard metrics with the below code.



CODE:
Public Sub New() Dim scb As New BasicScoreCard Dim p1 As New Parameter("Metric to Optimize", ParameterTypes.StringChoice, "Choose Metric") p1.Choices = scb.MetricNames Parameters.Add(p1) End Sub


My questions is:

How do I access a complete list of All Metrics or All Selected (on Preferences / Metric Columns). I'm sure its simpe, but I can't find it.

Unfortunately StrategyOptimizer.OptimizerHost.MetricNames is null in the New() constructor.

I can access metrics via the StrategyOptimizer.OptimizerHost.MetricNames in the Initialize() method, however this is called after "Start Optimization" is clicked by the user. In order to add metrics to the drop box believe I need access to a list during the New() constructor.

Update: I have located the ScoreCardFactory.SelectedMetrics list whch is available in the NEW constructor. This provides what I need.

CODE:
Public Sub New() Dim p1 As New Parameter("Selected Metrics", ParameterTypes.StringChoice, "Choices") p1.Choices = ScoreCardFactory.SelectedMetrics Parameters.Add(p1) End Sub


0
Best Answer

Reply

Bookmark

Sort