Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to set dynamic value for Line?

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

    how to set dynamic value for Line?

    Hello,

    In Initialize I have...

    Add(new Line(Color.Black, AlertLevel, "Line"));

    How can I dynamically change where the Line is plotted, based on a new value of AlertLevel (that would occur during an OnBarUpdate)?

    I do not have the correct value of AlertLevel at Initialize time.

    thank you

    #2
    Hello,

    You an use Lines which is similar to Values in NinjaScript.

    Here is the syntax:

    Code:
    Lines[0].Value = 200;
    Also one note about Lines, if the value of the price is 1000, and my Line is 100, I would not see the line because these do not autoscale. So please keep this in mind if you do not see the line, look at the charts Price opposed to the Lines value and see that value is on the chart or not.

    I look forward to being of further assistance.

    Comment


      #3
      Originally posted by Turtle Trader View Post
      Hello,

      In Initialize I have...

      Add(new Line(Color.Black, AlertLevel, "Line"));

      How can I dynamically change where the Line is plotted, based on a new value of AlertLevel (that would occur during an OnBarUpdate)?

      I do not have the correct value of AlertLevel at Initialize time.

      thank you
      You probably should use the DrawLine() method, instead of a static line in Initialize().

      Comment


        #4
        You can also add a simple plot and select the PlotStyle HLine. This has the advantage to allow you to understand where your line was historically plotted, when you scroll back your chart horizontally.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        630 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        564 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X