Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Gui.CategoryOrder is not always respected

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Strategy Gui.CategoryOrder is not always respected

    Hi,
    I wrote a strategy with many properties, divided into CategoryOrder. I do have at the top of the code the Gui.CategoryOrder declared, but regardless, a few GroupName are shown out of the order (see below the first 3, which should bee in different order: Entries, Targets, Money Management]. Attached is a MyCustomeStrategy.zip example code with only the properties declared, which you can use to replicate the issue.

    Code:
        [Gui.CategoryOrder("Structure"                  , 3000110)]
        [Gui.CategoryOrder("Entries"                  , 3000120)]
        [Gui.CategoryOrder("Risk & Stops"              , 3000130)]
        [Gui.CategoryOrder("Targets"                  , 3000150)]
        [Gui.CategoryOrder("Filter Trend"              , 3000210)]
        [Gui.CategoryOrder("Filter Momo"              , 3000230)]
        [Gui.CategoryOrder("Money Management"         , 3000400)]
         [Gui.CategoryOrder("Account"                 , 3000700)]
         [Gui.CategoryOrder("Visual"                 , 3000900)]
    ​


    Click image for larger version

Name:	Screenshot 2023-08-04 at 14.20.52.png
Views:	191
Size:	71.1 KB
ID:	1263036



    #2
    Hello Shai Samuel,

    I've tested your script but I am seeing these appear in a different order.

    Click image for larger version  Name:	2023-08-04_7-20-44.png Views:	3 Size:	23.3 KB ID:	1263062

    May I confirm you are using 8.1.1.7?


    May I confirm you are testing the script you have provided in post # 1?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Yes I am using 8.1.1.7.

      As far as reproducing the issue, opening the strategy in in the chart creates the correct order, but try opening it in Strategy:


      Click image for larger version

Name:	Screenshot 2023-08-04 at 18.23.01.png
Views:	171
Size:	665.6 KB
ID:	1263078.

      Comment


        #4
        It would seem that Strategy Analyzer may not be dealing with this the same way the chart Strategies dialog does.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment


          #5
          Hello Shai Samuel,

          Thank you for your note this can only be reproduced in the Strategy Analyzer.

          I was able to reproduce and am inquiring if this is a forced category ordering in the SA with our development.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hello Shai Samuel Bruce,

            Apologies, but I'm not actually reproducing.

            The General category will be at the top as that category cannot be modified, but everything else appears to be in order.

            Click image for larger version

Name:	2023-08-04_12-12-07.png
Views:	176
Size:	46.8 KB
ID:	1263127
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Seems very good. In this case the issue is on my computer. Is there a file (xml?) that holds the setup that I can delete and have it rebuilt?

              Comment


                #8
                Hello Shai Samuel,

                No, there wouldn't be a file for that.

                Its constructed when the instance of the strategy class is constructed.

                The Xml files are the workspace and template, which are not controlling the category order.

                Have you made modifications? If so, have you restarted NinjaTrader since making those modifications?
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Chelsea, I stripped the code in MyCustomStrategy to just 2 properties (see below) and the issue still persists.

                  This looks like some kind of BUG in my local setting, don't you think so?\

                  I have also attached the code.

                  Click image for larger version

Name:	Screenshot 2023-08-05 at 1.20.34.png
Views:	204
Size:	75.6 KB
ID:	1263170

                  Code:
                  #region Using declarations
                  using System;
                  using System.Collections.Generic;
                  using System.ComponentModel;
                  using System.ComponentModel.DataAnnotations;
                  using System.Linq;
                  using System.Text;
                  using System.Threading.Tasks;
                  using System.Windows;
                  using System.Windows.Input;
                  using System.Windows.Media;
                  using System.Xml.Serialization;
                  using NinjaTrader.Cbi;
                  using NinjaTrader.Gui;
                  using NinjaTrader.Gui.Chart;
                  using NinjaTrader.Gui.SuperDom;
                  using NinjaTrader.Gui.Tools;
                  using NinjaTrader.Data;
                  using NinjaTrader.NinjaScript;
                  #endregion
                  
                  namespace NinjaTrader.NinjaScript.Strategies
                  {
                      [Gui.CategoryOrder("Structure"               , 3000110)]
                      [Gui.CategoryOrder("Entries"                  , 3000120)]
                  
                      public class MyCustomStrategy : Strategy
                      {
                          protected override void OnStateChange()
                          {
                              if (State == State.SetDefaults)
                              {
                                  Description                                    = @"Enter the description for your new custom Strategy here.";
                                  Name                                        = "MyCustomStrategy";
                                  Calculate                                    = Calculate.OnBarClose;
                                  MaximumBarsLookBack                            = MaximumBarsLookBack.TwoHundredFiftySix;
                                  BarsRequiredToTrade                            = 20;
                                  // Disable this property for performance gains in Strategy Analyzer optimizations
                                  // See the Help Guide for additional information
                                  IsInstantiatedOnEachOptimizationIteration    = true;
                  
                              }
                              else if (State == State.Configure)
                              {
                              }
                          }
                  
                          [NinjaScriptProperty]
                          [Display(Name = "Swing Strength", Order = 2, GroupName = "Structure")]
                          public int SwingStrength { get; set; }
                  
                          [NinjaScriptProperty]
                          [Display(Name="Entry Dir Type", Order=2, GroupName="Entries")]
                          public int EntryDirType { get; set; }                    
                      }
                  }
                  ​

                  Comment


                    #10
                    Good news, I wan able to solve the issue.

                    I changed the name of the categories and they move to place.

                    This still looks like some kind of a BUG. Thanks for your support anyway.

                    Click image for larger version

Name:	Screenshot 2023-08-05 at 2.06.22.png
Views:	177
Size:	45.7 KB
ID:	1263176

                    Comment


                      #11
                      Shai Samuel Have you tried changing the values of the categories? Instead of 3000xxx, perhaps try just simply 1, 2, 3, ... ? This will at least show if it's name-related, value-related, buggy, or ... ???

                      Thanks.
                      Multi-Dimensional Managed Trading
                      jeronymite
                      NinjaTrader Ecosystem Vendor - Mizpah Software

                      Comment


                        #12
                        Thank you @jeronymite.

                        Yes I did, and it didn't help. The reason I use these numbers, is to place my groups between the NT categories.

                        Anyway, I manage to solve the issue by changing the text of the groups. I believe it is some kind of a BUG, but one that can be overcome.

                        Comment


                          #13
                          Hello Shai Samuel,

                          I've thought further about your inquiry if this could be an issue saved in an xml file.

                          May I have you try deleting the Documents\NinjaTrader 8\UI.xml file and then run the repair from the NinjaTrader installer?


                          Then let me know if you are still able to reproduce?
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Thank you Chelsea, I think this has done the job.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by NullPointStrategies, Today, 05:17 AM
                            0 responses
                            44 views
                            0 likes
                            Last Post NullPointStrategies  
                            Started by argusthome, 03-08-2026, 10:06 AM
                            0 responses
                            124 views
                            0 likes
                            Last Post argusthome  
                            Started by NabilKhattabi, 03-06-2026, 11:18 AM
                            0 responses
                            65 views
                            0 likes
                            Last Post NabilKhattabi  
                            Started by Deep42, 03-06-2026, 12:28 AM
                            0 responses
                            42 views
                            0 likes
                            Last Post Deep42
                            by Deep42
                             
                            Started by TheRealMorford, 03-05-2026, 06:15 PM
                            0 responses
                            46 views
                            0 likes
                            Last Post TheRealMorford  
                            Working...
                            X