Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to custom the Strategy Analyzer panel's UI ?

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

    How to custom the Strategy Analyzer panel's UI ?

    Hi NinjaTraders,

    In the custom Genetic Optimizer I coded, I copied the default GO's UI. While this only showed my Input beneath the General Tab, Named "Misc". How can I move it to below the custom GO just like the default GO?

    Thank you!

    Code:
            #region UI Properties
            [Display(ResourceType = typeof(Custom.Resource), Name = "PercentOfAllIterations")]
            [Range(0, Int32.MaxValue)]
            public double    PercentOfAllIterations        { get; set; }
    
            #endregion

    #2
    Hello wolfcuring,

    I see you are using the Display attribute but have not assigned any category. could you try changing it to how it is shown in the sample here:



    Code:
    [Display(Name="My Period", Order=1, [B]GroupName="My Parameters"[/B])]
    public int MyPeriod
    { get; set; }
    Also please ensure to remove the following syntax from your properties:
    Code:
    ResourceType = typeof(Custom.Resource),
    This is only needed for internal strings which are localized.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you Jesse, so by changing the code into the following,

      Code:
      [Display(Name = "PercentToRun",Order=1, GroupName="GA Parameters")]
      [Range(0, Int32.MaxValue)]
      public double    PercentOfAllIterations        { get; set; }
      I can change the Group name to "GA Parameters", but it still appear below the General tab, and I have to scroll up to it to change the parameter. The Order=1 argument seems only to change the order within the "GA Parameters". Can I move the whole "GA Parameters" down below, and put it inside the Optimize tab just like the default GO ?

      Comment


        #4
        Hello wolfcuring,

        You can find more attributes that can be used in the parent page of the last one I had linked: https://ninjatrader.com/support/help...attributes.htm

        I believe you want the CategoryOrder: https://ninjatrader.com/support/help...rattribute.htm

        If you otherwise want it in the Optimize category, just use that as the GroupName.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jesse,

          Thank you for you reply. So now with the following code,

          Code:
          #region UI Properties
          
                  [Display(Name = "Z-PercentToRun",Order=5, GroupName="Optimize")]
                  [Range(0, Int32.MaxValue)]
                  public double    PercentOfAllIterations        { get; set; }
          
                  #endregion
          I can move it into the Optimize group. But, I still can not control its order, the "Order=5" argument does not seem to work.

          So, can I create a sub-group within Optimize just like the default Genetic Optimizer?

          Comment


            #6
            Hello wolfcuring,

            Thank you for the reply.

            This seems to only work for custom categories in the optimizer, so it looks like you would need to create your own category here to order the inner properties. You can look into using an ExpandableObjectConverter to create an expandable property however I would not suggest this. For strategies and other complex types this generally can result in errors during compiles.

            JesseNinjaTrader Customer Service

            Comment


              #7
              Thank you Jesse, Well then this is good enough.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              435 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              3 views
              0 likes
              Last Post FAQtrader  
              Started by rocketman7, Today, 09:41 AM
              5 responses
              18 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by frslvr, 04-11-2024, 07:26 AM
              9 responses
              127 views
              1 like
              Last Post caryc123  
              Started by selu72, Today, 02:01 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Zachary  
              Working...
              X