Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Coding Question from a previous post

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

    Coding Question from a previous post

    Can I get the Optimization Values, Parameters, Results, etc. realtime during an optimization, so they can be written to a .CSV file? I can write a real log file, I just want to be able to get the optimization values.

    Each separate param, Total Net, Profit Factor, Max Drawdown, etc.

    #2
    ChuckAllen,

    Just print the values from within your code whenever you want to take a look at them. Your optimization parameters are always accessible just by accessing the parameters directly. If your parameter being optimized was named "Period", just printing Period will get you the value that is currently being used for that particular run.

    If you want performance information, grab it from the TradesPerformance object. Please refer to the Help Guide for more information: http://www.ninjatrader.com/support/h...erformance.htm
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Reply

      Thanks. I will try it.

      Comment


        #4
        Could not get the values as expected

        Is there a way to get the optimization values & results at the end of an optimization loop, so they can be written to a Results.Csv file for later analysis?
        The Performance.RealtimeTrades... variable seems to be results for a trade at a time.
        Is there a way to get the same totals as are displayed in the Optimization Results window, so they can be written to a Results.Csv file. The other options to save the results are stored somewhere in NT instead of in the real file system. Is there a way to save these to a real file, so they can be parsed & used? However we get the output, please...one line per complete loop...not a trade at a time.

        Comment


          #5
          You have to do the math in your code and add all the performance up. There are no prebuilt methods for it.
          Josh P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          586 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          341 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          555 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X