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 RideMe, 04-07-2024, 04:54 PM
        6 responses
        31 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        2 views
        0 likes
        Last Post tkaboris  
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,281 views
        0 likes
        Last Post Leafcutter  
        Started by WHICKED, Today, 12:45 PM
        2 responses
        19 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by Tim-c, Today, 02:10 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X