I scanned all issues regarding ways to start the Indicator parameter screen with group/category collapse. The only valid but unsupported solution I saw, was the use of [CategoryDefaultExpanded(false)] and/or [CategoryExpanded("Group/Category Name", false)]. I did try them both, with or without the "Gui." in front.
While the [Gui.CategoryOrder("Group/Category Name", orderValue)] works, the Expanded has no effect, the my code below. Am I doing something wrong?
I did see a suggestion by @jeronymite, on issue 1150613 from 2012, to use WpfPropertyGrid class, which contains a collection of CategoryItem in Categories, and a collection of PropertyItem in Properties, but I a not clear of where do I need to add this code:
for (int i = 0; i < propgrid.Properties.Count; i++)propgrid.Properties[i].IsExpanded = <true or false, as you wish>; for (int i = 0; i < propgrid.Categories.Count; i++) propgrid.Categories[i].IsExpanded = <true or false, as you wish>;
#region #### GUI Order & Expanded #### [Gui.CategoryDefaultExpanded(false)] [Gui.CategoryOrder("Trends Params", 110)] [Gui.CategoryOrder("Signals Params", 120)] [Gui.CategoryOrder("Setup #1 Dir Mom Break Rule", 210)] [Gui.CategoryOrder("Setup #2 NonDir DivMom Break Rule", 220)] [Gui.CategoryOrder("Setup #3 NonDir MTFDetour Break Rule", 230)] [Gui.CategoryOrder("Setup #4 Dir Trend Rule", 240)] [Gui.CategoryOrder("Setup #5 Initial Trend Rule", 250)] [Gui.CategoryOrder("Trends Visual", 1110)] [Gui.CategoryOrder("Signals Visual", 1120)] [Gui.CategoryOrder("Setups Visual", 1200)] [Gui.CategoryExpanded("Trends Params", false)] [Gui.CategoryExpanded("Signals Params", false)] [Gui.CategoryExpanded("Setup #1 Dir Mom Break Rule", false)] [Gui.CategoryExpanded("Setup #2 NonDir DivMom Break Rule", false)] [Gui.CategoryExpanded("Setup #3 NonDir MTFDetour Break Rule", false)] [Gui.CategoryExpanded("Setup #4 Dir Trend Rule", false)] [Gui.CategoryExpanded("Setup #5 Initial Trend Rule", false)] [Gui.CategoryExpanded("Trends Visual", false)] [Gui.CategoryExpanded("Signals Visual", false)] [Gui.CategoryExpanded("Setups Visual", false)] #endregion [TypeConverter("NinjaTrader.NinjaScript.Indicators. BW4U.BWTTraderProperties")] public class MyIndicator: Indicator { ... }
Comment