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 judysamnt7, 03-13-2023, 09:11 AM
              4 responses
              59 views
              0 likes
              Last Post DynamicTest  
              Started by ScottWalsh, Today, 06:52 PM
              4 responses
              36 views
              0 likes
              Last Post ScottWalsh  
              Started by olisav57, Today, 07:39 PM
              0 responses
              7 views
              0 likes
              Last Post olisav57  
              Started by trilliantrader, Today, 03:01 PM
              2 responses
              22 views
              0 likes
              Last Post helpwanted  
              Started by cre8able, Today, 07:24 PM
              0 responses
              10 views
              0 likes
              Last Post cre8able  
              Working...
              X