• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to disable/lock properties of indicators?

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

    How to disable/lock properties of indicators?

    Hi,

    I am writing a new indicator and want to disable/lock and hard code these properties so that users can't change them. Please let me know how to do that.. .can't seem to find a thread that shows this clearly.
    Attached Files

    #2
    Hello priceisking,
    Thanks for your post.

    You can hide properties from the indicators windows by setting the BrowsableAttribute boolean for that property to false

    Help Guide - BrowsableAttribute
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Do i have to list all properties individually or can i do it in 1 shot like this?

      #region Properties
      [Browsable(false)]
      #endregion

      I'm not able to compile with above .

      Comment


        #4
        That would need to be applied to each property individually.

        For example:
        Code:
        #region Properties
        [Browsable(false)]
        [NinjaScriptProperty]
        [Range(1, double.MaxValue)]
        [Display(Name="MyAttribute", Order=1, GroupName="Parameters")]
        public double MyAttribute
        { get; set; }
        #endregion
        Josh G.NinjaTrader Customer Service

        Comment


          #5
          Ok thank you. But I tried this with Label and it still shows up in the properties window allows modification:


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

          Comment


            #6
            You are not going to be able to remove/hide the Label property like this. That property is going to be visible on all NinjaScripts.
            Josh G.NinjaTrader Customer Service

            Comment


              #7
              Oh OK. . .so default properties i can't hide. What about custom plot colors and other settings for plots?

              Comment


                #8
                You would not be able to hide plots with BrowsableAttribute either. For plots you would want to use ArePlotsConfigurable and set it to false.

                Help Guide - ArePlotsConfigurable
                Josh G.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Vps by stooby
                Started by stooby, Today, 08:32 PM
                0 responses
                11 views
                0 likes
                Last Post stooby
                by stooby
                 
                Started by FaaastEddy, Today, 08:25 PM
                0 responses
                3 views
                0 likes
                Last Post FaaastEddy  
                Started by YevhenShynkarenko, Yesterday, 01:22 AM
                2 responses
                39 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by testingsarasa, 05-20-2018, 02:50 PM
                11 responses
                737 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by martyn73, Today, 05:27 PM
                2 responses
                10 views
                0 likes
                Last Post martyn73  
                Working...
                X