CategoryOrderAttribute

View as Markdown

Definition

Determines the sequence in which a NinjaScript object’s Display.GroupName categories are arranged in relation to other categories in the UI. The default behavior will display each GroupName of an object in alphabetical order, however this behavior can be changed by defining the CategoryOrder attribute before the object’s declaration.

  • The CategoryOrder attribute is ONLY valid on class-level declarations.
  • Categories with values less than 1,000,000 appear at the very top of the property grid (excluding the Strategy Analyzer “General” category).
  • NinjaTrader UI reserves using values ending in 000, 500 and the values documented below are subject to change.
  • If you wish to inject your category between a standard NinjaScript category, please refer to the table below to locate the appropriate position (e.g., to set a property after “Data Series” and before the “Setup” use value of 2,000,001).

NinjaScript Indicators

The following table applies for Indicators configured from a Chart Indicator, Market Analyzer Indicator Column, or SuperDOM Indicator:

Parameters1000000
Data Series2000000
Time Frame3000000
Setup4000000
Visual5000000
Lines6000000
Plots7000000

NinjaScript Strategies

The following table applies to Chart Strategies, Control Center Strategies Grid, and the Strategy Analyzer:

Parameters1000000
Data Series2000000
Time Frame3000000
Setup4000000
Historical Fill Processing5000000
Optimize6000000
Order Handling7000000
Order Properties8000000

The Strategy Analyzer “General” category is purposely excluded from this table and will always show on the top of the parameter grid.

Syntax

[Gui.CategoryOrder(string category, int order)]

Attempting to modify the default NinjaScript Category ordering is NOT supported. Trying to do so may result in unexpected outcomes.

Parameters

categoryA string identifying the GroupName to be categorized
orderAn int determining the sequence the Category displays

Examples

1[Gui.CategoryOrder("My Strings", 1)] // display "My Strings" first
2[Gui.CategoryOrder("My Bools", 2)] // then "My Bools"
3[Gui.CategoryOrder("My Ints", 3)] // and finally "My Ints"
4public class MyCustomIndicator : Indicator
5{
6 #region Properties
7
8 [Display(GroupName="My Ints")]
9 public int MyCustomInt
10 { get; set; }
11
12 [Display(GroupName="My Bools")]
13 public bool MyCustomBool
14 { get; set; }
15
16 [Display(GroupName="My Strings")]
17 public string MyCustomString
18 { get; set; }
19
20 #endregion
21}