Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hide/Remove Properties From Indicator Settings

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

    Hide/Remove Properties From Indicator Settings

    Hi everyone,

    While applying an indicator on the chart, we see the following groups of Properties related to an indicator:
    1. Parameters
    2. Data Series
    3. Setup
    4. Visual
    5. Lines
    6. Plots
    Under every group there are several properties like in the Setup group, three properties are listed: (a) Calculate (b) Label (c) Maximum bars look back.
    For a project, I have an important objective to hide/remove all the properties listed under the following groups:
    1. Data Series
    2. Setup
    I found the command [Browsable(false)] and through some reverse engineering developed the following code:
    #region Properties
    [ NinjaScriptProperty ]
    [Browsable(false)]
    [ Display (Name = "Calculate", Order =1 , GroupName= "Setup" )]
    public string Calculate
    {get; set; }
    #endregion
    This successfully removed the property Calculate from the Setup group. I tried doing the same thing for other properties Label, Maximum bars look back but it did not work, perhaps due to the fact that I don’t know exactly the name and type of these properties.
    Is there any file in the NinjaTrader where I can find the details (name, type etc.) of the rest of the properties and then I combine them with [Browsable(false)] to hide/remove them from indicators' settings? I welcome to suggest if there is an alternative way of doing this.

    Thanks.


    #2
    Hello Mubeen Haider,

    Thanks for your post.

    Please see the following code below which utilizes the [Browsable(false)] NinjaScript attribute to hide the Input Series, Calculate, Label, and Maximum Bars Look Back properties from the property grid.

    Code:
    [ NinjaScriptProperty ]
    [Browsable(false)]
    [ Display (Name = "Input Series", Order = 0 , GroupName= "Data Series" )]
    public string InputUI
    {get; set; }
    
    [ NinjaScriptProperty ]
    [Browsable(false)]
    [ Display (Name = "Calculate", Order =1 , GroupName= "Setup" )]
    public string Calculate
    {get; set; }
    
    [ NinjaScriptProperty ]
    [Browsable(false)]
    [ Display (Name = "Maximum bars look back", Order =1 , GroupName= "Setup" )]
    public string MaximumBarsLookBack
    {get; set; }
    
    [ NinjaScriptProperty ]
    [Browsable(false)]
    [ Display (Name = "Label", Order =1 , GroupName= "Setup" )]
    public string Name
    {get; set; }
    Or, you could use a TypeConverter to hide certain default indicator properties. See the example script in the forum post linked below which demonstrates using a TypeConverter to customize a property grid.

    Something you could do to find the list of property names available is to add the following code to the 'Use Case #1/#2' section of SampleIndicatorTypeConverter to loop through property names and then try to remove each property to identify the right one. Property names will display in a New > NinjaScript Output window. Please note that this approach is not documented.

    Code:
    foreach(PropertyDescriptor pDesc in propertyDescriptorCollection)
        NinjaTrader.Code.Output.Process(pDesc.DisplayName + " " + pDesc.Name, PrintTo.OutputTab1);
    Using a TypeConverter to Customize Property Grid Behavior: https://ninjatrader.com/support/foru...havior?t=97919

    Let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hello Brandon,
      So, pleasant! what a quick and to the point support. Yes, it served my purpose. Really thankful and humbled. Have a nice day!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      581 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      338 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X