Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to read in optimization parameters ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to read in optimization parameters ?

    Dear All,

    When trying to use a third party add-on package called "GeneticSharp" to run some Genetic Algorithm on NT 8, the first thing I need to do is to read in the optimization parameters. Like the range of the parameters, the increments etc. I read the code of Default Optimizer and got some fragments, for example:
    Code:
    Parameter parameter = Strategies[0].OptimizationParameters[index];
    
    parameter.Value = (double) parameter.Min + i * parameter.Increment;
    I tried to see how this works by printing the parameters to output window but failed. I added the print command here:

    Code:
    if (parameter.ParameterType == typeof(int))
                    {
                        if ((int) parameter.Min + i * parameter.Increment > (int) parameter.Max + parameter.Increment / 1000000)
                            return;
                        parameter.Value = (int) parameter.Min + i * parameter.Increment;
    
                        Print(string.Format("Iteration NO {0}, Parameter Value {1}",index,parameter.Value));
                    }
    But it did not work.

    #2
    Hello wolfcuring,

    I will not be able to assist with the 3rd party addon, however to print I believe you will need to use NinjaTrader.Code.Output.Process.


    The parameters than can be read in an optimization are the public inputs in the script that you would see in the parameters of the Strategy Analyzer when selecting the script.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X