Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator to Plot Current Values Only

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

    Indicator to Plot Current Values Only

    Dear Support,

    How to modify an indicator such as the PriorDayOHLC to plot only the most recent PriorDayOHLC values without ploting the history data. This is usefull to reduce chart clutter.

    Thanks.

    #2
    Hello aligator,

    It would be necessary to call <Series>.Reset(barsAgo) on the previous bars.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello aligator,

      It would be necessary to call <Series>.Reset(barsAgo) on the previous bars.
      https://ninjatrader.com/support/help.../nt8/reset.htm
      Thank you Chelsea,

      But the Reset() does not return a value since the value will be set to zero. In the case of PriorDayOHLC, the values are simply constants that will plot horizontal lines on the current day. Any ways to simply delete or clear the historical lines? Or perhaps if there is a sample code that will plot only the most recent line within a certain span of time?

      Thanks

      Comment


        #4
        Hello aligator,

        The lines are plots.

        <Series>.Reset() unsets the plot between bar segments and removes the plot on those bars.

        You could also set the PlotBrushes to transparent for those bars.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello aligator,

          The lines are plots.

          <Series>.Reset() unsets the plot between bar segments and removes the plot on those bars.

          You could also set the PlotBrushes to transparent for those bars.
          Thanks Chelsea,

          Seems like I am not asking the right question since I can not get Reset() to do what I want.

          Let say I want to modify the PriorDayOHLC indicator to ONLY show (plot) values for the current day (Red BG) and does not show values for the past days (Green BG) in this screenshot. How do I do that?

          Many thanks.

          Attached Files

          Comment


            #6
            Hello aligator,

            The lines on the chart are plots added with AddPlot() in State.SetDefaults.

            As long as the plot has a value on a particular bar and the color is not set to transparent, the plot line is going to show on the chart.

            If you don't want the plot showing on the bars on previous days, it would be necessary to loop through those days and unset the plot so that there is no value on those bars (or set the PlotBrushes for each plot on that bar index to transparent).

            Unfortunately, my answer is still to loop through those bar indexes and use Values[plot index].Reset(bar index) to unset the values, or loop through those bar indexes and set the PlotBrushes to transparent.

            If you are trying to ask how to loop from the bar of the previous session to the first bar (bar 0), you can loop from Bars.BarsSinceNewTradingDay to CurrentBar.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            628 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            359 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            562 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X