Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

B19 - Strategy Optimizer Multi-Core Issue

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

    B19 - Strategy Optimizer Multi-Core Issue

    In using the Genetic optimizer in Strategy Analyzer, optimizations aren't reliably trying all values when some of the values are of the enum or bool base type.

    Here are two screenshots showing it: Both optimizations were over the same period with the same strategy and settings. I went into the code and made a toggle for multi-core if it's enabled or not. The multi-core enabled picture is with the regular genetic optimizer. The multi-core disabled picture is with the genetic optimizer multi-core set to always false.

    Note: The optimization was very narrow, so these are all the possible combinations - it was 12 possible combinations. Yes, with a regular genetic optimization different results would be expected. But I found that all 12 possible combinations were correctly generated (as in, sent to "RunIteration") both times, but only when multi-core was enabled were the results generated ("IterationComplete") skewed. Since the GO code eliminates duplicates of the same settings, even larger optimizations would be affected as well. It seems that about 10-15% of results are dropped/don't come through.

    I think the problem is that somewhere in the internal handling, there needs to be a
    Code:
    lock (this)
    It's not real easy to duplicate or track down at first, but hopefully this distills it well for you.
    Attached Files
    Last edited by DanielB; 07-26-2010, 02:39 PM.

    #2
    DanielB, thanks for reporting in here - we'll check into and attempt to reproduce.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      DanielB,

      From your attached pictures I can see that the results are the same, but with multi - core enabled there are multiple iterations with same settings.

      Comment


        #4
        Hello, DanielB

        We are able to reproduce. We will look into and will post back.
        Thanks again for reporting.
        ArtSenior Software Developer

        Comment


          #5
          So, any news on this issue?

          Comment


            #6
            Daniel,

            That is an interesting outcome ... with only output as a guide I would hazard that each of the cores in the (4core?) multicore did overlap a testing regime and as a result they each had a same result that was not properly co-ordinated into the overall results.

            It will be interesting to see if you had a actual single core machine or virtual machine to run the same test.

            Good work btw!
            Jon

            Comment


              #7
              FYI you can set NT to run on 1 core or any other number of cores... in Windows Task Manager -> Processes -> ninjatrader.exe -> right-click -> Set Affinity

              Comment


                #8
                Originally posted by DanielB View Post
                So, any news on this issue?
                Daniel, sorry for our late follow up - this is fixed in the yesterday released B20 - using multicores will be diabled automatically if you use bools / eums as parameters.

                To clarify further: if you seek to optimize bools / enums with NT7, please change the strategy code to use numerical values instead like in the weekday optimizer found in our sharing, then you would still be able to optimize the original strategy using multiples cores.

                Thanks for reporting in and the support.
                Last edited by NinjaTrader_Bertrand; 08-13-2010, 11:00 AM.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Thank you for the update, I look forward to a full fix.

                  Comment


                    #10
                    Bertrand,

                    Followed the example in the 'dayofweek optimizer' strategy to the best of my ability: modify for MAType on TS Super Trend ... still getting a definition error I cant resolve .. I imagine more people will run into this soon .. can you have a look at the code please?

                    Thanks,
                    Jon
                    Attached Files

                    Comment


                      #11
                      Trader.Jon, without being too familiar with the TSS you use, wouldn't it expect a type input instead of a string you try passing in?
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        Betrand,

                        Is there any example code available for subsituting the numerical for the type (to use the multicore on optimizing the type)? As supplied I tried the example code (day of week) and my modification doesnt compile. I tried to get assist elsewhere for these two weeks and have had no sucess. Maybe it is self evident but to anyone I have approached.

                        Thanks,
                        Jon

                        Comment


                          #13
                          Jon,

                          We don't have sample code per se, but its fairly simple. All you have to do is use an int variable and then when the int is =0, do something, when =1, do something else, etc. The numeric value of the int variable would be equivalent to the different DayOfWeeks you might use or something along those lines.

                          Maybe just have int=0=Monday, int=1=Tuesday, int=2=Wednesday, etc.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Josh,

                            You wrote the framework that I was modelling this after, and I do appreciate your input. I feel that I have already done what you are suggesting, and attached it to the post here weeks ago. I still cant get it resolved to compile. Evertime I try to fix it gets worse. Basically I am trying to take the two samples provided (Optimize on DayOfWeek, Simple MACD Crossover) and add TSSuperTrend so that I can enlist the NT7 Genetic Optimizer to suggest best MAType for TS SuperTrend. IF you have looked at the code and know it cant be done, please just say so. This does definitely refer to the first message in this thread.

                            Thanks,
                            Jon

                            Comment


                              #15
                              Jon, this should be doable following along what's presented in the dayOfWeek sample, however we're unfortunately not familiar with the your other SuperTrend custom code in the mix and how what inputs it needs / accepts, it might be needed to rewrite it from the core up to allow the choice begin an integer value to select the MA used.
                              BertrandNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Radano, 06-10-2021, 01:40 AM
                              19 responses
                              606 views
                              0 likes
                              Last Post Radano
                              by Radano
                               
                              Started by KenneGaray, Today, 03:48 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post KenneGaray  
                              Started by thanajo, 05-04-2021, 02:11 AM
                              4 responses
                              470 views
                              0 likes
                              Last Post tradingnasdaqprueba  
                              Started by aa731, Today, 02:54 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post aa731
                              by aa731
                               
                              Started by Christopher_R, Today, 12:29 AM
                              0 responses
                              11 views
                              0 likes
                              Last Post Christopher_R  
                              Working...
                              X