Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Genetic Optimizer in code

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

    Genetic Optimizer in code

    Hi,

    Is it possible to incorporate the genetic optimizer into strategy code?
    If so, is there any documentation available?

    Many thanks

    Michael

    #2
    Hello,

    Yes, this would be technically possible however we do not have any documentation on this area and would not be able to provide support.

    You can see the methods use in the Genetic Optimizer by going to Documents\NinjaTrader 7\bin\Custom\Type\ an opening the @GeneitcOptimizer.cs file.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hi Matthew, I too am looking for a way to call GeneticOptimizer from a strategy while it is running to optimize the parameters. Could you provide a hint as to how this might be done? The methods in the @GeneitcOptimizer.cs code are not fully documented, so any tips or code snippets you could provide would be very helpful.

      -Dave

      Comment


        #4
        looking for a hint

        I've made this my pet project over the past few months and without documentation it's really tough. Hopefully some NinjaTraders out there can let me know if i'm going in the right direction:

        What I (think) I know...
        - Strategies are basically C# classes and so can be called from other strategies
        - Optimizer Types are also classes and therefore can (should be able to) be called from a strategy


        What I have so far...
        Code:
        cStrat = new DefaultOptimizationMethod(); // setting up the DefaultOptimizationMethod
        cStrat.Initialize();  // must this be called first?
        cStrat.Optimize(); // there must be more to it than this...
        What I don't know...
        1) how you can pass the parameter values (Min,Max,Increment) to the DefaultOptimizerMethod

        e.g (not sure if this is allowable...)

        //setting the min, max, increment
        cStrat.Parameters[0].Min = 5;
        cStrat.Parameters[0].Max = 55;
        cStrat.Parameters[0].Increment = 1;


        2) how to get trade results back to the calling Strategy from the DeaultOptimizer

        e.g., maybe:
        int Losers = cStrat.Performance.RealtimeTrades.TradesPerformanc e.MaxConsecLoser;

        any and all tips/suggestions are appreciated!


        -Dave

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,789 views
        0 likes
        Last Post aligator  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        837 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,293 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        13 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        11 responses
        63 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X