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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    71 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    143 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    76 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    47 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    51 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X