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

hiding indicator name on screen

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

    hiding indicator name on screen

    I want to hide the indicator name on the screen so if there more than 1 indicator it doesn't cover real estate.

    #2
    Hello ballboy11,
    Thanks for your post.

    Currently this is only possible by removing the text from the "Label" setting inside your indicators settings. We are tracking interest to have a feature to easily show/hide labels and we are tracking with the ticket ID SFT-3620. I've added a vote on your behalf.

    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Add my vote for this feature please

      Comment


        #4
        Add my vote too.

        Comment


          #5
          Add my vote for this feature please

          Comment


            #6
            Hello jvanelli,

            Thanks for the feedback, your vote has been added.

            (Leeroy_Jenkins and molecool, your votes have already been tracked.)
            JimNinjaTrader Customer Service

            Comment


              #7
              I just figured out you can OVERRIDE the text programmatically. This will be standard in all my indies from this point forward

              Seems you can simply add this:
              Code:
              public override string DisplayName //Override display Name
              {
                  get { return ""; }
              }

              Comment


                #8
                Originally posted by forrestang View Post
                I just figured out you can OVERRIDE the text programmatically. This will be standard in all my indies from this point forward

                Seems you can simply add this:
                Code:
                public override string DisplayName //Override display Name
                {
                get { return ""; }
                }
                Actually... there is a problem with this. It will depopulate the text in the indicator field in the user input screen. You can use something like:
                Code:
                public override string DisplayName //Override display Name
                {
                get { return Name; }
                }


                The above will at least show a simplified version of the label(w/o all of the settings), and will populate the text field in the user input screen.

                Comment


                  #9
                  +1 sft-3620

                  Comment


                    #10
                    Hello RFrosty,

                    Thanks for your note.

                    Your vote has been added to SFT-3620.

                    Let us know if we may assist further.
                    Brandon H.NinjaTrader Customer Service

                    Comment


                      #11
                      Add my vote please. Thank you.

                      Comment


                        #12
                        Add my vote as well!

                        Comment


                          #13
                          If this helps.

                          As an example I created a copy of the NT8 EMA indicator and added the code for what you want to chose to display or not the indicator name.

                          I've attached it as "EMA No Label NT8.zip" so you can view the code for yourself.

                          It's best to first make a copy of the indicator/s you want to edit the code for.
                          You can always delete the original once you know you've added the code correctly.


                          In OnStateChange I added:-


                          Code:
                          DisplayIndicatorName = false;
                          Note: I set this to "false" so saves unticking the box..(see below)



                          Just above OnBarUpdate I added:-

                          Code:
                          public override string DisplayName
                          {
                          get { if (State == State.SetDefaults)
                          return Name;
                          else if (DisplayIndicatorName)
                          return Name;
                          else return ""; }
                          }

                          In Properties I added:-

                          Code:
                          [NinjaScriptProperty]
                          [Display(Name="Show Indicator Name", Description="Draw a symbol to mark change in direction", Order=1, GroupName="Setup")]
                          public bool DisplayIndicatorName
                          { get; set; }
                          Note: you can chose the GroupName for where in the indicator dialog the tick box will appear. ie "Setup" and you can type in your own Display Name ie: "Show Indicator Name"



                          The whole code with the additions in green:


                          Code:
                          public class EMANoLabel : Indicator
                          {
                          private double constant1;
                          private double constant2;
                          
                          protected override void OnStateChange()
                          {
                          if (State == State.SetDefaults)
                          {
                          Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDe scriptionEMA;
                          Name = "EMANoLabel";
                          IsOverlay = true;
                          IsSuspendedWhileInactive = true;
                          Period = 14;
                          
                          [B]///added Display name[/B]
                          [COLOR=#27ae60][B]DisplayIndicatorName = false;[/B][/COLOR]
                          
                          AddPlot(Brushes.Goldenrod, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNa meEMA);
                          }
                          else if (State == State.Configure)
                          {
                          constant1 = 2.0 / (1 + Period);
                          constant2 = 1 - (2.0 / (1 + Period));
                          }
                          }
                          
                          [B]///added Display Name[/B]
                          [COLOR=#27ae60][B]public override string DisplayName
                          {
                          get { if (State == State.SetDefaults)
                          return Name;
                          else if (DisplayIndicatorName) return Name;
                          else return "";
                          }
                          }[/B][/COLOR]
                          
                          protected override void OnBarUpdate()
                          {
                          Value[0] = (CurrentBar == 0 ? Input[0] : Input[0] * constant1 + constant2 * Value[1]);
                          }
                          
                          #region Properties
                          [Range(1, int.MaxValue), NinjaScriptProperty]
                          [Display(ResourceType = typeof(Custom.Resource), Name = "Period", GroupName = "NinjaScriptParameters", Order = 0)]
                          public int Period
                          { get; set; }
                          
                          [B]///Display Indicator Name[/B]
                          [B][COLOR=#27ae60][NinjaScriptProperty][/COLOR]
                          [COLOR=#27ae60][Display(Name="Show Indicator Name", Description="Draw a symbol to mark change in direction", Order=1, GroupName="Setup")] public bool DisplayIndicatorName
                          { get; set; }[/COLOR][/B]
                          
                          #endregion }

                          You'll then get a box you can tick to display or untick to not display the indicator name on the chart:

                          Click image for larger version

Name:	EMA No Label NT8.jpg
Views:	417
Size:	35.7 KB
ID:	1208728

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by RubenCazorla, Today, 09:07 AM
                          2 responses
                          11 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by i019945nj, 12-14-2023, 06:41 AM
                          7 responses
                          81 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by timmbbo, 07-05-2023, 10:21 PM
                          4 responses
                          158 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Started by tkaboris, Today, 08:01 AM
                          1 response
                          7 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Started by Lumbeezl, 01-11-2022, 06:50 PM
                          31 responses
                          819 views
                          1 like
                          Last Post NinjaTrader_Adrian  
                          Working...
                          X