Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is there a way to retain all line segments?

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

    Is there a way to retain all line segments?

    The following line of code generates a line segment for every bar update [after the first 5 bars]. However every generated line segment is not retained on the chart [ie] there is only one line segment displayed on the chart at the end. That one segment is the last one generated on last bar update.
    Is there a way to retain all segments generated.

    if (CurrentBar > 5)DrawLine( "PlotXXO",false,5,1.32,1,1.33,Color.Red,DashStyle. Solid,3);

    #2
    Originally posted by joemiller View Post
    The following line of code generates a line segment for every bar update [after the first 5 bars]. However every generated line segment is not retained on the chart [ie] there is only one line segment displayed on the chart at the end. That one segment is the last one generated on last bar update.
    Is there a way to retain all segments generated.

    if (CurrentBar > 5)DrawLine( "PlotXXO",false,5,1.32,1,1.33,Color.Red,DashStyle. Solid,3);
    You have a fixed line tag, so the line is being replaced: there will always be only the last listed segment at any time.

    Try this:
    Code:
    [FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff][B][SIZE=3][COLOR=#000000][FONT=Calibri]if (CurrentBar > 5)DrawLine( "PlotXXO" + CurrentBar.ToString(),false,5,1.32,1,1.33,Color.Red,DashStyle.Solid,3);[/FONT][/COLOR][/SIZE][/B][/COLOR][/FONT][/COLOR][/FONT][/COLOR][/FONT]

    Comment


      #3
      Thanks for the assist koganam.

      As further reference for the underlying concept you might want to check into this sample here http://www.ninjatrader.com/support/f...ead.php?t=3419 joemiller.

      Comment


        #4
        Thanks

        That fixed it,
        Thanks for the assist and the assist to the assist.
        Much appreciated.
        Joe Miller

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        103 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        52 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        34 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        37 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        74 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X