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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X