Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Fitness

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

    Strategy Fitness

    How do I access the fitness value of a strategy? I need something like:
    Print(string.Format("{0}:{1},{2},{3},{4}", Instrument.FullName, DateTime.Now, MA1_LEN, MA2_LEN, ***FITNESS VALUE***));

    to print the fitness value together with my strategy inputs when I optimize.

    And where should I place the print statement? I tried the Dispose() method but noticed that it executes more that once each time the strategy is evaluated.

    Thanks

    #2
    Hi ecruz,

    Can you clarify "Fitness Value"? Is this something specific to your strategy? Something else?
    TimNinjaTrader Customer Service

    Comment


      #3
      Fitness Value

      Originally posted by NinjaTrader_Tim View Post
      Hi ecruz,

      Can you clarify "Fitness Value"? Is this something specific to your strategy? Something else?
      The fitness is the value returned by the selected OptimizationType. It could be net. profit, profit factor, or a custom formula.

      Comment


        #4
        ecruze, unfortunately it is not possible to place a Print() statement within the context of the optimizer. Each strategy is run with the settings provided, and the strategy knows nothing about other strategies run before or after it.

        Have you looked at the optimize tab after an optimization? It shows exactly what you're looking for, with the parameters used and the "fitness value" for each individual backtest.
        Attached Files
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X