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

Setting optimization parameters

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

    Setting optimization parameters

    Hi,

    I created my own strategy and would like to optimize it. I want to know how to create optimization paramters for the auto optmizer to pick up and test for me.

    Thanks,

    Sharkie

    #2
    Sharkie,

    All you have to do is create a normal parameter for your strategy like how you would make any other parameter. You can see SampleMACrossOver for examples of parameters. Then when you are using the Strategy Analyzer, just choose Optimize and it will handle the rest in allowing you to select a range to use.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      Sharkie,

      All you have to do is create a normal parameter for your strategy like how you would make any other parameter. You can see SampleMACrossOver for examples of parameters. Then when you are using the Strategy Analyzer, just choose Optimize and it will handle the rest in allowing you to select a range to use.
      All the parameters in my strategy are hard coded, I change the value in the code in order to alter them. Do I use the Add() function for them appear as parameters on the optimizer set up screen ?

      Comment


        #4
        No, add is only for adding indicators or bar objects. Please see SampleMACrossOver and see how they created the Fast and Slow parameters. Pay attention to the Variables region and Properties regions of the code.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I tried and I still don't get Paramters to appear in the config table. this is the code I created which I expected should trigger the parameters table to show.Please let me know if there is anything more I should do


          #region Properties

          [Description("MACD Long Signal Entry")]
          [Category("Parameters")]
          public double MACD_Long
          {
          get { return MACD_long; }
          set { MACD_long = Math.Max(1, value); }
          }

          /// <summary>
          /// </summary>
          [Description("MACD Long signal exit")]
          [Category("Parameters")]
          public double MACD_Long_Exit
          {
          get { return MACD_long_exit; }
          set { MACD_long_exit = Math.Max(1, value); }
          }
          #endregion

          Comment


            #6
            You need to pay special attention to what is capitalized and what is not. Notice how in the SMA indicator there are variables in the Properties region that are not capitalized and some that are. Notice how the uncapitalized ones have a corresponding line of code in the Variables region of the code.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              That is exactly what I did .First defined them in the Variables section and then using them in the Parameters section.Can I send you privatly the full code for you to review,I think I am missing out on something very simple here. This is the only think missing for me to start optimizing.

              Comment


                #8
                You can send in an email to support [at] ninjatrader [dot] com. Please be sure you put a link to this thread in the email along with Attn: Josh in it. Thank you.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Seneca, 08-25-2020, 08:31 AM
                2 responses
                5,945 views
                0 likes
                Last Post Tin34
                by Tin34
                 
                Started by casabella, Today, 04:12 AM
                0 responses
                13 views
                0 likes
                Last Post casabella  
                Started by Ludwik, Today, 03:52 AM
                0 responses
                7 views
                0 likes
                Last Post Ludwik
                by Ludwik
                 
                Started by wuannetraam, Today, 02:40 AM
                0 responses
                10 views
                0 likes
                Last Post wuannetraam  
                Started by cyberpete76, 03-27-2023, 12:29 AM
                7 responses
                272 views
                1 like
                Last Post slightly  
                Working...
                X