Announcement

Collapse
No announcement yet.

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 CarlTrading, 03-31-2026, 09:41 PM
              1 response
              83 views
              1 like
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 04-01-2026, 02:41 AM
              0 responses
              45 views
              0 likes
              Last Post CarlTrading  
              Started by CaptainJack, 03-31-2026, 11:44 PM
              0 responses
              65 views
              2 likes
              Last Post CaptainJack  
              Started by CarlTrading, 03-30-2026, 11:51 AM
              0 responses
              68 views
              0 likes
              Last Post CarlTrading  
              Started by CarlTrading, 03-30-2026, 11:48 AM
              0 responses
              57 views
              0 likes
              Last Post CarlTrading  
              Working...
              X