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

User-defined Indicator Parameters

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

    User-defined Indicator Parameters

    Hi,

    may I know how do I define indicator parameters?
    I have done the following:

    1. declare a private integer
    2. Under [GridCategory], I have added a public get/set statement for this integer.

    This particular integer still appears under "Misc" instead of "Parameter".
    The only reason why I need it to appear under "Parameter" is that they are the only visible inputs in Strategies Wizard. I don't see "Misc" appearing anywhere.

    Thanks.

    #2
    Hello karfey,

    You can define which category it is going to be under by using the [GridGategory] as you mention. For Example:

    Code:
    [GridCategory("Parameters")]
    or 
    [GridCategory("Misc")]
    You may see the following thread for a detailed example on how to create User Defined Parameters.


    Please note that you should be able to select the User Defined Input inside the Strategy Wizard even if it is under a category called "Misc".

    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Hi, thanks for your prompt reply. Unfortunately both issues:

      1) can I see my user-definable variables under Parameters when I have already put them under [GridCategory("Parameters")]?
      2) can I see my user-definable variables in Strategy, regardless of their category in Parameters or Misc?

      are No for me.

      I have attached my indicator for your reference.
      Just a short explanation on what this indicator does:
      it takes the StdDev and plots the trailing 64-day max/min, and trailing 256-day max/min of the StdDev.
      I want the integers 64 and 256 to be user-inputs selectable/optimizable in Strategy.

      Many thanks for your valuable time.
      Attached Files

      Comment


        #4
        Hello karfey,

        Thanks for the file.

        This is because you would have to add the "[Description("")]" and "[GridCategory("Parameters")]" for each integer, double, bool, string, ect... so that you can define which one each property goes.

        Example:
        Code:
        [Description("Numbers of bars used for calculations")]
        [GridCategory("Parameters")]
        public int Period
        {
        	get { return period; }
        	set { period = Math.Max(1, value); }
        }
        
        [Description("")]
        [GridCategory("Parameters")]
        public double Percentile
        {
        	get { return percentile; }
        	set { percentile = Math.Max(1, value); }
        }
        		
        [Description("")]
        [GridCategory("Parameters")]
        public int WindowPeriodLong
        {
        	get { return windowlong; }
        	set { windowlong = Math.Max(1, value); }
        }
        JCNinjaTrader Customer Service

        Comment


          #5
          Thank you very much for your reply.
          That indeed is the issue.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by mjairg, 07-20-2023, 11:57 PM
          3 responses
          213 views
          1 like
          Last Post PaulMohn  
          Started by TheWhiteDragon, 01-21-2019, 12:44 PM
          4 responses
          544 views
          0 likes
          Last Post PaulMohn  
          Started by GLFX005, Today, 03:23 AM
          0 responses
          3 views
          0 likes
          Last Post GLFX005
          by GLFX005
           
          Started by XXtrader, Yesterday, 11:30 PM
          2 responses
          12 views
          0 likes
          Last Post XXtrader  
          Started by Waxavi, Today, 02:10 AM
          0 responses
          7 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Working...
          X