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 zstheorist, Today, 07:52 PM
        0 responses
        3 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        149 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Working...
        X