Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to make parameter read-only

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

    How to make parameter read-only

    In v6.5, I could make a parameter for my indicators read-only (not allowing input) like this:

    Code:
    [Description("Use this web site for support")]
            [GridCategory(" Dashboard")]
            [Gui.Design.DisplayNameAttribute(" Support")]
            public string WebSite
            {
                get { return "http://protradingtools.com"; }
            }

    In v7.0, I get an error when I use this technique:
    Property or indexer 'NinjaTrader.Indicator.ptt_RefreshMatrix.WebSite' cannot be assigned to -- it is read only

    How do you do this in v7.0?

    Thanks!

    #2
    cassb, which NT 7 version do you use? Your snippet compiles and works for me here.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      cassb, which NT 7 version do you use? Your snippet compiles and works for me here.
      I'm using Beta 14. Something seems to be screwed up with my installation then, because I have another thread here about the "enum" function not working in NT7 either. Hm. The weird thing is that this all used to work OK on a previous beta version back in January, but last week I formatted my hard drive and reinstalled NT6.5 and NT7 and now it doesn't compile any more. I'm not sure how to troubleshoot it, either. Can you help?

      Comment


        #4
        Are you using any custom assemblies not protected via Protector 31 and beta 14?

        It would help if you send me a full screenshot of the errors you get with your trace and logs to support at ninjatrader dot com Attn Bertrand.

        Thanks

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Are you using any custom assemblies not protected via Protector 31 and beta 14?

          It would help if you send me a full screenshot of the errors you get with your trace and logs to support at ninjatrader dot com Attn Bertrand.

          Thanks
          Here you go. This is the indicator code and the compile error I get. I can send you the log and trace files too if you want. Just let me know.

          Thanks!
          Bryan
          Attached Files

          Comment


            #6
            For this input please use only 'Category' and not 'GridCategory', the attached should compile well.
            Attached Files

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              For this input please use only 'Category' and not 'GridCategory', the attached should compile well.
              Yes, it does compile with [Category], but Dierk says not to use that in version 7 any more and to only use [GridCategory]. So what should I do?

              Comment


                #8


                Please see this post on GridCategory vs Category usage.

                Comment


                  #9
                  Originally posted by NinjaTrader_Bertrand View Post
                  http://www.ninjatrader-support2.com/...3&postcount=14

                  Please see this post on GridCategory vs Category usage.
                  Josh said: "Development says that GridCategory should be used only for parameters (what will be listed in your indicator method). Should you want something that is not a parameter property you should use Category."

                  So are you saying that the 'read-only' parameter that I want to display in my indicator method is treated as something that is not a parameter property then?

                  Comment


                    #10
                    cassb,

                    Please clarify what exactly you are trying to do. A parameter by definition is something that is changeable and those are set to GridCategory. If you want something that is not part of your indicator method call then you would use Category.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Josh View Post
                      cassb,

                      Please clarify what exactly you are trying to do. A parameter by definition is something that is changeable and those are set to GridCategory. If you want something that is not part of your indicator method call then you would use Category.
                      Hi Josh. I just wanted an informational piece to be displayed in the list of parameters to point users to our web site for support. I didn't see any other way to do that in the indicator itself (to have informational data display). I saw you had other std indicators that have read-only parameters in some cases, so I put that idea to my own use.

                      Bryan

                      Comment


                        #12
                        cassb,

                        Would the indicator description field work better for this? That will show up as they click your indicator in the bottom right gray space below the properties grid.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_Josh View Post
                          cassb,

                          Would the indicator description field work better for this? That will show up as they click your indicator in the bottom right gray space below the properties grid.
                          No, we use that "Label" parameter to describe what the indicator does. I like the look of the read-only parameter for information like our support web page.

                          Bryan

                          Comment


                            #14
                            cassb, curious have you tried a readonly string?

                            Comment


                              #15
                              Originally posted by NinjaTrader_Bertrand View Post
                              cassb, curious have you tried a readonly string?
                              What do you mean?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              599 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              344 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
                              558 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              557 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X