Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

can custom criteria be programmed for optimizer?

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

    can custom criteria be programmed for optimizer?

    I am moving from another tool and am "translating" my strategy.
    I have some specific code that I would like to use as a target for optimizing.
    Is this possible?
    Any examples?

    Thanks!

    #2
    Hello waltS,

    Thanks for your post.

    The optimizer will iterate over all user input parameters that have the NinjaScriptProperty attribute added to them. (NinjaScriptProperty is commonly used and also added automatically to user inputs in Strategy Builder strategies. You can also test the SampleMACrossover strategy in the optimizer)

    So, you could make a user input parameter that controls your logic, and then you can add the NinjaScriptProperty attribute to that property to make it optimizable.

    Optimize a strategy - https://ninjatrader.com/support/help...a_strategy.htm

    NinjaScriptProperty attribute - https://ninjatrader.com/support/help...yattribute.htm
    Last edited by NinjaTrader_Jim; 05-31-2022, 06:45 AM.

    Comment


      #3
      Thanks Jim but maybe I did not ask the question properly;
      When on the "strategy analyzer", under the setting "optimize" sub menu, there is a "Optimize on" drop-down where the criteria (like "Max. avg. profit") can be selected.
      I would like to be able to select a user-coded criteria.
      Possible?

      Walt

      Comment


        #4
        Hello Walt,

        That is certainly possible, and easy with an Optimization Fitness Metric.

        The existing Optimization Fitness Metrics are all open source and can be referenced for simple working examples. The OnCalculatePerformanceValue method has a strategy object that can be accessed. Then Value is assigned with the value to be used in the rating.

        Comment


          #5
          Thank Jim, Just what I was looking for...!!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          50 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          126 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          69 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