Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add(new Line with input parameters

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

    Add(new Line with input parameters

    Hello
    I have an indicator where I want to draw a line based on input parameters:
    Add(new Line(Color.Green, InputVariable, "MyLine"));

    The Add command can only be called in the initialize function. But it ignores the input values, it always takes the default values. Seems that initialization is executed first and then user input is read.
    Why? Seems quite strange.

    thanks

    #2
    Hello Beauregard,

    Lines added with the new line in Initialize() are not meant to be dynamic.

    If you want have lines be dynamic with a user defined input parameter, they will need to be setup as either a horizontal lines with DrawHorizontalLine(), or by setting a plot value to the input, like is done with the ConstantLines indicator that comes preloaded inside of NinjaTrader.

    http://www.ninjatrader.com/support/h...zontalline.htm
    JCNinjaTrader Customer Service

    Comment


      #3
      thanks for the fast answer.
      I have done it now with DrawHorizontalLine in the OnBarUpdate() method.
      The problem now: I have a chart and in panel 1 and in panel 2 the indicator values. The DrawHorizontalLine is done in the panel 1, but I want it in panel 2. I could not find any method to define this?

      Comment


        #4
        Hello Beauregard,

        You will want to set the DrawOnPricePanel to false inside of Initialize().

        http://www.ninjatrader.com/support/h...pricepanel.htm
        JCNinjaTrader Customer Service

        Comment


          #5
          thanks! it worked

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          596 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          343 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          556 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          554 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X