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 CarlTrading, Yesterday, 09:41 PM
        1 response
        21 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, Today, 02:41 AM
        0 responses
        8 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, Yesterday, 11:44 PM
        0 responses
        20 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        34 views
        0 likes
        Last Post CarlTrading  
        Working...
        X