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

How to default Indicator Label to empty/blank?

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

    How to default Indicator Label to empty/blank?

    When I add an indicator to a chart, I would prefer that the Label be blank by default.

    If in State == State.SetDefaults if I set Name to empty string, will that do it?

    I know I can manually do it in the Indicator dialog, but would prefer to not have to remember to do it each time.

    thx

    #2
    Hello llanqui,

    You can override the DisplayName method.

    Below is a link to the help guide.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      would that then be this???


      public override string DisplayName
      {
      set{ "" };
      }

      or, would this work

      DisplayName = ""

      ??​

      Comment


        #4
        Oh...well it says that it is read only...

        I'll try to set the Name = "" in State.SetDefaults and see if that works

        Comment


          #5
          Hello llanqui,

          Overriding the method would be correct, but the code would appear like the example in the help guide returning a string from the getter.

          Code:
          public override string DisplayName
          {
          get { return string.Empty; }
          }
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            yeah, that makes sense....C# is not my first language...thanks

            Comment


              #7
              Is there a way to do that globally so I dont hve to do it in each indicator script?

              Comment


                #8
                Hello llanqui,

                Unfortunately no, this would have to be coded into each script.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  what about in an AddOn?

                  Comment


                    #10
                    Hello llanqui,

                    Addons do not appear in the indicator window and do not have display name and do not appear on a chart and have no chart label.

                    The MenuItem and Caption would be whatever you have set these to.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      ok, then it seems the AddOn cannot be used to make global configuration changes for indicators...

                      thanks

                      Comment


                        #12
                        Hello llanqui,

                        There would not be any supported means for an addon to make global configuration changes to indicators.

                        However, you may be able to create unsupported code to do so.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          ::-) OK Thanks

                          Comment


                            #14
                            Ok, I used this in all my indicators and recompiled


                            public override string DisplayName
                            {
                            get { return string.Empty; }
                            }

                            and that removed the Indicator Label from the Chart

                            however, it also removed all the Labels/Indicator Names in the Configured column (right mouse click on chart, Indicators)

                            the Indicators are still on the Chart, but there is no name in the Configured column...


                            ????

                            Comment


                              #15
                              and all my chart indicator templates are the same...when I load a template there is no name in the Configured column of the Chart Indicator Dialog

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by CrissCross, Today, 01:34 PM
                              1 response
                              15 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by rtwave, Today, 09:14 AM
                              2 responses
                              18 views
                              0 likes
                              Last Post rtwave
                              by rtwave
                               
                              Started by nandhumca, Today, 12:09 PM
                              1 response
                              9 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by nandhumca, Today, 12:23 PM
                              1 response
                              8 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by RaddiFX, 09-28-2021, 09:42 PM
                              7 responses
                              217 views
                              0 likes
                              Last Post nandhumca  
                              Working...
                              X