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

How to set one of indicator parameters to first place?

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

    How to set one of indicator parameters to first place?

    Hello. How to set one of parameters to first place? As I see all parameters are arranges by A/Z.
    Example: Indicator(A_param, B_param, C_param). I need Indicator(C_param,A_param,B_param)

    #2
    Hello alexstox,

    Thank you for your note.

    Use Gui.Design.DisplayName after GridCategory in the Properties section. In the Gui.Design.DisplayName string use \t to place the objects in order. If I have ten properties then the one I want displayed first would have ten \t in the string like below:
    Code:
            [GridCategory("Parameters")]
    		// Force this parameter to be displayed first
    		[Gui.Design.DisplayName ("\t\t\t\t\t\t\t\t\t\tOne of ten properties")]

    Comment


      #3
      I did like this, what is wrong?

      [Description("myInstrum1")]
      [GridCategory("Parameters")]
      // Force this parameter to be displayed first
      [Gui.Design.DisplayName ("\t\t\t myInstrum1")]
      public string MyInstrum1
      {
      get
      { .......

      Comment


        #4
        Hi alexstox,

        The code looks right for setting this as the 3rd parameter.

        Are you getting an error when compiling? If so, what does this error say?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          #region Properties
          /// <summary>
          /// </summary>

          [Description("myInstrum1")]
          [GridCategory("Parameters")]
          // Force this parameter to be displayed first
          [Gui.Design.DisplayName ("\t\t\t myInstrum1")]
          public string MyInstrum1
          {
          get
          { ......
          set { myInstrum1/*=value*/ = value.ToUpper(); } //ToUpper used for any symbols to UPPER SYMBOLS
          }

          [Description("Periods for ATR")]
          [GridCategory("Parameters")]
          [Gui.Design.DisplayName ("\t\t Periods for ATR")]
          public int ATRbars
          {
          get { return aTRbars; }
          set { aTRbars = Math.Max(1, value); }
          }

          [Description("bars for BottomTop")]
          [GridCategory("Parameters")]
          [Gui.Design.DisplayName ("\t bars for BottomTop")]
          public int BarsForBottomTop
          {
          get { return barsForBottomTop; }
          set { barsForBottomTop = Math.Max(1, value); }
          }


          So, what is wrong here? "myInstrum1" should be first. I set "\t" for it and even "\t\t\t". In any case it doesn't want to be first.

          Comment


            #6
            Hi alexstox,

            Which parameter is showing first?

            Is it bars for 'BottomTop'? (this one has one \t and should be listed first)
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              I need "myInstrum1" to be first when I enter indicator in code, for example
              MyIndicator(MyInstrum1, Periods for ATR, BarsForBottomTop),
              but even when I do like below and compile, in any place I start to write "MyIndicator(" and "myInstrum1" is in third place there!
              .................
              [Description("myInstrum1")]
              [GridCategory("Parameters")]
              // Force this parameter to be displayed first
              [Gui.Design.DisplayName ("\t myInstrum1")]
              public string MyInstrum1
              ..............................
              [Description("Periods for ATR")]
              [GridCategory("Parameters")]
              [Gui.Design.DisplayName ("\t\t Periods for ATR")]
              public int ATRbars
              ........................
              [Description("bars for BottomTop")]
              [GridCategory("Parameters")]
              [Gui.Design.DisplayName ("\t\t\t bars for BottomTop")]
              public int BarsForBottomTop
              ...............
              Last edited by alexstox; 04-11-2014, 03:39 PM.

              Comment


                #8
                Hi alexstox,

                I think you may have a typo in your code.

                Try changing:
                [Description("myInstrum1")]
                [GridCategory("Parameters")]
                // Force this parameter to be displayed first
                [Gui.Design.DisplayName ("\t myInstrum1")]
                public string MyInstrum1
                {
                get
                { ......
                set { myInstrum1/*=value*/ = value.ToUpper(); } //ToUpper used for any symbols to UPPER SYMBOLS
                }

                To:
                [Description("myInstrum1")]
                [GridCategory("Parameters")]
                // Force this parameter to be displayed first
                [Gui.Design.DisplayName ("\t myInstrum1")]
                public string MyInstrum1
                {
                get { return myInstrum1; }
                set { myInstrum1/*=value*/ = value.ToUpper(); } //ToUpper used for any symbols to UPPER SYMBOLS
                }

                Attached is a screenshot of how this is showing for me.
                Attached Files
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  I need "myInstrum1" to be first when I enter indicator in code, for example
                  MyIndicator(MyInstrum1, Periods for ATR, BarsForBottomTop)

                  P.S. Sorry, I didn't need it in windows parameters. I describe my needs wrong way.

                  Comment


                    #10
                    Hi alexstox,

                    Thanks for clarifying that for me.

                    It is not possible to change the order of overload parameters when calling an indicator. These will always be in alphabetical order.

                    You can choose to use 1myInstrument1, 2ATRbars, 3BarsForBottomTop. This would order them alphabetically.

                    It will not be possible to change this using the current variable names though.
                    Chelsea B.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Waxavi, Today, 02:10 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post Waxavi
                    by Waxavi
                     
                    Started by TradeForge, Today, 02:09 AM
                    0 responses
                    2 views
                    0 likes
                    Last Post TradeForge  
                    Started by Waxavi, Today, 02:00 AM
                    0 responses
                    2 views
                    0 likes
                    Last Post Waxavi
                    by Waxavi
                     
                    Started by elirion, Today, 01:36 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post elirion
                    by elirion
                     
                    Started by gentlebenthebear, Today, 01:30 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post gentlebenthebear  
                    Working...
                    X