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, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X