- The GUI property is dynamically initialized in State.SetDefaults. For a variety of reasons it would be better to initialize properties at compile time so far as possible. It is rare that a property needs dynamic initialization.
- The wizard provides no place to specify the GUI-friendly name for a property. It enforces a C# identifier syntax on the name, which is not what you want to see in the GUI.
I also see that the DefaultValue attribute does not work. In NT7 best practices was to set the DefaultValue attribute for a property that was going to show up in the GUI. Doing so allowed the GUI to display the default value in plain font, and any changes in bold font. That made it easy for the user to see what he had changed -- a nice touch. NT8 does not honor the DefaultValue attribute. Is there some alternative way to accomplish the same thing?
The generated code had this line:
[Display(Name="Length", Description="Number of bars to use when calculating this indicator", Order=1, GroupName="Parameters")]
What I do not see is the description showing up anywhere in the Indicators dialog. Am I missing something?
Another thing in the generated code that is not best practices: the property access to the plots in the Values[] array is a hard-coded offset. That is fragile. I added 3 lines and 2 plots in the wizard, in that order, so the hard-coded offsets are Values[3] and Values[4]. Those will be wrong if I add another line, or decide to remove a line. The code and the property are far enough away that the need to make a matching change is not obvious. It would be a lot less fragile if the code had some symbolic way to track the proper offset into the Values[] array.
--EV
Comment