![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Tips Official NinjaScript tips and tricks |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Indicator and strategy parameters (user defined inputs) will always be displayed in alphabetical order in any indicator/strategy dialog window as default behavior. If you ever come across the need to have these parameters sorted in a non-alphabetical order you can custom sort it by modifying the parameter's DisplayName tag.
In the NinjaScript Editor, expand the the "Properties" region of your code where all of your parameters are defined. In this example, this will be our our Properties section: Code:
[Description("Number of standard deviations")]
[GridCategory("Parameters")]
public double NumStdDev
{
get { return numStdDev; }
set { numStdDev = Math.Max(0, value); }
}
[Description("Numbers of bars used for calculations")]
[GridCategory("Parameters")]
public int Period
{
get { return period; }
set { period = Math.Max(1, value); }
}
For example, if we wanted "Period" to be before "Number of standard deviations" we would do this: Code:
/// <summary>
/// </summary>
[Description("Number of standard deviations")]
[GridCategory("Parameters")]
[Gui.Design.DisplayName ("\t# of std. dev.")]
public double NumStdDev
{
get { return numStdDev; }
set { numStdDev = Math.Max(0, value); }
}
/// <summary>
/// </summary>
[Description("Numbers of bars used for calculations")]
[GridCategory("Parameters")]
[Gui.Design.DisplayName ("\t\tPeriod")]
public int Period
{
get { return period; }
set { period = Math.Max(1, value); }
}
For more information on how to arrange the indicator/strategy's chart label, please see this reference sample: http://www.ninjatrader-support.com/v...3814#post23814
Josh
NinjaTrader Customer Service |
|
|
|
|
The following 4 users say thank you to NinjaTrader_Josh for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Controlling Parameter Sequencing | whitmark | General Programming | 8 | 03-28-2009 10:58 AM |
| Color Input Parameter | aslane | Indicator Development | 2 | 12-24-2007 01:49 PM |
| Parameter selection lists | ThePatientOne | Indicator Development | 3 | 05-11-2007 08:48 AM |
| Parameter sorting/ordering | rtrader | Suggestions And Feedback | 3 | 04-08-2007 05:27 PM |
| Problem with 'Parameter Type' set to Price | codeye | Miscellaneous Support | 5 | 12-09-2005 07:06 AM |