Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modifying the Optimization

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

    Modifying the Optimization

    Hi,

    I want to edit the optimization function at bit so I can provide it a range of values (factors that will multiply the ATR) so that and I cand find which factor multiplied by the ATR provides the best trailing stop loss.

    I basically need to add a few fields to it but dont know where to add the code.

    Any advice would be much appreciated.

    Mike

    #2
    Mike,

    You can only optimize on user parameters you create in the code. To create a user parameter you will have to custom program it into your strategy. Please take a look at the SampleMACrossOver strategy for an example. You can see how it creates the parameters for Fast and Slow. Pay special attention to what is in the Variables region of the code and the Properties region of the code. Make sure you are mindful as to what is capitalized and what is not.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Josh.

      Also, is there a way to autmate a lot of this backtesting and print the results to a text file / excel file. Its just we want to apply the strategy to over 1000 stocks and analyze the results.

      Thanks

      Mike

      Comment


        #4
        mcirl2,

        You can basket backtest your stocks all at once. As far as writing to an Excel file is beyond the scope of what we support. You can write to files, but that needs to be done with some more advanced C# programming in your strategy itself.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Josh

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          661 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          375 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          110 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          580 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X