Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limit Plot Length

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

    Limit Plot Length

    Indicator plotting a line, this like extends to the right and until the indicator creates a new plot to replace the last plot the plot continues to draw to the right with candlesticks

    How can you limit the Plot Length to ONLY a few bars

    AddPlot(new Stroke(Brushes.Lime, 1), PlotStyle.Dot, "breakupvalue_plot");



    Thanks

    #2
    Hello DTSSTS,

    If you are using a Dot style plot the most simple way to stop plotting is to just not set a value on those bars. If you set no value there will be no plot for that bar.

    You can also use the Reset method if you are doing something more complex, that would be a case where you may need to regenerate a plot and clear old values on some bars. https://ninjatrader.com/support/help...lightsub=reset

    I look forward to being of further assistance.

    Comment


      #3
      i do not see where the value is set on "those bars"

      a condition is meet and the dots are plotted and they continue for ever until another instance of that condition creates a new updated level for the plot

      I just wish to trunicate the line/plot length

      I DID NOT follow anything about the reply,

      ​​​​​​this is the area of my script that refers to OnBarUpdate

      i see the reset in the help guide but not sure where to place it and do not wish to alter any calculations

      protected override void OnBarUpdate()
      {
      if(CurrentBar > BarsRequiredToPlot) /// Only Calculate and paint bars on the screen + 30 bars
      {
      if (CurrentBar < 30)
      {
      upperBoundarySeries[0] = 0;
      lowerBoundarySeries[0] = 0;
      boxBarNumSeries[0] = 0;
      return;
      }

      Comment


        #4
        Hello DTSSTS,
        i do not see where the value is set on "those bars"

        a condition is meet and the dots are plotted and they continue for ever until another instance of that condition creates a new updated level for the plot

        I just wish to trunicate the line/plot length
        With the added syntax that does not help to see the problem. This appears to only be a portion of the script which happens during the first 30 bars, setting the plot is likely happening in other places past that point as well if you are seeing a continuous plot past 30 bars.

        I DID NOT follow anything about the reply,
        I am sorry you are having difficulty understanding, if there is a specific part which you want to go over again we can try to clarify that.


        i see the reset in the help guide but not sure where to place it and do not wish to alter any calculations
        You likely won't need this, I had provided a link to that in case you were doing something more complex with your plot. There are not many details here about what you are doing with the plot so how you stop the plot will depend on your logic. The plot can be very simple to stop plotting, you just don't set a value where you don't want the plot. If you see a plot on a bar that means you set a value on that bar in your logic.

        I look forward to being of further assistance.


        Comment


          #5
          thanks for the help

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          581 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          336 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X