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!
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
NinjaTrader
Force the order of the parameters in an indicator
Collapse
X
-
Force the order of the parameters in an indicator
Right now, the parameters are sorted alphabetically when you "Ctrl-I" on a chart. How do you change/override the order of the list in the NinjaScript code?Tags: None
-
I asked for the option to not sort the parameters alphabetically nearly a year ago while NT 6.0 was in Beta. Apparently this simple and logical requirement is not high on the priority list. With strategies that have a lot on inputs this would make it much easier to quickly review the important or more likely changed parameters without scrolling up and down.
Maybe if more people express an interest...................
Comment
-
I'm not sure I understand what you're suggesting. The "MyPropertyName" is the string that it would then sort alphabetically instead of the variable name? Do you have an example to post?
Originally posted by NinjaTrader_Dierk View PostHere's a hint from the "magic and mystery" box (neither tested nor officially supported, you would need to play with it): try adding
[DisplayName("\tMyPropertyName")]
Idea:
- \t should not be displayed
- cascading \t would allow you to sort
Comment
-
Just as a test, I did a save-as on the MACD indicator and changed the parameters so they'd display in an arbitrary order, like so:
Code:[Description("Number of bars for fast EMA")] [Gui.Design.DisplayName("\tThird parameter")] [Category("Parameters")] public int Fast { get { return fast; } set { fast = Math.Max(1, value); } } [Description("Number of bars for slow EMA")] [Gui.Design.DisplayName("\t\tSecond parameter")] [Category("Parameters")] public int Slow { get { return slow; } set { slow = Math.Max(1, value); } } [Description("Number of bars for smoothing")] [Gui.Design.DisplayName("\t\t\tFirst parameter")] [Category("Parameters")] public int Smooth { get { return smooth; } set { smooth = Math.Max(1, value); } }
Comment
-
Dierk . . . not sure I follow your comment. By less visible I mean not require the use of a prefix (e.g., p01_FirstParameter) just to control the sequence and require renaming should an intervening new parameter be introduced.
In the thread of the link I posted, I point out there are clear inconsistancies in the sequence of parameters displayed in the parameter dialog and the sequence they are displayed at the top of the chart if you just manipulate the [Gui.Design.DisplayName]. Ideally, we're looking for an approach that controls the sequencing of both displayed items.
Thanks for sharing the "magic and mystery box" idea that will address only the parameter dialog sequencing and can be a bit kludgy to work with . . . as is the alternative method I use.
[Gui.Design.DisplayName("\t\t\t\t\t\t\t\t\t\t\t\t\t Twelth parameter")]
Would appreciate it if you can clarify whether this is something that can be improved upon in a future release or is this some limitation in C#.Net that we will need to learn to live with? Thanks.
Regards,
Whitmark
Comment
-
Originally posted by whitmark View Post[Gui.Design.DisplayName("\t\t\t\t\t\t\t\t\t\t\t\t\t Twelth parameter")]
Since the binary value of a tab character ("\t") is less than that of text characters, the parameters with more tabs at the front would come first, not last; like so:
Code:[Gui.Design.DisplayName("\t\t\t\t\t\t\t\t\t\t\t\tFirst parameter")] [Gui.Design.DisplayName("\t\t\t\t\t\t\t\t\t\t\tSecond parameter")] [Gui.Design.DisplayName("\t\t\t\t\t\t\t\t\t\tThird parameter")] [Gui.Design.DisplayName("\t\t\t\t\t\t\t\t\tFourth parameter")] [Gui.Design.DisplayName("\t\t\t\t\t\t\t\tFifth parameter")] [Gui.Design.DisplayName("\t\t\t\t\t\t\tSixth parameter")] [Gui.Design.DisplayName("\t\t\t\t\t\tSeventh parameter")] [Gui.Design.DisplayName("\t\t\t\t\tEighth parameter")] [Gui.Design.DisplayName("\t\t\t\tNinth parameter")] [Gui.Design.DisplayName("\t\t\tTenth parameter")] [Gui.Design.DisplayName("\t\tEleventh parameter")] [Gui.Design.DisplayName("\tTwelth parameter")]
Comment
-
KBJ, thanks for the clarification, I see now its important to know in advance how many parameters one is working with. Frankly, I didn't even seriously consider it long enough to realize the way it works. So, is it worth considering writing a small method that can make this even more structured and maintainable that can be used in the following manner:
ParmCount = 12;
N = 0
...
[Gui.Design.DisplayName(ParmTab( N++, ParmCount) + " First parameter")]
[Gui.Design.DisplayName(ParmTab( N++, ParmCount) + " Second parameter")]
...
[Gui.Design.DisplayName(ParmTab(N++, ParmCount) + " Tenth parameter")]
[Gui.Design.DisplayName(ParmTab(N++, ParmCount) + " Eleventh parameter")]
[Gui.Design.DisplayName(ParmTab(N++, ParmCount) + " Twelth parameter")]
Unsure if this type of method call is allowed. Also, this still doesn't solve the sequencing of the parameters at the top of the chart. Thoughts?
Regards,
Whitmark
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by DJ888, Today, 10:57 PM
|
0 responses
1 view
0 likes
|
Last Post
by DJ888
Today, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
158 views
0 likes
|
Last Post Today, 10:23 PM | ||
Started by Belfortbucks, Today, 09:29 PM
|
0 responses
7 views
0 likes
|
Last Post
by Belfortbucks
Today, 09:29 PM
|
||
Started by zstheorist, Today, 07:52 PM
|
0 responses
7 views
0 likes
|
Last Post
by zstheorist
Today, 07:52 PM
|
||
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
151 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
Comment