Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    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.

        JimNinjaTrader Customer Service

        Comment


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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by lightsun47, Today, 03:51 PM
          0 responses
          5 views
          0 likes
          Last Post lightsun47  
          Started by 00nevest, Today, 02:27 PM
          1 response
          9 views
          0 likes
          Last Post 00nevest  
          Started by futtrader, 04-21-2024, 01:50 AM
          4 responses
          45 views
          0 likes
          Last Post futtrader  
          Started by Option Whisperer, Today, 09:55 AM
          1 response
          14 views
          0 likes
          Last Post bltdavid  
          Started by port119, Today, 02:43 PM
          0 responses
          9 views
          0 likes
          Last Post port119
          by port119
           
          Working...
          X