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

Add new Line

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

    Add new Line

    Hi ,

    Suppose I use the following in the Initialize() section:

    Add(new Line(Color.Blue, myLevel, "levelBase"));

    This works fine and sets the line at the value myLevel. myLevel is an input parameter. Here is the issue: if I open the indicator and change the value of the line through the indicator panel, the position of the line changes to the new value. I would like to prevent this; i.e. I want to disallow the user from changing the value inthe indicator panel. Can this be done? Please let me know. Thanks.

    #2
    Hello Zeos6,
    To clarify further if you do not wish to be value selected/changed then why on the first place you are setting it as a input parameter.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hi,

      To clarify: I want to be able to change the value through myLevel input parameter ONLY, not thoriugh the parameters in the indicator under the Lines section.

      Comment


        #4
        Hello Zeos6,
        Thanks for the clarification.

        Please append the below code to disable the Lines from showing up in the indicator parameter selection box.

        Code:
        this.LinesConfigurable = false;
        Note, this will remove all the values (colors etc) and not just the input value for the line.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Perfect. I set the color, line width and style in code. Thank you very much.
          However, now the myLevel parameter does not allow me to change the level setting. I just need to disable the value portion in the Lines.
          Last edited by Zeos6; 01-25-2013, 01:29 PM.

          Comment


            #6
            Hello Zeos6,
            To set a value via a custom input parameter please use the below code (say in OnStartUp event)
            Code:
            Lines[0].Value = myLevel;
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              That did the trick. Thank you for your help Joydeep.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by GussJ, 03-04-2020, 03:11 PM
              11 responses
              3,229 views
              0 likes
              Last Post xiinteractive  
              Started by andrewtrades, Today, 04:57 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by chbruno, Today, 04:10 PM
              0 responses
              7 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              441 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              12 views
              0 likes
              Last Post FAQtrader  
              Working...
              X