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 rbeckmann05, Yesterday, 06:48 PM
        1 response
        12 views
        0 likes
        Last Post bltdavid  
        Started by llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        15 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Working...
        X