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

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.

    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    11 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    10 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    12 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,982 views
    3 likes
    Last Post jhudas88  
    Started by rbeckmann05, Yesterday, 06:48 PM
    0 responses
    10 views
    0 likes
    Last Post rbeckmann05  
    Working...
    X