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 carnitron, Today, 08:42 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post carnitron  
                              Started by strategist007, Today, 07:51 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post strategist007  
                              Started by StockTrader88, 03-06-2021, 08:58 AM
                              44 responses
                              3,974 views
                              3 likes
                              Last Post jhudas88  
                              Started by rbeckmann05, Today, 06:48 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post rbeckmann05  
                              Started by rhyminkevin, Today, 04:58 PM
                              4 responses
                              58 views
                              0 likes
                              Last Post dp8282
                              by dp8282
                               
                              Working...
                              X