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.
      BertrandNinjaTrader Customer Service

      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 Barry Milan, Yesterday, 10:35 PM
        5 responses
        16 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by DanielSanMartin, Yesterday, 02:37 PM
        2 responses
        13 views
        0 likes
        Last Post DanielSanMartin  
        Started by DJ888, 04-16-2024, 06:09 PM
        4 responses
        12 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by terofs, Today, 04:18 PM
        0 responses
        11 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by nandhumca, Today, 03:41 PM
        0 responses
        8 views
        0 likes
        Last Post nandhumca  
        Working...
        X