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

adding a new parameter to an indicator

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

    adding a new parameter to an indicator

    Kind of noob question I guess.
    I searched the forum before posting, not extensively though

    I would like to know how to add a new parameter to an indicator, after generating it with the wizard.
    I cannot plan all parameters from the start, and I want to know how to change parameters in the process of indicator's creation.

    I tried to add a new parameter like myInput1, and I did a getter and setter for it like myInput0.
    It appeared in the Misc section area of Indicator's properties.

    Is this the way to go? Or is it possible to add a new parameter exactly like myInput0? (To be displayed in Parameters section of Indicator's properties). Because I would like new parameters to appear in parameters section of the indicator.

    #2
    Hi mishhh,

    For this, please take a look at this sample - http://www.ninjatrader.com/support/f...ead.php?t=5782
    TimNinjaTrader Customer Service

    Comment


      #3
      Thank you for your reply.
      Category field was what I needed.

      I've looked around but sorry I've missed tips and tricks section.

      Comment


        #4
        Hi mishhh,

        Additionally, add the following line can add more discretion to the naming and organizing of parameters.

        [Gui.Design.DisplayNameAttribute("Name displayed in settings")]
        TimNinjaTrader Customer Service

        Comment


          #5
          It could be very useful.
          Still category parameter it's sufficient for me for the moment.
          But it's good to know how to display a different name.

          Thanks

          Comment


            #6
            adding a new parameter to an indicator

            I have just posted a similar question. It would appear that I did not use the correct "key words" to find this when I searched the forum on previous occasions.
            Tim certainly gave a good reply.
            Now, where is the last bit of script to be inserted into the overall code.
            Thank you from oldhiker

            Comment


              #7
              oldhiker, have you already checked into Tim's second reply here in this thread? It would show how to add input parameters to a script and contains sample code.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                adding a new parameter to an indicator

                Yes, I got the long reply and I have used it successfully.
                Where in the script is the following line supposed to go:-
                [Gui.Design.DisplayNameAttribute("Name displayed in settings")]
                Thank you .
                One other unrelated question. Is there a unique ID for each thread, so that people could easily return to the thread at some later date?

                Comment


                  #9
                  This line would go in your Properties region and be applied for each property needed where you would like to change this attribute - as an example :

                  [Description("Numbers of bars used for calculations")]
                  [GridCategory("Parameters")]
                  [Gui.Design.DisplayNameAttribute("MyCustomParameter ")]
                  public int Period
                  {
                  get { return period; }
                  set { period = Math.Max(1, value); }
                  }
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by oldhiker View Post
                    Is there a unique ID for each thread, so that people could easily return to the thread at some later date?
                    You can bookmark this url here - http://www.ninjatrader.com/support/f...d.php?p=265982
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Yes, that now makes the quest complete. Thanks for the info.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Tim-c, Today, 03:54 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post Tim-c
                      by Tim-c
                       
                      Started by FrancisMorro, Today, 03:24 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post FrancisMorro  
                      Started by Segwin, 05-07-2018, 02:15 PM
                      10 responses
                      1,772 views
                      0 likes
                      Last Post Leafcutter  
                      Started by Rapine Heihei, 04-23-2024, 07:51 PM
                      2 responses
                      31 views
                      0 likes
                      Last Post Max238
                      by Max238
                       
                      Started by Shansen, 08-30-2019, 10:18 PM
                      24 responses
                      945 views
                      0 likes
                      Last Post spwizard  
                      Working...
                      X