Example: Indicator(A_param, B_param, C_param). I need Indicator(C_param,A_param,B_param)
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
How to set one of indicator parameters to first place?
Collapse
X
-
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")]
-
#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
-
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
-
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.Chelsea B.NinjaTrader Customer Service
Comment
-
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
by Waxavi
Today, 02:10 AM
|
||
Started by TradeForge, Today, 02:09 AM
|
0 responses
2 views
0 likes
|
Last Post
by TradeForge
Today, 02:09 AM
|
||
Started by Waxavi, Today, 02:00 AM
|
0 responses
2 views
0 likes
|
Last Post
by Waxavi
Today, 02:00 AM
|
||
Started by elirion, Today, 01:36 AM
|
0 responses
4 views
0 likes
|
Last Post
by elirion
Today, 01:36 AM
|
||
Is it possible to have a drawing, such as a line, cycle through different colors?
by gentlebenthebear
Started by gentlebenthebear, Today, 01:30 AM
|
0 responses
4 views
0 likes
|
Last Post Today, 01:30 AM |
Comment