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 Ashkam, 04-29-2024, 09:28 AM
        2 responses
        26 views
        0 likes
        Last Post Ashkam
        by Ashkam
         
        Started by Felix Reichert, 04-26-2024, 02:12 PM
        6 responses
        41 views
        0 likes
        Last Post Felix Reichert  
        Started by MrForgetful, Today, 01:28 AM
        3 responses
        21 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
        16 responses
        50 views
        0 likes
        Last Post cmtjoancolmenero  
        Started by ETFVoyageur, Yesterday, 06:05 PM
        6 responses
        39 views
        0 likes
        Last Post ETFVoyageur  
        Working...
        X