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

Label Parameters

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

    Label Parameters

    I'm dissecting an indicator.and am trying to understand how the contents of the 'Label' and other parameters get written on to the top of the indicator. What statement(s) determine what gets written at the top of the indicator?

    #2
    Hello dmking,

    We have a sample that explains the indicators label and how to format/remove it in the following link: https://ninjatrader.com/support/help...lightsub=label

    The label can be controlled by the user from the indicators properties menu or in code. If you use custom formatting in code, you can remove the label or reduce its length/make it more readable if needed.

    Keep in mind if you remove the label completely in code using the DisplayName override, that can change how the item is listed in the platforms user interface. Generally, you should also use the State object to provide a default label. You can find an example here: http://ninjatrader.com/support/forum...6&postcount=24


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for the response Jesse, I'll look at the example, and very good guidance.

      D

      Comment


        #4
        Jesse,

        A follow up question. I want to leave the Indicators: Properties: Parameters Alone. That is, I want to be able to configure the parameters from the UI. The Properties: Label correctly only contains the name of the Indicator. I don't want to see the Parameters on the top of the chart. What do I change in the code to avoid this.

        This is urgent, so get back to me when you have the time.

        D

        Comment


          #5
          Sorry,

          This is NOT urgent.

          Comment


            #6
            Jesse,

            I reread what you sent, and the examples and got things to work using

            Code:
              public override string DisplayName
                        {
                        get { return "RepeaterV2.1"; } // to prevent showing all parameters (60+) on the chart
                        }
            But it would be useful to know how the label on the Top of the Chart gets generated and how to code to avoid that without using the workaround above.

            D

            Comment


              #7
              Hello dmking,

              Thank you for your reply.

              The label in the chart is generated from a combination of the Label property that you can set in the UI along with the user inputs. The syntax you have shown is not a workaround but would be the correct way to modify the label from code. This allows you to remove the parameters or add in just the important ones you wanted to see. This is simply a string which is returned when the label is requested from the indicator. The second thread I had linked demonstrates how to use the State object with this override in case you wanted specifically use a blank label as that causes the user interface to have a blank indicator listed.

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by mjairg, 07-20-2023, 11:57 PM
              3 responses
              213 views
              1 like
              Last Post PaulMohn  
              Started by TheWhiteDragon, 01-21-2019, 12:44 PM
              4 responses
              544 views
              0 likes
              Last Post PaulMohn  
              Started by GLFX005, Today, 03:23 AM
              0 responses
              3 views
              0 likes
              Last Post GLFX005
              by GLFX005
               
              Started by XXtrader, Yesterday, 11:30 PM
              2 responses
              12 views
              0 likes
              Last Post XXtrader  
              Started by Waxavi, Today, 02:10 AM
              0 responses
              7 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Working...
              X