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

Strategy must have at least one parameter to optimize

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

    Strategy must have at least one parameter to optimize

    I getting error when i do the backtesting for optimization :
    Strategy must have at least one parameter to optimize

    What is that mean ??
    and how to resolve it ??
    Attached Files

    #2
    Hello cincai,

    Thank you for your post.

    This message means that the strategy in the Strategy Analyzer needs something to optimize.

    Does the strategy have parameters? Have you set a range for at least one parameter?

    Below is a publicly available link to a training video on optimizing a strategy.
    https://youtu.be/SxbGhhkKtXk.

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Yes, I have the parameter, But why one of the boolean have to set optimize, then it only can work ??

      Comment


        #4
        Hello cincai,

        Thank you for your note.

        You would need to set a range for your parameter(s) to optimize when running an Optimization. For example, if you try optimizing the SampleMACrossover strategy without setting a range to optimize for the Fast (10;10;1) parameter and Slow (25;25;1) parameter, you would receive the same error message you are reporting. You would need to set a range for the strategy parameters so that there is a range of values to backtest. For example, changing the Fast parameter to 5;10;1 and the Slow parameter 15;25;1 would allow for successful optimization. See the video below demonstrating this.



        But why one of the boolean have to set optimize, then it only can work ??

        Are you referring to the 'Optimize data series' checkbox? in the Optimization settings? This checkbox would not have to be checked to run an optimization. Checking the 'Optimize data series' box would allow the Data Series Value property to be available for optimization.

        See this help guide link for more information about running an Optimization in the Strategy Analyzer - https://ninjatrader.com/support/help...a_strategy.htm

        Let us know if we may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          No, it is a boolean parameter that I created.
          For example, boolean variable "condition 1", it mean in my strategy will add this condition into it.

          But, why it have to be set optimize ???
          Why can't just true/false only ??

          Comment


            #6
            Hello cincai,

            Thank you for your note.

            I understand that the strategy you are wanting to optimize has a single bool parameter.

            It is important to first understand the purpose of optimizations before optimizing a strategy. You can fine-tune the input parameters of a strategy through optimization. Optimization is the process of testing a range of values through iterative backtests to determine the optimal input values over the historical test period based on your optimization fitness.

            This bool parameter would need to be set to 'Optimize' because to optimize a strategy you have at least one ranged input. If the bool is set to True or False, there would not be a range of values to optimize with. Setting the bool to Optimize means that the Optimizer would test values for when the bool is both True and False to determine the optimal input values.

            I suggest running a backtest with your strategy to determine how the strategy may perform instead of running an optimization. This would allow you to backtest the strategy with the bool set to True or False.

            Let us know if we may assist further.
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              lovely video thank you for sharing!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by alifarahani, Today, 09:40 AM
              4 responses
              19 views
              0 likes
              Last Post alifarahani  
              Started by gentlebenthebear, Today, 01:30 AM
              3 responses
              16 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by PhillT, Today, 02:16 PM
              2 responses
              7 views
              0 likes
              Last Post PhillT
              by PhillT
               
              Started by Kaledus, Today, 01:29 PM
              3 responses
              11 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by frankthearm, Yesterday, 09:08 AM
              14 responses
              47 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Working...
              X