Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 cocoescala, 10-12-2018, 11:02 PM
    7 responses
    939 views
    0 likes
    Last Post Jquiroz1975  
    Started by oviejo, Today, 12:28 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by geddyisodin, Yesterday, 05:20 AM
    7 responses
    46 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by gbourque, Today, 06:39 AM
    2 responses
    5 views
    0 likes
    Last Post gbourque  
    Started by cre8able, Yesterday, 07:24 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X