Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy optimization and the 0 trades plague

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

    Strategy optimization and the 0 trades plague

    Hello,

    I apologize if this has been asked and answered before.
    i did a search and after several pages of results didn’t find anything similar to my question.

    When you optimize a strategy by one of the parameters where “lower is better”, then the results get plagued by settings which produce 0 trades. The reason being that no trade has a better MAE than even a 99.99% profitable trade.

    So unless I greatly increase the “Keep best # results” setting, I end up with a list of 10 different parameters with zero trades. Unfortunately, increasing that value seems to have a heavy toll on the speed of the optimization. I suppose this is caused due to having to constantly sort so many results.

    My question is, is there some way to tell the strategy optimizer that it should ignore an iteration/result if it produced 0 trades?

    If the iterations with 0 trades are kept out of the pool, then they won’t taint the results.

    I hope my explanation is understandable. If not, please feel free to ask.

    #2
    Hello Merkor,

    There is not a way to ignore 0 trades as an option of the analyzer. If your strategy produces 0 trades that is the result of the test and that would be what the analyzer displays as a result. The only way to change the results would be if you created your own optimization fitness which would determine how the results are filtered.

    Comment


      #3
      Hello,

      Thank you for your reply.

      Could you please explain to do this?
      ”…if you created your own optimization fitness”

      Comment


        #4
        Originally posted by NinjaTrader_Jesse View Post
        Hello Merkor,

        There is not a way to ignore 0 trades as an option of the analyzer. If your strategy produces 0 trades that is the result of the test and that would be what the analyzer displays as a result.
        Additionally, I'm not sure if my explanation was understood.
        Any test can produce results with 0 trades. However, if the criteria being optimized is one where a number 0 is a perfect outcome (for example with MAE), then the results with 0 trades will push out all the other useful results.
        This is a shortcoming of NinjaTrader as there should be a way to filter out results which never produced any trades.

        Comment


          #5
          Hello Merkor,

          You can review how the existing optimization fitness scripts are coded by using the NinjaScript editor. Optimization fitness is how you can change the results of an optimization, you could return a value in the fitness based on the strategies performance.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          44 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          124 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          65 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X