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 ETFVoyageur, Yesterday, 02:04 PM
        5 responses
        38 views
        0 likes
        Last Post ETFVoyageur  
        Started by Creamers, 04-27-2024, 05:32 AM
        6 responses
        43 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by iceman2018, Today, 11:46 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Torontobluejays, Yesterday, 08:43 AM
        4 responses
        23 views
        0 likes
        Last Post Torontobluejays  
        Started by Ticks_66, Today, 09:50 AM
        2 responses
        14 views
        0 likes
        Last Post Ticks_66  
        Working...
        X