This is how you do it.
Background
When you create a new property you can use attributes to customise how it will be display to the user. Attributes are the words in the square brackets prior to the definition of your property ( eg: yOffset. in the code below)
Description: sets the text that you want displayed in the help area when the user clicks on this property.
DisplayName: lets you change the property name so it is nicer to read. ie put in Spaces. As the names are sorted alphabetically, if you use different letters you can change the order of the parameters. If that is insufficient, you can prefix one or more tab characters "\t" to the name. ie: "\tText Position". The property with the most tab chars goes to the top of the list.
Category: it is safest to leave this as "Parameters" but that is what this post is about.
[Description("Y Offset of text from Bottom of Panel")]
[Category("Parameters - Font")]
[Gui.Design.DisplayName("Text Position")]
publicfloat YOffset
{
get { return yOffset; }
set { yOffset = Math.Min(Math.Max(0,value),1000); }
}
Changing the Category Value
If you set the Category attribute to something other than "Parameters " then a new group is created in the Indicators Property dialog.
This provides the following benefits:-
- All Properties with the same Categoryname get grouped together.
- The groups can be shrunk with the +/- button to save space.
- These property values don't display up the top of your chart, but you can still see the properties with "Parameters" grouping.
- These properties can't be accessed from other parts of Ninja. So if you intend to use your indicator in a Strategy or Market Analyzer & can't leave this with a default value, you should not set its category name to something other than "Parameters"
Note: From what I read. In Ninja V7.0 they have improved support for this.
- The [Category("...")] attribute will be renamed to be GridCategory("...")]
- But the syntax changes from [Category("Parameters")] to be
[GridCategory("<AnyText>")]
Disclaimer: While is looks like this will be supported in v7.0. In v6.5 this is unsupported. Please test thoroughly.
I hope you find this useful
Dave

Comment