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 CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    61 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    34 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    198 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    364 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    283 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X