• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

An Error within the Genetic Optimizer

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

    An Error within the Genetic Optimizer

    Hi NinjaTraders,

    While I use the default Genetic Optimizer to run some optimization. The Genetic Optimizer searches outside my searching steps. To be specific, The first parameter "Multiples" is set to have a step value of 0.1, while the GO gives some ridiculous results in which the 'Multiples' has a value of E-14. As shown in the following grid.
    Performance Parameters
    2.63 // 8.35977640182701/0.00485184988679916/0.02 (Multiples,Threshold,PercentToRisk)
    2.49 // 8.9/0.0045/0.02 (Multiples,Threshold,PercentToRisk)
    2.49 // 9/0.0044/0.02 (Multiples,Threshold,PercentToRisk)
    1.93 // 4.8/0.0047/0.02 (Multiples,Threshold,PercentToRisk)
    1.72 // 4.9/0.0046/0.02 (Multiples,Threshold,PercentToRisk)
    1.67 // 6.1/0.004/0.02 (Multiples,Threshold,PercentToRisk)
    1.66 // 4.8/0.0049/0.02 (Multiples,Threshold,PercentToRisk)
    1.62 // 6.8/0.0047/0.02 (Multiples,Threshold,PercentToRisk)
    1.53 // 4.5/0.0043/0.02 (Multiples,Threshold,PercentToRisk)
    1.01 // 6.3/0.0032/0.02 (Multiples,Threshold,PercentToRisk)

    I am using the latest version. NT 8.0.18.1

    Can you just fix this error ?

    #2
    Hello wolfcuring, thanks for your post.

    Could you please post a reduced version of the script so I can test and report if needed?

    I look forward to hearing from you.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Sure. Steps for the strategy: Multiples 0.1; Threshold 0.0001; Percent 0.02;

      When using GO by the paras in the attached picture. There will be at least one result given is out of the steps.
      Attached Files

      Comment


        #4
        Hello wolfcuring, thanks for posting that.

        I am not able to reproduce what you are seeing. Could you kindly save a template of your strategy analyzer setup and post it here so I can test the exact parameters you are?
        • Set up the strategy so that it reproduces the problem.
        • At the bottom right of the Strategy Analyzer, click Template>Save
        • The saved template can be found under Documents\NinjaTrader 8\templates\Strategy\MBOS
        I look forward to your reply.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hi Chris,

          Thank you for your reply. I have been out for a week.

          The template I uploaded is in extension of "zip", because xml is not allowed to upload (wired). So you need to change the extension back to xml. (Same thing with the result of my run, in the xlsx file)

          Attached Files

          Comment


            #6
            Hi wolfcuring,

            It looks like your .zip files are empty, you must right click the .xml file>Send To..>Compressed (zip) folder. This will compress the file so it can be uploaded to the forum.

            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Hi Chris,

              Thank you for your help. Hope it will work this time.
              Attached Files

              Comment


                #8
                Hi wolfcuring, thanks for posting that.

                I am not able to reproduce this, see this screen shot:

                https://clauber.tinytake.com/tt/MzYxODA5MF8xMDk1MDYxOQ

                Could you post a screenshot of this problem occurring in the platform itself and describe how I can reproduce this?

                I look forward to hearing from you.
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  Hi Chirs,

                  The screen shot you posted, if you check carefully, the first line of the parameter set, Multiples and Threshold went into E-14. Which is not supposed to happen if we expect all searching results are within the search steps.

                  So, the search step for Multiples is 0.1, and Threshold 0.0001; in the first line, the they went into E-14; that is going out of the search steps.

                  Comment


                    #10
                    Hi wolfcuring,

                    Are you referring to the significant figures? The values for multiples is in between 1 and 6 and the Threshold is in between 0.001 and 0.006.

                    Chris L.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi Chris,

                      You see, the searching space as it is supposed to be, should be contained in the range of parameters and individual parameter set in it should be restricted by the increment or search step. Here, the range for Multiples is [1,6]; and the range for Threshold is [0.0015, 0.006]. A legitimate individual within this space should be controlled by the search step, which is 0.1 for Multiples and 0.0001 for Threshold.

                      For example, legitimate individual parameter set in the search space is something like this:
                      (1.2, 0.0016) /Multiples, Threshold;
                      (1.3, 0.0021) ;
                      (3.5, 0.0046) ;
                      (5.7, 0.0055) ;
                      ...

                      While some parameter set like this:
                      (2.47569809876876, 0.00217898765678)

                      is out of the constrain of search steps. It is not a legitimate member of the search space. The Genetic Optimizer is doing search out of the steps I desired. This is not supposed to happen, as I have specified the search steps(0.1 and 0.0001).

                      So put it this way, Genetic Optimizer is supposed to search Multiples in the array [1, 1.1, 1.2, 1.3, 1.4, 1.5...6]; and Threshold in [0.0015, 0.0016, 0.0017, 0.0018, 0.0019 ... 0.006]. Any value between these steps are not supposed to show up. So, 2.47569809876876 is not supposed to show up. And this is probably a programming error.

                      In the screen shot you posted early, the parameter set in the first line is something in E-14. And that is an error.

                      Comment


                        #12
                        Hi wolfcuring, thank you for the clarification. This would be unexpected, and I can reproduce this on my end so I'll report it to my supervisor and update this thread with more info on a fix.

                        Thanks in advance for your patience.
                        Chris L.NinjaTrader Customer Service

                        Comment


                          #13
                          Thanks Chris.

                          And some other advice is that the parameters by the GO seem wired, like stability rate, reset rate. And they are not well documented. I am studying the GeneticSharp package, and essential parameters for a GA is: population, fitness, selection, crossover, mutation plus termination method. I am not sure whether stability rate is a optimized algorithm for NT 8 or just dispensable?

                          Comment


                            #14
                            Hello wolfcuring, thanks for your reply.

                            If you are referring to "Stability size", that is used to prevent stagnation of parents that generate the same children. If the top performing stability size percentage of children are the same as the top performing stability size percentage of their parents then the parents are reset and a new generation is made.

                            Best regards.
                            Chris L.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by NinjaCustomer, Today, 12:29 AM
                            1 response
                            6 views
                            0 likes
                            Last Post NinjaTrader_ChrisSch  
                            Started by smgrvd, Today, 12:08 AM
                            0 responses
                            4 views
                            0 likes
                            Last Post smgrvd
                            by smgrvd
                             
                            Started by ronaldgreene828, Yesterday, 07:50 PM
                            1 response
                            12 views
                            0 likes
                            Last Post NinjaTrader_EricB  
                            Started by nailz420, 07-17-2019, 08:38 AM
                            2 responses
                            13 views
                            0 likes
                            Last Post nailz420  
                            Started by bouncetherubble, Yesterday, 06:56 PM
                            0 responses
                            6 views
                            0 likes
                            Last Post bouncetherubble  
                            Working...
                            X