Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hide input parameters from the strategy graphical interface

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

    Hide input parameters from the strategy graphical interface

    Code:
        public class Strategy1 : Strategy
        {
    
            private double     volumeMultiple             = 3;    
            private double     stopLossPct             = 1;    
            private double     trailingStopPct         = 0.5;    
            private int     atrPeriod                 = 28;    
            private double     trailStop                 = 0;    
            private double     StopLoss                 = 1;
            private double     prevValue                 = 0;    
            private bool     justEntered             = false;
    ​​
    I have these input on my strategy that show on the interface when I add the strategy to the chart.
    I want to hide these from the graphical interface.
    I want to only be able to edit them on ninjascript editor. and they don't show on the strategy parameters when I add it to the chart.

    How can I achieve that please?

    #2
    Hello onlinebusiness,

    What you have shown would only be visible to the strategy because they are private, you likely have additional properties near the bottom of the file which are marked public. Anything marked public with a NinjaScriptProperty attribute will show up as a user input.

    For example this would show up in the properties and also in the charts label after the strategies name:

    Code:
    [Range(1, int.MaxValue), NinjaScriptProperty]
    [Display(ResourceType = typeof(Custom.Resource), Name = "Period", GroupName = "NinjaScriptParameters", Order = 0)]
    public int Period
    { get; set; }


    To hide this from the chart you can change the DisplayName like shown in the helpguide here: https://ninjatrader.com/support/help...ub=displayname

    Overrriding the display name will hide the parameters. You can do this manually as well by opening the strategies menu in the chart, select your strategy and delete the Label text.

    To hide items from the strategy properties window it would be best to remove the public property and just use a private variable like you have in your post.

    Comment

    Latest Posts

    Collapse

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